/* TwinCats Premium Product Detail Page */

.pdp-section {
    background: linear-gradient(180deg, #faf8ff 0%, #fff 280px);
    padding-bottom: 5rem;
    position: relative;
    z-index: 1;
}

/* Prevent polish fade-in from leaving main content invisible on mobile WebKit */
body.page-pdp main {
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.pdp-gallery {
    position: sticky;
    top: 90px;
}

.pdp-main-image-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #ece7f5;
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.08);
    aspect-ratio: 1;
    touch-action: pan-y pinch-zoom;
}

.pdp-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.15s ease-out;
    cursor: zoom-in;
}

.pdp-main-image-wrap.is-zoomed .pdp-main-image {
    transform: scale(1.75);
    cursor: zoom-out;
}

.pdp-thumbs {
    display: flex;
    gap: 0.65rem;
    margin-top: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x mandatory;
}

.pdp-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    scroll-snap-align: start;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pdp-thumb.active,
.pdp-thumb:hover {
    border-color: var(--primary-color, #7c3aed);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.pdp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdp-stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
}

.pdp-stock-pill.in-stock {
    background: #ecfdf5;
    color: #047857;
}

.pdp-stock-pill.low-stock {
    background: #fff7ed;
    color: #c2410c;
}

.pdp-stock-pill.out-stock {
    background: #fef2f2;
    color: #b91c1c;
}

.pdp-purchase-card {
    background: #fff;
    border: 1px solid #ece7f5;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.06);
}

.pdp-title {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 800;
    color: #1e1b4b;
    line-height: 1.35;
    margin-bottom: 0.65rem;
}

.pdp-rating-empty {
    font-size: 0.92rem;
    color: #6b7280;
    font-weight: 600;
}

.pdp-rating-empty a {
    color: var(--primary-color, #7c3aed);
    text-decoration: none;
}

.pdp-rating-empty a:hover {
    text-decoration: underline;
}

.pdp-price-block .pdp-price-current {
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 900;
    color: #111827;
}

.pdp-delivery-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f5f3ff;
    border-radius: 12px;
    color: #5b21b6;
    font-size: 0.88rem;
    font-weight: 600;
}

.pdp-qty-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.25rem 0;
}

.pdp-qty-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.pdp-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.pdp-qty-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: #f9fafb;
    color: #374151;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.pdp-qty-btn:hover:not(:disabled) {
    background: #ede9fe;
    color: #6d28d9;
}

.pdp-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pdp-qty-input {
    width: 52px;
    height: 42px;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    -moz-appearance: textfield;
}

.pdp-qty-input::-webkit-outer-spin-button,
.pdp-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pdp-subtotal-box {
    padding: 0.65rem 0.85rem;
    background: #fafafa;
    border-radius: 12px;
    border: 1px dashed #e5e7eb;
}

.pdp-subtotal-value {
    font-size: 1.15rem;
    font-weight: 900;
    color: #111827;
}

.pdp-btn-atc {
    padding: 0.95rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 800;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
    transition: transform 0.15s, box-shadow 0.15s;
}

.pdp-btn-atc:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(124, 58, 237, 0.35);
}

.pdp-trust-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.pdp-trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
}

.pdp-trust-item i {
    color: #059669;
    font-size: 1rem;
}

.pdp-new-product-badge {
    font-weight: 700;
    color: #7c3aed;
}

