/* ================================================================
   Product Details Page V3 — Premium Redesign
   NJAWAMU Hardware
   ================================================================ */

/* ─── Breadcrumb Bar ─── */
.pd-breadcrumb-bar {
    background: #F8F8FA;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 10px 0;
}

.pd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.pd-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.pd-breadcrumb a:hover {
    color: var(--accent-primary);
}

.pd-breadcrumb .fa-chevron-right {
    font-size: 0.6rem;
    opacity: 0.5;
}

.pd-breadcrumb .active {
    color: var(--accent-primary);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ─── Main Layout ─── */
.pd-main {
    background: #FFFFFF;
    min-height: 60vh;
}

.pd-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ─── Shimmer Loading ─── */
.pd-loading {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.pd-shimmer-img {
    height: 520px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 20px;
}

.pd-shimmer-info {
    padding-top: 20px;
}

.pd-shimmer-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
    margin-bottom: 12px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ─── Product Content Grid ─── */
.pd-content {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 56px;
    align-items: start;
}

/* ─── Left: Image Panel ─── */
.pd-image-panel {
    position: sticky;
    top: 90px;
}

.pd-image-container {
    background: #F8F8FA;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.pd-image-container:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.pd-image-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.pd-image-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.pd-image-container.zoomed .pd-image-track {
    transform: scale(1.5) !important;
    /* Force zoom for single or current image */
    cursor: zoom-out;
}

.pd-main-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s ease;
}

/* ─── Carousel Nav ─── */
.pd-carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
    z-index: 5;
}

.pd-carousel-arrow {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s;
    color: var(--text-primary);
}

.pd-carousel-arrow:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

.pd-carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.pd-dot {
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pd-dot.active {
    background: var(--accent-primary);
    width: 24px;
    border-radius: 10px;
}

.pd-zoom-hint {
    position: absolute;
    bottom: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    z-index: 6;
}

.pd-zoom-hint:hover {
    background: var(--accent-primary);
    color: white;
}

/* ─── Right: Info Panel ─── */
.pd-info-panel {
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pd-category-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.pd-category-label a {
    color: var(--accent-primary);
    text-decoration: none;
}

.pd-category-label a:hover {
    text-decoration: underline;
}

.pd-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin: 0;
}

.pd-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pd-stars {
    font-size: 1rem;
    color: var(--accent-primary);
    letter-spacing: 2px;
}

.pd-reviews {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pd-price-block {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.pd-price {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.pd-free-delivery {
    font-size: 0.8rem;
    color: #27AE60;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pd-description {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0;
}

/* ─── Specs Box ─── */
.pd-specs-box {
    background: #F8F8FA;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.pd-specs-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
}

.pd-specs-grid {
    padding: 4px 0;
}

.pd-spec-row {
    display: flex;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.88rem;
}

.pd-spec-row:last-child {
    border-bottom: none;
}

.pd-spec-key {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 140px;
    flex-shrink: 0;
}

.pd-spec-val {
    color: var(--text-secondary);
}

/* ─── Trust Badges ─── */
.pd-trust-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.pd-trust-item {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 12px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.pd-trust-item i {
    font-size: 1.1rem;
    color: var(--accent-primary);
}

.pd-trust-item span {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* ─── Action Area ─── */
.pd-action-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pd-qty-group {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.pd-qty-btn {
    width: 44px;
    height: 50px;
    border: none;
    background: transparent;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-qty-btn:hover {
    background: rgba(184, 134, 11, 0.08);
    color: var(--accent-primary);
}

.pd-qty-input {
    width: 52px;
    height: 50px;
    border: none;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    background: transparent;
    -moz-appearance: textfield;
    appearance: none;
}

.pd-qty-input::-webkit-outer-spin-button,
.pd-qty-input::-webkit-inner-spin-button {
    display: none;
}

.pd-btn-cart {
    flex: 1;
    min-width: 140px;
    height: 50px;
    border-radius: 12px;
    background: var(--text-primary);
    color: white;
    border: none;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.pd-btn-cart:hover {
    background: #2D2D2D;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.pd-btn-wa {
    height: 50px;
    padding: 0 20px;
    border-radius: 12px;
    background: #25D366;
    color: white;
    border: none;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.pd-btn-wa:hover {
    background: #128C7E;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.pd-btn-wa i {
    font-size: 1.1rem;
}

.pd-wa-note {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: rgba(37, 211, 102, 0.06);
    border: 1px solid rgba(37, 211, 102, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 0;
    line-height: 1.5;
}

/* ─── Error State ─── */
.pd-error {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.pd-error-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.pd-error h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.pd-error p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pd-back-btn {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
}

/* ─── Related Products Section ─── */
.pd-related {
    padding: 60px 0;
    background: #F8F8FA;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.pd-related-header {
    text-align: center;
    margin-bottom: 40px;
}

.pd-related-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 8px;
}

/* ─── Mobile Sticky Bar ─── */
.pd-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 12px 20px;
    /* Reduced bottom padding as bottom-nav provides safety */
    gap: 12px;
    z-index: 4000;
    /* Above everything but below drawer if needed */
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    bottom: 65px;
    /* Shifted up to clear mobile-bottom-nav */
}

.pd-sticky-bar.active {
    transform: translateY(0);
}

.pd-sticky-btn {
    flex: 1;
    height: 52px;
    /* Large 52px tap target */
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.pd-sticky-cart {
    background: var(--text-primary, #1C1C1E);
    color: white;
}

.pd-sticky-wa {
    background: #25D366;
    color: white;
}

/* ================================================================
   RESPONSIVE — MOBILE
   ================================================================ */
@media (max-width: 900px) {

    .pd-content,
    .pd-loading {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .pd-image-panel {
        position: static;
    }

    .pd-image-wrap {
        aspect-ratio: 4/3;
        max-height: 420px;
        margin: 0 -8px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

@media (max-width: 768px) {
    .pd-container {
        padding: 0;
    }

    .pd-image-wrap {
        aspect-ratio: auto;
        height: 320px;
        background: #1a1a2e;
        border-radius: 0;
        border: none;
    }

    .pd-main-img {
        max-height: 280px;
        filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    }

    .pd-info-panel {
        padding: 28px 20px 120px;
        gap: 16px;
    }

    .pd-title {
        font-size: 1.6rem;
    }

    .pd-price {
        font-size: 2.2rem;
    }

    .pd-trust-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .pd-action-area {
        display: none;
        /* Hidden on mobile — sticky bar handles actions */
    }

    .pd-wa-note {
        display: none;
    }

    /* Sticky bar visible on mobile */
    .pd-sticky-bar {
        display: flex;
    }

    /* Related grid horizontal scroll on mobile — Improved spacing and alignment */
    .pd-related .product-grid {
        display: flex;
        overflow-x: auto;
        gap: 16px;
        padding: 8px 16px 24px;
        margin: 0;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pd-related .product-grid::-webkit-scrollbar {
        display: none;
    }

    .pd-related .product-grid .product-card {
        flex: 0 0 260px;
        /* Slightly wider cards for better breathing room */
        scroll-snap-align: center;
        margin-bottom: 0;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }

    .pd-breadcrumb .active {
        max-width: 120px;
    }

    .pd-related {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    .pd-shimmer-img {
        height: 280px;
    }

    .pd-sticky-btn span {
        font-size: 0.8rem;
    }
}