/* Product Detail Modal � cart.blade.php */

/* === Product Detail Modal === */
.pd-modal .modal-dialog {
    max-width: 900px;
    margin: 1rem auto;
}
.pd-modal .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.18);
    animation: pdSlideUp 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes pdSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.pd-modal .modal-header {
    background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 100%);
    border: none;
    padding: 16px 24px;
    position: relative;
}
.pd-modal .modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0167F3, #25D366, #0167F3);
}
.pd-modal .modal-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pd-modal .modal-title i { opacity: 0.7; }
.pd-modal .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.6;
}
.pd-modal .btn-close:hover { opacity: 1; }

/* Body layout */
.pd-modal .modal-body { padding: 0; }
.pd-modal .pd-body {
    display: flex;
    min-height: 420px;
}

/* ---- Gallery side ---- */
.pd-modal .pd-gallery {
    flex: 0 0 380px;
    background: #f0f2f5;
    border-right: 1px solid #eaecf0;
    display: flex;
    flex-direction: column;
}
.pd-modal .pd-main-img {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}
.pd-modal .pd-main-img img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    transition: transform 0.4s ease;
    border-radius: 8px;
}
.pd-modal .pd-main-img:hover img { transform: scale(1.08); }
.pd-modal .pd-main-img .pd-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(1,103,243,0.9);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.pd-modal .pd-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 20px 16px;
    overflow-x: auto;
    background: #f0f2f6;
    border-top: 1px solid #eaecf0;
    scrollbar-width: none;
}
.pd-modal .pd-thumbs::-webkit-scrollbar { display: none; }
.pd-modal .pd-thumb {
    flex: 0 0 56px;
    height: 56px;
    border-radius: 8px;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.pd-modal .pd-thumb:hover { border-color: #cbd5e0; }
.pd-modal .pd-thumb.active { border-color: #0167F3; box-shadow: 0 0 0 2px rgba(1,103,243,0.2); }
.pd-modal .pd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

/* ---- Info side ---- */
.pd-modal .pd-info {
    flex: 1;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: 520px;
}
.pd-modal .pd-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.pd-modal .pd-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #0167F3;
    background: #edf2ff;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.pd-modal .pd-tag.sub {
    color: #6b7280;
    background: #f3f4f6;
}
.pd-modal .pd-name {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.3;
    margin: 0;
}
.pd-modal .pd-short-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Product code tag */
.pd-modal .pd-tag-code {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

/* Quick specs mini-grid */
.pd-modal .pd-quick-specs-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.pd-modal .pd-qspec {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: #f8f9fc;
    border-radius: 10px;
    border: 1px solid #eaecf0;
    transition: background 0.2s;
}
.pd-modal .pd-qspec:hover {
    background: rgba(1,103,243,0.04);
}
.pd-modal .pd-qspec-icon {
    width: 34px;
    height: 34px;
    background: rgba(1,103,243,0.10);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0167F3;
    font-size: 15px;
    flex-shrink: 0;
}
.pd-modal .pd-qspec-text {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.2;
}
.pd-modal .pd-qspec-text strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}

/* Manufacturer link */
.pd-modal .pd-ext-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #1565c0;
    background: rgba(33,150,243,0.08);
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.pd-modal .pd-ext-link:hover {
    background: rgba(33,150,243,0.16);
    color: #0d47a1;
}

/* Manual / Ficha Técnica download link */
.pd-modal .pd-manual-link {
    color: #1b7a34;
    background: rgba(34,197,94,0.10);
}
.pd-modal .pd-manual-link:hover {
    background: rgba(34,197,94,0.20);
    color: #14522d;
}

/* Specs mini grid */
.pd-modal .pd-specs-grid {
    display: block;
}
.pd-modal .pd-spec-html {
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    background: #f8f9fc;
    border-radius: 10px;
    padding: 14px 18px;
}
.pd-modal .pd-spec-html p {
    margin: 0 0 6px;
}
.pd-modal .pd-spec-html p:last-child {
    margin-bottom: 0;
}
.pd-modal .pd-spec-html strong {
    color: #0d1b2a;
    font-weight: 700;
    display: block;
    margin-top: 10px;
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.pd-modal .pd-spec-html p:first-child strong {
    margin-top: 0;
}
.pd-modal .pd-spec-html ul,
.pd-modal .pd-spec-html ol {
    padding-left: 20px;
    margin: 4px 0 8px;
}
.pd-modal .pd-spec-html li {
    margin-bottom: 3px;
}

/* Description */
.pd-modal .pd-desc-section {
    border: 1px solid #eaecf0;
    border-radius: 10px;
    overflow: hidden;
}
.pd-modal .pd-desc-section-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fc;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #eaecf0;
}
.pd-modal .pd-desc-section-header i {
    margin-right: 6px;
    color: #9ca3af;
}
.pd-modal .pd-desc-body {
    padding: 14px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.7;
    max-height: 180px;
    overflow-y: auto;
}
.pd-modal .pd-desc-body p { margin: 0 0 6px; }
.pd-modal .pd-desc-body p:last-child { margin-bottom: 0; }

/* Qty row */
.pd-modal .pd-qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pd-modal .pd-qty-row label {
    font-size: 13px;
    font-weight: 600;
    color: #4a4a68;
    margin: 0;
}
.pd-modal .pd-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fafb;
}
.pd-modal .pd-qty-wrap button {
    width: 38px; height: 38px;
    border: none; background: transparent;
    font-size: 17px; font-weight: 700;
    color: #6b7280; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.pd-modal .pd-qty-wrap button:hover { background: #0167F3; color: #fff; }
.pd-modal .pd-qty-wrap input {
    width: 50px; height: 38px; text-align: center;
    border: none; border-left: 2px solid #e5e7eb; border-right: 2px solid #e5e7eb;
    font-size: 15px; font-weight: 700; color: #1a1a2e; background: transparent;
    -moz-appearance: textfield;
}
.pd-modal .pd-qty-wrap input::-webkit-outer-spin-button,
.pd-modal .pd-qty-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Footer */
.pd-modal .pd-footer {
    padding: 16px 24px;
    background: #f8f9fc;
    border-top: 1px solid #eaecf0;
    display: flex;
    gap: 10px;
    align-items: center;
}
.pd-modal .pd-btn-cart {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 20px;
    background: linear-gradient(135deg, #0167F3, #0050c8);
    color: #fff; border: none; border-radius: 12px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    transition: all 0.3s;
}
.pd-modal .pd-btn-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(1,103,243,0.35);
}
.pd-modal .pd-btn-wa {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 13px 18px;
    background: #25D366; color: #fff; border: none; border-radius: 12px;
    font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: all 0.3s;
}
.pd-modal .pd-btn-wa:hover {
    background: #1fba59; color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,211,102,0.3);
}
.pd-modal .pd-btn-detail {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 13px 18px;
    background: transparent; color: #4a5568;
    border: 2px solid #e5e7eb; border-radius: 12px;
    font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: all 0.3s;
}
.pd-modal .pd-btn-detail:hover {
    border-color: #0167F3; color: #0167F3;
}

/* Loading state */
.pd-modal .pd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    gap: 16px;
    width: 100%;
}
.pd-modal .pd-spinner {
    width: 40px; height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #0167F3;
    border-radius: 50%;
    animation: pdSpin 0.7s linear infinite;
}
@keyframes pdSpin { to { transform: rotate(360deg); } }
.pd-modal .pd-loading-text { font-size: 14px; color: #9ca3af; font-weight: 500; }

/* ===== Mobile ===== */
@media (max-width: 767.98px) {
    .pd-modal .modal-dialog {
        max-width: 100%;
        margin: 0;
        min-height: 100vh;
    }
    .pd-modal .modal-content {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }
    .pd-modal .pd-body {
        flex-direction: column;
        min-height: auto;
    }
    .pd-modal .pd-gallery {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #eaecf0;
    }
    .pd-modal .pd-main-img {
        padding: 20px;
        min-height: 220px;
    }
    .pd-modal .pd-main-img img { max-height: 200px; }
    .pd-modal .pd-thumbs { padding: 10px 16px 12px; }
    .pd-modal .pd-info {
        padding: 20px;
        max-height: none;
        overflow-y: visible;
    }
    .pd-modal .pd-name { font-size: 18px; }
    .pd-modal .pd-quick-specs-mini { grid-template-columns: 1fr; }
    .pd-modal .pd-footer {
        flex-direction: column;
        position: sticky;
        bottom: 0;
        z-index: 10;
        padding: 12px 16px;
        gap: 8px;
    }
    .pd-modal .pd-footer .pd-btn-detail { display: none; }
    .pd-modal .pd-footer-row-mobile {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    .pd-modal .pd-footer-row-mobile .pd-btn-cart { flex: 1; }
    .pd-modal .pd-footer-row-mobile .pd-btn-wa { flex: 0 0 auto; }
}

@media (min-width: 768px) {
    .pd-modal .pd-footer-row-mobile { display: contents; }
}