.pdp-popularity-signals {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pdp-popularity-item {
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    padding: 0.45rem 0.65rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.pdp-mini-bestseller,
.pdp-mini-new-product {
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.pdp-mini-bestseller {
    color: #dc2626;
}

.pdp-mini-new-product {
    color: #7c3aed;
}

.pdp-highlights {
    margin-top: 1.25rem;
}

.pdp-highlights-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e1b4b;
    margin-bottom: 0.75rem;
}

.pdp-highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
}

.pdp-highlight-card {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.65rem 0.75rem;
    background: linear-gradient(135deg, #faf5ff, #fff);
    border: 1px solid #ede9fe;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4c1d95;
    line-height: 1.4;
}

.pdp-highlight-card i {
    color: #7c3aed;
    margin-top: 0.1rem;
}

.pdp-meta-card {
    margin-top: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
}

.pdp-meta-card table {
    margin: 0;
}

.pdp-meta-card th {
    width: 38%;
    background: #f9fafb;
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 700;
    padding: 0.75rem 1rem;
}

.pdp-meta-card td {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
    padding: 0.75rem 1rem;
}

.pdp-tabs-wrap {
    margin-top: 2.5rem;
}

.pdp-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-weight: 700;
    padding: 0.85rem 1.25rem;
    border-radius: 0;
}

.pdp-tabs .nav-link.active {
    color: var(--primary-color, #7c3aed);
    border-bottom-color: var(--primary-color, #7c3aed);
    background: transparent;
}

.pdp-tab-body {
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #ece7f5;
    border-top: none;
    border-radius: 0 0 16px 16px;
    line-height: 1.8;
    color: #374151;
}

/* PDP reviews tab */
.pdp-reviews-heading {
    font-size: 1.05rem;
}

.pdp-reviews-empty {
    text-align: center;
    padding: 0.85rem 0.75rem;
    border: 1px solid #ece7f5;
    border-radius: 10px;
    background: #faf9fc;
    font-size: 0.84rem;
}

.pdp-review-item {
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
}

.pdp-review-item h6 {
    font-size: 0.88rem;
}

.pdp-review-form-card {
    background: #faf9fc;
    border: 1px solid #ece7f5;
    border-radius: 12px;
}

.pdp-review-form-card-body {
    padding: 1rem;
}

.pdp-review-form-title {
    font-size: 0.95rem;
    margin-bottom: 0.65rem;
}

#pdpTabReviews .form-label {
    margin-bottom: 0.25rem;
}

#pdpTabReviews .mb-3 {
    margin-bottom: 0.75rem !important;
}

.pdp-carousel-section {
    margin-top: 2.5rem;
}

.pdp-carousel-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e1b4b;
    margin-bottom: 1rem;
}

.pdp-product-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
}

.pdp-mini-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #ece7f5;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.pdp-mini-card:hover {
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.12);
    transform: translateY(-2px);
}

.pdp-mini-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.pdp-mini-card-body {
    padding: 0.75rem;
}

.pdp-mini-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.pdp-sticky-desktop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #ece7f5;
    padding: 0.65rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-110%);
    transition: transform 0.3s ease;
}

.pdp-sticky-desktop.visible {
    transform: translateY(0);
}

.pdp-sticky-desktop .pdp-qty-control {
    scale: 0.9;
}

.pdp-sticky-name {
    font-weight: 800;
    font-size: 0.92rem;
    color: #1e1b4b;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdp-buy-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.pdp-buy-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    border: 1.5px solid #ece7f5;
    border-radius: 8px;
    padding: 0.75rem;
    background: #fff;
    color: #1e1b4b;
    text-decoration: none;
}

.pdp-buy-mode-option.active {
    border-color: #7c3aed;
    background: #faf5ff;
}

.pdp-buy-mode-option i {
    color: #7c3aed;
    font-size: 1.05rem;
    margin-top: 0.1rem;
}

.pdp-buy-mode-option strong,
.pdp-buy-mode-option span {
    display: block;
}

.pdp-buy-mode-option span {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.45;
    margin-top: 0.15rem;
}

.pdp-faq-section {
    margin-top: 1.5rem;
}

.pdp-faq-list {
    display: grid;
    gap: 0.65rem;
}

.pdp-faq-item {
    background: #fff;
    border: 1px solid #ece7f5;
    border-radius: 8px;
    padding: 0.9rem 1rem;
}

.pdp-faq-item summary {
    cursor: pointer;
    font-weight: 800;
    color: #1e1b4b;
}

