
/* ===== Product Detail Page ===== */
.pd-wrapper {
    padding: 30px 0 60px;
}

/* (breadcrumb uses base.html styles) */

/* Main grid */
.pd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

/* Image section */
.pd-image-section {
    position: sticky;
    top: 100px;
}

.pd-main-image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f8f8f8;
    aspect-ratio: 1 / 1;
    cursor: crosshair;
}

.pd-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.pd-main-image:hover img {
    transform: scale(1.08);
}

.pd-image-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.pd-image-badge .badge-pill {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 20px;
}

.pd-badge-new {
    background: #000;
    color: #fff;
}

.pd-badge-sale {
    background: #e8340e;
    color: #fff;
}

/* Info section */
.pd-info {
    padding-top: 8px;
}

.pd-category-link {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #999;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.pd-category-link:hover {
    color: var(--pd-accent);
    text-decoration: none;
}

.pd-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    margin-bottom: 16px;
}

/* Rating */
.pd-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.pd-stars {
    display: flex;
    gap: 2px;
}

.pd-stars .fa-star,
.pd-stars .fas {
    color: #ffc107;
    font-size: 14px;
}

.pd-stars .far {
    color: #ddd;
    font-size: 14px;
}

.pd-rating-text {
    font-size: 13px;
    color: #999;
}

/* Price */
.pd-price-block {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.pd-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--pd-accent);
    line-height: 1;
}

.pd-price-original {
    font-size: 18px;
    color: #bbb;
    text-decoration: line-through;
    font-weight: 400;
}

.pd-price-note {
    font-size: 12px;
    color: #999;
    margin-bottom: 24px;
}

/* Stock */
.pd-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.pd-stock-in {
    background: #d4edda;
    color: #155724;
}

.pd-stock-out {
    background: #f8d7da;
    color: #721c24;
}

.pd-stock i {
    font-size: 11px;
}

/* Divider */
.pd-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 0 0 24px;
}

/* Description */
.pd-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #666;
    margin-bottom: 28px;
}

/* Attributes (color, size, etc.) */
.pd-attributes {
    margin-bottom: 28px;
}

.pd-attr-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pd-attr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pd-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    background: #fff;
    cursor: default;
    transition: all 0.2s;
}

.pd-chip.active {
    border-color: var(--pd-accent);
    color: var(--pd-accent);
    background: rgba(255, 211, 51, 0.08);
}

.pd-chip i {
    font-size: 11px;
}

/* Quantity */
.pd-quantity-section {
    margin-bottom: 28px;
}

.pd-quantity-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.pd-quantity-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pd-qty-control {
    display: inline-flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.pd-qty-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    transition: all 0.2s;
}

.pd-qty-btn:hover {
    background: #f5f5f5;
    color: var(--pd-accent);
}

.pd-qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pd-qty-input {
    width: 56px;
    height: 44px;
    text-align: center;
    border: none;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: transparent;
    outline: none;
    /* -moz-appearance: textfield; */
}

.pd-qty-input::-webkit-outer-spin-button,
.pd-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Action buttons */
.pd-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.pd-btn-cart {
    flex: 1;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: var(--pd-accent);
    color: #1a1a2e;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 211, 51, 0.3);
}

.pd-btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 211, 51, 0.4);
    color: #1a1a2e;
    text-decoration: none;
}

.pd-btn-cart:active {
    transform: translateY(0);
}

.pd-btn-cart i {
    font-size: 18px;
}

.pd-btn-cart.disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.pd-btn-cart.disabled:hover {
    transform: none;
    box-shadow: none;
}

.pd-btn-fav {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 20px;
    color: #999;
    flex-shrink: 0;
}

.pd-btn-fav:hover {
    border-color: #e8340e;
    color: #e8340e;
    background: #fff5f5;
}

.pd-btn-fav.active {
    border-color: #e8340e;
    color: #e8340e;
    background: #fff5f5;
}

/* Share */
.pd-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.pd-share-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.pd-share-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #666;
    text-decoration: none;
}

.pd-share-btn:hover {
    background: #f5f5f5;
    color: var(--pd-accent);
    border-color: var(--pd-accent);
    text-decoration: none;
}

/* Info cards */
.pd-info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 28px;
}

.pd-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.pd-info-card i {
    font-size: 22px;
    color: var(--pd-accent);
    flex-shrink: 0;
}

.pd-info-card .text {
    font-size: 12px;
    line-height: 1.4;
}

