/* Product page body */
html:has(.pd-page),
body.shop-premium:has(.pd-page) {
    overflow-x: hidden;
    max-width: 100vw;
}

body.shop-premium:has(.pd-page) {
    padding-top: 70px;
    -webkit-tap-highlight-color: transparent;
}

.pd-page {
    background: #f8fafc;
    padding-bottom: 80px;
    width: 100%;
    overflow-x: hidden;
}

.pd-back-link {
    display: none;
}

.pd-breadcrumb-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px 0;
}

.pd-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.88rem;
    color: #64748b;
}

.pd-breadcrumb a {
    color: #0ea5e9;
    text-decoration: none;
}

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

.pd-breadcrumb .sep {
    color: #cbd5e1;
}

.pd-breadcrumb .current {
    color: #1e293b;
    font-weight: 500;
}

/* Main layout */
.pd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

.pd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

/* Gallery */
.pd-gallery {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 100px;
    min-width: 0;
    max-width: 100%;
}

.pd-gallery-main {
    position: relative;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-gallery-main img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    padding: 24px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.pd-gallery-main:hover img {
    transform: scale(1.03);
}

.pd-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    font-size: 1rem;
    transition: 0.2s;
    z-index: 2;
}

.pd-gallery-nav:hover {
    background: #0ea5e9;
    color: #fff;
}

.pd-gallery-nav.prev {
    left: 12px;
}

.pd-gallery-nav.next {
    right: 12px;
}

.pd-gallery-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #ef4444;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
}

.pd-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.pd-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: #f8fafc;
    transition: 0.2s;
}

.pd-thumb.active,
.pd-thumb:hover {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.pd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.pd-gallery-counter {
    display: none;
}

.pd-gallery-dots {
    display: none;
}

.pd-gallery-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: 0.2s;
}

.pd-gallery-dot.active {
    background: #0ea5e9;
    width: 18px;
    border-radius: 4px;
}