.pdp-faq-item p {
    margin: 0.7rem 0 0;
    color: #64748b;
    line-height: 1.75;
}

.pdp-sticky-mobile {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    z-index: 1035;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #ece7f5;
    border-radius: 8px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.18);
    padding: 0.65rem;
    transform: translateY(150%);
    transition: transform 0.3s ease;
}

.pdp-sticky-mobile.visible {
    transform: translateY(0);
}

.pdp-sticky-mobile-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.pdp-sticky-mobile .pdp-sticky-name {
    max-width: 42vw;
}

.pdp-sticky-mobile .pdp-qty-control {
    scale: 0.88;
    transform-origin: center;
}

.pdp-sticky-mobile .pdp-btn-atc {
    width: 100%;
}

@media (max-width: 991.98px) {
    .site-header-spacer {
        min-height: 72px;
    }

    body.page-pdp {
        padding-bottom: calc(148px + env(safe-area-inset-bottom, 0px));
    }

    .pdp-section {
        padding-top: 0.35rem;
        padding-bottom: 1.25rem;
        background: var(--tc-bg, #fffaf3);
    }

    .pdp-section .container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .pdp-gallery {
        position: static;
        margin-bottom: 0.5rem;
    }

    .pdp-main-image-wrap {
        min-height: 280px;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
    }

    .pdp-purchase-card {
        padding: 1.1rem;
        border-radius: 16px;
        margin-bottom: 0.5rem;
    }

    .pdp-title {
        font-size: 1.25rem;
    }

    .pdp-qty-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
        margin: 0.85rem 0;
    }

    .pdp-trust-grid,
    .pdp-highlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .pdp-trust-grid {
        margin-top: 0.85rem;
    }

    .pdp-trust-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 0.3rem;
        padding: 0.5rem 0.35rem;
        font-size: 0.7rem;
        line-height: 1.3;
        min-height: 4.25rem;
    }

    .pdp-trust-item i {
        font-size: 1.05rem;
    }

    .pdp-highlights {
        margin-top: 0.85rem;
    }

    .pdp-highlights-title {
        font-size: 0.88rem;
        margin-bottom: 0.45rem;
    }

    .pdp-highlight-card {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 0.3rem;
        padding: 0.5rem 0.35rem;
        font-size: 0.68rem;
        line-height: 1.35;
        min-height: 4.5rem;
    }

    .pdp-highlight-card i {
        margin-top: 0;
        font-size: 0.95rem;
    }

    .pdp-popularity-signals {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .pdp-popularity-item {
        font-size: 0.7rem;
        padding: 0.4rem 0.35rem;
        text-align: center;
        line-height: 1.35;
    }

    .pdp-meta-card table,
    .pdp-meta-card tbody,
    .pdp-meta-card tr {
        display: block;
        width: 100%;
    }

    .pdp-meta-card tbody {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        padding: 0.45rem;
    }

    .pdp-meta-card tr {
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 0.45rem 0.5rem;
    }

    .pdp-meta-card th,
    .pdp-meta-card td {
        display: block;
        width: 100%;
        padding: 0.15rem 0;
        font-size: 0.72rem;
        background: transparent;
        border: 0;
    }

    .pdp-meta-card th {
        color: #64748b;
        font-weight: 700;
        margin-bottom: 0.15rem;
    }

    .pdp-meta-card td {
        color: #0f172a;
        font-weight: 700;
    }

    .pdp-tabs-wrap {
        margin-top: 1.5rem;
    }

    .pdp-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid #ece7f5;
        margin-bottom: 0;
    }

    .pdp-tabs::-webkit-scrollbar {
        display: none;
    }

    .pdp-tabs .nav-item {
        flex: 0 0 auto;
    }

    .pdp-tabs .nav-link {
        padding: 0.75rem 0.95rem;
        font-size: 0.85rem;
    }

    .pdp-tab-body {
        border-radius: 0 0 14px 14px;
        padding: 1.1rem;
        font-size: 0.92rem;
    }

    #pdpTabReviews.pdp-tab-body {
        padding: 0.85rem 0.75rem 0.95rem;
    }

    .pdp-reviews-heading {
        font-size: 0.92rem;
        margin-bottom: 0.5rem !important;
    }

    .pdp-reviews-empty {
        padding: 0.65rem 0.6rem;
        font-size: 0.78rem;
        border-radius: 8px;
    }

    .pdp-review-item {
        padding-bottom: 0.65rem;
        margin-bottom: 0.65rem;
    }

    .pdp-review-item h6 {
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .pdp-review-item .badge {
        font-size: 0.58rem;
        padding: 0.15rem 0.3rem;
        vertical-align: middle;
    }

    .pdp-review-item .text-warning {
        font-size: 0.72rem;
    }

    .pdp-review-form-card {
        border-radius: 10px;
        box-shadow: none;
    }

    .pdp-review-form-card-body {
        padding: 0.7rem 0.75rem;
    }

    .pdp-review-form-title {
        font-size: 0.84rem;
        margin-bottom: 0.4rem !important;
    }

    #pdpTabReviews .pdp-review-form-card p {
        font-size: 0.76rem;
        line-height: 1.45;
        margin-bottom: 0;
    }

    #pdpTabReviews .form-label {
        font-size: 0.74rem;
    }

    #pdpTabReviews .form-control,
    #pdpTabReviews .form-select {
        font-size: 0.8rem;
        padding: 0.4rem 0.55rem;
        min-height: auto;
    }

    #pdpTabReviews textarea.form-control {
        min-height: 4.25rem;
    }

    #pdpTabReviews .btn {
        padding: 0.42rem 0.7rem;
        font-size: 0.8rem;
    }

    #pdpTabReviews .mb-3 {
        margin-bottom: 0.55rem !important;
    }

    #pdpTabReviews .pdp-reviews-layout {
        --bs-gutter-y: 0.55rem;
    }

    .pdp-carousel-section {
        margin-top: 1.75rem;
    }

    .pdp-carousel-title {
        font-size: 1.05rem;
        margin-bottom: 0.75rem;
    }

    .pdp-mini-card {
        flex: 0 0 168px;
    }

    .pdp-mini-card img {
        height: 120px;
    }

    .pdp-sticky-desktop {
        display: none !important;
    }

    body.page-pdp .sticky-atc-bar {
        display: none !important;
    }

    body.page-pdp .chat-fab-wrap {
        bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    }

    body.page-pdp .breadcrumb {
        font-size: 0.78rem;
        flex-wrap: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

html[data-theme="dark"] .pdp-section {
    background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 280px);
}

html[data-theme="dark"] .pdp-purchase-card,
html[data-theme="dark"] .pdp-main-image-wrap,
html[data-theme="dark"] .pdp-mini-card,
html[data-theme="dark"] .pdp-tab-body {
    background: #1c1c1e;
    border-color: #2c2c2e;
}

html[data-theme="dark"] .pdp-reviews-empty,
html[data-theme="dark"] .pdp-review-form-card {
    background: #232323;
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .pdp-title,
html[data-theme="dark"] .pdp-carousel-title,
html[data-theme="dark"] .pdp-sticky-name {
    color: #f5f5f7;
}

html[data-theme="dark"] .pdp-trust-item,
html[data-theme="dark"] .pdp-subtotal-box {
    background: #232325;
    border-color: #2c2c2e;
    color: #d1d5db;
}

@media (max-width: 991.98px) {
    html[data-theme="dark"] .pdp-meta-card tr {
        background: #232325;
        border-color: #2c2c2e;
    }

    html[data-theme="dark"] .pdp-meta-card td {
        color: #f5f5f7;
    }
}

html[data-theme="dark"] .pdp-sticky-desktop {
    background: rgba(28, 28, 30, 0.96);
    border-color: #2c2c2e;
}