.pd-info-card .text strong {
    display: block;
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

.pd-info-card .text span {
    color: #999;
}

/* Dark mode */
[data-theme="dark"] .pd-title {
    color: #f0f0f0;
}

[data-theme="dark"] .pd-main-image {
    background: #2a2a2a;
}

[data-theme="dark"] .pd-price {
    color: #FFD333;
}

[data-theme="dark"] .pd-desc {
    color: #aaa;
}

[data-theme="dark"] .pd-attr-label,
[data-theme="dark"] .pd-quantity-label,
[data-theme="dark"] .pd-share-label {
    color: #e0e0e0;
}

[data-theme="dark"] .pd-chip {
    border-color: #444;
    color: #ccc;
    background: #2a2a2a;
}

[data-theme="dark"] .pd-chip.active {
    border-color: #FFD333;
    color: #FFD333;
    background: rgba(255, 211, 51, 0.1);
}

[data-theme="dark"] .pd-qty-control {
    border-color: #444;
    background: #2a2a2a;
}

[data-theme="dark"] .pd-qty-btn {
    color: #ccc;
}

[data-theme="dark"] .pd-qty-btn:hover {
    background: #333;
}

[data-theme="dark"] .pd-qty-input {
    color: #e0e0e0;
}

[data-theme="dark"] .pd-btn-fav {
    border-color: #444;
    background: #2a2a2a;
    color: #888;
}

[data-theme="dark"] .pd-btn-fav:hover,
[data-theme="dark"] .pd-btn-fav.active {
    border-color: #e8340e;
    color: #e8340e;
    background: rgba(232, 52, 14, 0.1);
}

[data-theme="dark"] .pd-share-btn {
    border-color: #444;
    background: #2a2a2a;
    color: #aaa;
}

[data-theme="dark"] .pd-share-btn:hover {
    border-color: #FFD333;
    color: #FFD333;
    background: rgba(255, 211, 51, 0.08);
}

[data-theme="dark"] .pd-info-card {
    background: #1e1e1e;
    border-color: #333;
}

[data-theme="dark"] .pd-info-card .text strong {
    color: #e0e0e0;
}

[data-theme="dark"] .pd-info-card .text span {
    color: #888;
}

[data-theme="dark"] .pd-divider {
    border-color: #333;
}

[data-theme="dark"] .pd-rating-text {
    color: #777;
}

/* Responsive */
@media (max-width: 991px) {
    .pd-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .pd-image-section {
        position: sticky;
    }

    .pd-title {
        font-size: 24px;
    }

    .pd-price {
        font-size: 28px;
    }

    .pd-info-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .pd-wrapper {
        padding: 20px 0 40px;
    }

    .pd-actions {
        flex-direction: column;
    }

    .pd-btn-cart {
        min-width: unset;
    }

    .pd-quantity-row {
        flex-wrap: wrap;
    }
}

/* ── Tab Divider ── */
.pd-tabs-divider {
    margin: 48px 0 32px 0;
    border: 0;
    border-top: 1px solid #e0e0e0;
    opacity: 0.8;
}

/* ── Tab Navigation ── */
.pd-tabs .nav-tabs {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
    gap: 0;
    flex-wrap: wrap;
}

.pd-tabs .nav-item {
    margin-bottom: -2px;
    /* Overlap the border */
}

.pd-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 15px;
    color: #888;
    background: transparent;
    border-radius: 0;
    transition: all 0.2s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pd-tabs .nav-link:hover {
    color: #1a1a2e;
    border-bottom-color: #ccc;
}

/* Red underline for ACTIVE tab (matching screenshots) */
.pd-tabs .nav-link.active {
    color: #1a1a2e;
    border-bottom-color: #e8340e;
    /* Red accent */
    background: transparent;
    font-weight: 700;
}

.pd-tabs .nav-link:focus {
    outline: none;
}

/* ── Tab Content ── */
.pd-tabs .tab-content {
    padding: 30px 4px 10px 4px;
    background: transparent;
    border: none;
}

.pd-tabs .tab-pane {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}

.pd-tabs .tab-pane h5,
.pd-tabs .tab-pane h6 {
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 6px;
    color: #1a1a2e;
}

.pd-tabs .tab-pane ul {
    padding-left: 20px;
}

.pd-tabs .tab-pane ul li {
    margin-bottom: 8px;
}

/* ── Dark Mode ── */
[data-theme="dark"] .pd-tabs-divider {
    border-top-color: #444;
}

[data-theme="dark"] .pd-tabs .nav-tabs {
    border-bottom-color: #444;
}

[data-theme="dark"] .pd-tabs .nav-link {
    color: #999;
}

[data-theme="dark"] .pd-tabs .nav-link:hover {
    color: #f0f0f0;
}

[data-theme="dark"] .pd-tabs .nav-link.active {
    color: #f0f0f0;
    border-bottom-color: #e8340e;
}

[data-theme="dark"] .pd-tabs .tab-pane {
    color: #aaa;
}

[data-theme="dark"] .pd-tabs .tab-pane h5,
[data-theme="dark"] .pd-tabs .tab-pane h6 {
    color: #f0f0f0;
}

/* ── Read More / Less ── */
.pd-tab-pane-wrapper {
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s ease;
    max-height: 300px;
    /* collapsed height */
}

.pd-tab-pane-wrapper.expanded {
    max-height: none;
}

.pd-tab-pane-wrapper .pd-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #fff);
    pointer-events: none;
    transition: opacity 0.3s;
}