.pd-meta-row {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.pd-sku-desktop {
    display: block;
}

/* Info panel */
.pd-info {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    min-width: 0;
    max-width: 100%;
}

.pd-category {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.pd-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 8px;
}

.pd-sku {
    color: #94a3b8;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.pd-price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.pd-price-current {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0ea5e9;
    line-height: 1;
}

.pd-price-original {
    font-size: 1.2rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.pd-price-save {
    background: #fef2f2;
    color: #dc2626;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.pd-stock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.pd-stock.in-stock {
    background: #ecfdf5;
    color: #047857;
}

.pd-stock.low-stock {
    background: #fffbeb;
    color: #b45309;
}

.pd-stock.out-of-stock {
    background: #fef2f2;
    color: #b91c1c;
}

.pd-short-desc {
    color: #475569;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

/* Quantity + Actions */
.pd-qty-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pd-qty-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
}

.pd-qty-control {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.pd-qty-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: #f8fafc;
    cursor: pointer;
    font-size: 1.1rem;
    color: #475569;
    transition: 0.2s;
}

.pd-qty-btn:hover {
    background: #0ea5e9;
    color: #fff;
}

.pd-qty-input {
    width: 56px;
    height: 42px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    outline: none;
}

.pd-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.pd-btn {
    flex: 1;
    min-width: 160px;
    padding: 16px 24px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
    text-decoration: none;
    border: none;
}

.pd-btn-cart {
    background: #0ea5e9;
    color: #fff;
}

.pd-btn-cart:hover {
    background: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
}

.pd-btn-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pd-btn-whatsapp {
    background: #25d366;
    color: #fff;
}

.pd-btn-whatsapp:hover {
    background: #128c7e;
    color: #fff;
    transform: translateY(-2px);
}

/* Trust row */
.pd-trust {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.pd-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #475569;
}

.pd-trust-item i {
    width: 36px;
    height: 36px;
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Tabs */
.pd-tabs {
    margin-top: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.pd-tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    width: 100%;
}

.pd-tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: 0.2s;
}

.pd-tab-btn .tab-short {
    display: none;
}

.pd-tab-btn.active {
    color: #0ea5e9;
    border-bottom-color: #0ea5e9;
}

.pd-tab-panel {
    display: none;
    color: #475569;
    line-height: 1.8;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.pd-tab-panel.active {
    display: block;
}

.pd-tab-panel ul {
    padding-left: 20px;
    margin-top: 10px;
}

.pd-tab-panel li {
    margin-bottom: 8px;
}

/* Related */
.pd-related {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 0 20px;
}

.pd-related h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pd-related h2 i {
    color: #0ea5e9;
}

/* Zoom */
.pd-zoom {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.pd-zoom.active {
    display: flex;
}

.pd-zoom img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
}

.pd-zoom-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* Mobile sticky bar */
.pd-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
    align-items: center;
    gap: 12px;
}

.pd-sticky-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0ea5e9;
    white-space: nowrap;
}

.pd-sticky-bar .pd-btn {
    flex: 1;
    padding: 14px;
    min-width: 0;
    font-size: 0.9rem;
}

.pd-sticky-bar .pd-btn-whatsapp-sm {
    flex: 0 0 auto;
    width: 48px;
    padding: 14px;
    background: #25d366;
    color: #fff;
}

.pd-sticky-bar .pd-btn-whatsapp-sm:hover {
    background: #128c7e;
    color: #fff;
}

/* Responsive */
@media (max-width: 992px) {
    body.shop-premium:has(.pd-page) {
        padding-top: 64px;
    }

    .pd-breadcrumb-wrap {
        padding: 8px 16px 0;
    }

    .pd-back-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #0ea5e9;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.88rem;
        padding: 8px 0 4px;
    }

    .pd-back-link:hover {
        color: #0369a1;
    }

    .pd-breadcrumb {
        font-size: 0.78rem;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        margin-top: 4px;
        white-space: nowrap;
    }

    .pd-breadcrumb a,
    .pd-breadcrumb .sep,
    .pd-breadcrumb .current {
        flex-shrink: 0;
    }

    .pd-breadcrumb::-webkit-scrollbar {
        display: none;
    }

    .pd-breadcrumb .current {
        white-space: nowrap;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pd-container {
        padding: 8px 16px 20px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .pd-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }

    .pd-grid > * {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    .pd-gallery {
        position: static;
        padding: 10px;
        border-radius: 14px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .pd-gallery-main {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 4 / 3;
        max-height: min(72vw, 300px);
        height: auto;
    }

    .pd-gallery-main img {
        padding: 8px;
        width: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

    .pd-gallery-counter {
        display: block;
        text-align: center;
        font-size: 0.78rem;
        font-weight: 600;
        color: #64748b;
        margin-top: 8px;
    }

    .pd-gallery-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 6px;
        margin-top: 8px;
    }

    .pd-thumbs {
        display: none;
    }

    .pd-gallery-nav {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        opacity: 1;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .pd-info {
        padding: 16px;
        border-radius: 14px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .pd-category {
        font-size: 0.72rem;
        padding: 5px 12px;
        margin-bottom: 8px;
    }

    .pd-title {
        font-size: 1.15rem;
        margin-bottom: 4px;
        line-height: 1.35;
    }

    .pd-sku {
        margin-bottom: 10px;
        font-size: 0.8rem;
    }

    .pd-info > .pd-price-row {
        display: flex;
        align-items: center;
        padding-bottom: 12px;
        margin-bottom: 8px;
        gap: 10px;
    }

    .pd-info > .pd-price-row .pd-price-current {
        font-size: 1.6rem;
        letter-spacing: -0.02em;
    }

    .pd-info > .pd-stock {
        display: none;
    }

    .pd-meta-row {
        display: flex;
        margin-bottom: 14px;
    }

    .pd-meta-row .pd-stock {
        display: inline-flex;
        font-size: 0.8rem;
        padding: 6px 12px;
        margin-bottom: 0;
    }

    .pd-meta-row .pd-sku {
        margin-bottom: 0;
        font-size: 0.78rem;
        padding: 6px 0;
    }

    .pd-sku-desktop {
        display: none;
    }

    .pd-short-desc {
        font-size: 0.92rem;
        margin-bottom: 16px;
        line-height: 1.6;
    }

    .pd-qty-row {
        margin-bottom: 14px;
    }

    .pd-qty-btn {
        width: 44px;
        height: 44px;
    }

    .pd-qty-input {
        width: 48px;
        height: 44px;
        font-size: 16px;
    }

    /* Hide inline cart + full WhatsApp — use sticky bar */
    .pd-actions .pd-btn-cart,
    .pd-actions .pd-btn-whatsapp {
        display: none;
    }

    .pd-actions {
        display: none;
    }

    .pd-trust {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 16px 0;
        margin-bottom: 16px;
    }

    .pd-trust-item {
        font-size: 0.78rem;
        gap: 8px;
    }

    .pd-trust-item i {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .pd-tab-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        overflow: visible;
        border-bottom: 2px solid #e2e8f0;
    }

    .pd-tab-btn {
        white-space: normal;
        text-align: center;
        padding: 10px 4px;
        font-size: 0.72rem;
        line-height: 1.25;
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
    }

    .pd-tab-btn .tab-full {
        display: none;
    }

    .pd-tab-btn .tab-short {
        display: inline;
    }

    .pd-tab-panel {
        font-size: 0.88rem;
        line-height: 1.65;
        padding: 0 2px;
    }

    .pd-tab-panel ul {
        padding-left: 16px;
    }

    .pd-sticky-bar {
        display: flex;
        align-items: center;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
        border-top: 1px solid #e2e8f0;
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .pd-sticky-price {
        font-size: 0.95rem;
        min-width: 0;
        flex-shrink: 0;
        line-height: 1.2;
    }

    .pd-sticky-price .currency {
        font-size: 0.72rem;
        font-weight: 600;
        color: #64748b;
        display: block;
    }

    .pd-sticky-price .amount {
        font-size: 1.05rem;
        font-weight: 800;
        color: #0ea5e9;
    }

    .pd-sticky-bar .pd-btn-cart {
        display: inline-flex !important;
        flex: 1;
        min-height: 46px;
        border-radius: 10px;
        font-size: 0.88rem;
    }

    .pd-page {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .pd-related {
        margin-top: 32px;
        padding: 0 16px;
    }

    .pd-related h2 {
        font-size: 1.15rem;
        margin-bottom: 16px;
    }

    .pd-related .products-grid-premium {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .pd-related .product-card-image {
        height: 130px;
    }

    .pd-related .product-card-body {
        padding: 10px;
    }

    .pd-related .product-card-title {
        font-size: 0.8rem;
    }

    .pd-related .price-current {
        font-size: 0.95rem;
    }

    .pd-related .btn-shop {
        padding: 8px;
        font-size: 0.75rem;
    }

    /* WhatsApp float above sticky bar */
    body:has(.pd-page) .shop-whatsapp-float {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    /* Compact footer on product page */
    body:has(.pd-page) .footer {
        padding: 32px 0 24px;
    }

    body:has(.pd-page) .footer-grid {
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .pd-gallery-main {
        max-height: min(68vw, 280px);
    }

    .pd-price-current {
        font-size: 1.5rem;
    }

    .pd-trust {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .pd-tab-btn {
        font-size: 0.68rem;
        padding: 9px 2px;
    }
}

@media (max-width: 380px) {
    .pd-breadcrumb .current {
        max-width: 90px;
    }

    .pd-sticky-price .amount {
        font-size: 0.95rem;
    }

    .pd-sticky-bar .pd-btn {
        font-size: 0.8rem;
        padding: 12px 8px;
    }

    .pd-sticky-bar .pd-btn-whatsapp-sm {
        width: 44px;
        padding: 12px;
    }
}