[data-theme="dark"] .pd-tab-pane-wrapper .pd-fade-overlay {
    background: linear-gradient(to bottom, transparent, #1a1a2e);
}

.pd-tab-pane-wrapper.expanded .pd-fade-overlay {
    opacity: 0;
}

.pd-read-more-btn {
    display: inline-block;
    margin-top: 12px;
    font-weight: 600;
    font-size: 14px;
    color: #e8340e;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s;
}

.pd-read-more-btn:hover {
    color: #c02c0a;
    text-decoration: underline;
}

.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.zoom-btn {
    width: 45px;
    height: 47px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    font-size: 22px;
    font-weight: bold;
    color: #050505;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.product-image-wrapper {
    position: relative;
    /* Required for absolute positioning */
    overflow: hidden;
    /* Prevents zoomed image from spilling out */
}

.pd-tabs-divider {
    margin: 48px 0 32px 0;
    border: 0;
    border-top: 1px solid #e0e0e0;
    opacity: 0.8;
}

/* Prevent flash of default tab when using hash persistence */
.pd-tabs .tab-pane {
    display: none;
}

.pd-tabs .tab-pane.show.active {
    display: block;
}

.pd-image-section {
    position: sticky;
    top: 20px;
    align-self: start;
}

.pd-grid {
    align-items: start;
}

.rv-item {
    padding: 16px 0;
    border-bottom: 1px solid #eee
}

.rv-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px
}

.rv-stars {
    color: #ffc107;
    font-size: 13px
}

.rv-star-empty {
    color: #ddd
}

.rv-time {
    font-size: 12px;
    color: #999
}

.rv-body {
    margin: 6px 0;
    font-size: 14px;
    color: #555
}

.rv-actions {
    display: flex;
    gap: 14px;
    font-size: 13px
}

.rv-actions button {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0
}

.rv-actions button.active {
    color: var(--pd-accent)
}

.rv-replies {
    margin-left: 24px;
    margin-top: 10px
}

.rv-reply-form-slot textarea,
.rv-edit-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    font-size: 14px
}

.pd-thumb-strip {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto
}

.variant-selector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: #555;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.variant-selector:hover {
    border-color: var(--pd-accent);
    color: var(--pd-accent);
}

.variant-selector.active {
    border-color: var(--pd-accent);
    color: var(--pd-accent);
    background: rgba(255, 211, 51, 0.08);
}

.pd-options-row {
    gap: 10px;
}



.rv-stars {
    color: #ffc107;
    font-size: 13px
}

.rv-star-empty {
    color: #ddd
}

.rv-time {
    font-size: 12px;
    color: #999
}

.rv-body {
    margin: 6px 0;
    font-size: 14px;
    color: #555
}

.rv-actions {
    display: flex;
    gap: 14px;
    font-size: 13px
}

.rv-actions button {
    background: none !important;
    border: none !important;
    color: #888;
    cursor: pointer;
    padding: 0 !important;
}

.rv-actions button.active {
    color: var(--pd-accent)
}

.rv-replies {
    margin-left: 24px;
    margin-top: 10px
}

.rv-reply-form-slot textarea,
.rv-edit-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    font-size: 14px
}

.pd-thumb-strip {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto
}

/* .variant-selector {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: .75;
    transition: all .2s;
    flex-shrink: 0
} */
/* Legacy image-square styling removed; variant selector is a text pill now. */

[data-theme="dark"] .variant-selector {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}

[data-theme="dark"] .variant-selector:hover {
    border-color: #FFD333;
    color: #FFD333;
}

[data-theme="dark"] .variant-selector.active {
    border-color: #FFD333;
    color: #FFD333;
    background: rgba(255, 211, 51, 0.1);
}

/* Gallery thumbnails */
.pd-gallery-thumb {
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.pd-gallery-thumb:hover {
    transform: scale(1.05);
}

.pd-gallery-thumb.active {
    border-color: #FFD333 !important;
}