/* =============================================
   Bianca Product — Luxe layer
   Visual polish + responsive fixes for product.php.
   Requires luxe-shared.css.
   ============================================= */

/* ---------------------------------------------
   1. Entrance — gallery / details / order card
   --------------------------------------------- */
.pd-breadcrumb {
    animation: luxeRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pd-gallery {
    animation: luxeRise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.pd-details {
    animation: luxeRise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.pd-order-card {
    animation: luxeRise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.27s both;
}

/* ---------------------------------------------
   2. Gallery polish
   --------------------------------------------- */
.pd-gallery__main {
    box-shadow: 0 14px 36px rgba(74, 28, 31, 0.1);
}

.pd-gallery__arrow {
    background: rgba(253, 249, 243, 0.88);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(196, 149, 106, 0.35);
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.2s ease;
}

.pd-gallery__arrow:hover {
    background: #fff;
    border-color: rgba(196, 149, 106, 0.7);
    transform: translateY(-50%) scale(1.06);
}

.pd-gallery__thumb {
    position: relative;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    opacity: 0.85;
}

.pd-gallery__thumb:hover {
    opacity: 1;
}

.pd-gallery__thumb.is-active {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.25);
    opacity: 1;
}

.pd-gallery .pd-badge--chef {
    background: linear-gradient(140deg, var(--maroon) 0%, var(--maroon-dark) 100%);
    box-shadow: 0 6px 16px rgba(92, 18, 21, 0.35);
}

/* ---------------------------------------------
   3. Details polish
   --------------------------------------------- */
.pd-title {
    font-size: clamp(26px, 3vw, 34px);
}

/* gold diamond marker before section titles */
.pd-section__title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-end: 9px;
    background: var(--gold);
    transform: rotate(45deg) translateY(-1px);
}

.pd-option--error .pd-section__title::before {
    background: #b42318;
}

.pd-option__item {
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.pd-option__item:hover {
    border-color: rgba(196, 149, 106, 0.6);
}

.pd-option__item:has(input:checked) {
    border-color: var(--maroon);
    background: rgba(92, 18, 21, 0.045);
    box-shadow: 0 2px 10px rgba(92, 18, 21, 0.07);
}

.pd-option__item input {
    accent-color: var(--maroon);
}

.pd-option__item-price {
    color: var(--maroon);
    font-weight: 600;
}

.pd-meta-chip {
    background: rgba(196, 149, 106, 0.12);
    border: 1px solid rgba(196, 149, 106, 0.25);
    color: var(--text);
}

.pd-badge-item {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.pd-badge-item:hover {
    border-color: rgba(196, 149, 106, 0.55);
    box-shadow: 0 6px 18px rgba(74, 28, 31, 0.08);
    transform: translateY(-2px);
}

/* ---------------------------------------------
   4. Order card polish
   --------------------------------------------- */
.pd-order-card {
    position: sticky;
    overflow: hidden;
    box-shadow: 0 10px 32px rgba(74, 28, 31, 0.08);
}

/* gold top accent, same language as the home offer cards */
.pd-order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.pd-order-row--total {
    color: var(--maroon);
}

.pd-order-btn:not(.pd-order-btn--ghost) {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, var(--maroon) 0%, var(--maroon-dark) 100%);
    box-shadow: 0 6px 18px rgba(92, 18, 21, 0.28);
}

.pd-order-btn:not(.pd-order-btn--ghost)::before,
.btn-add-mobile::before,
.pd-sticky-bar__btn::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: skewX(-20deg);
    transition: inset-inline-start 0.6s ease;
    pointer-events: none;
}

.pd-order-btn:not(.pd-order-btn--ghost):hover::before,
.btn-add-mobile:hover::before,
.pd-sticky-bar__btn:hover::before {
    inset-inline-start: 130%;
}

.btn-add-mobile,
.pd-sticky-bar__btn {
    position: relative;
    overflow: hidden;
}

/* ---------------------------------------------
   5. Recommendations & related
   --------------------------------------------- */
.pd-section-heading::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-inline-end: 10px;
    background: var(--gold);
    transform: rotate(45deg) translateY(-1px);
}

.pd-recommend__card {
    transition: box-shadow 0.28s ease, border-color 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.pd-recommend__card:hover {
    border-color: rgba(196, 149, 106, 0.55);
    transform: translateY(-2px);
}

.pd-recommend__img img {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.pd-recommend__card:hover .pd-recommend__img img {
    transform: scale(1.08);
}

.pd-related__card:hover {
    border-color: rgba(196, 149, 106, 0.55);
}

.pd-related__arrow {
    background: rgba(253, 249, 243, 0.92);
    backdrop-filter: blur(6px);
    border-color: rgba(196, 149, 106, 0.35);
}

.pd-related__arrow:hover {
    border-color: rgba(196, 149, 106, 0.7);
}

/* ---------------------------------------------
   6. Mobile sticky bar — glass + safe area
   --------------------------------------------- */
.pd-sticky-bar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

/* ---------------------------------------------
   7. Responsive fixes
   --------------------------------------------- */
@media (max-width: 900px) {
    /* container already provides 24px side padding — remove the
       doubled-up insets the page added on top of it */
    .pd-details {
        padding: 16px 0 0;
    }

    .pd-breadcrumb {
        padding: 10px 0 6px;
    }

    .pd-actions--mobile {
        padding: 0 0 16px;
    }

    .pd-recommend,
    .pd-related {
        padding: 0 24px;
    }

    .pd-gallery__thumbs {
        padding: 0 24px;
    }

    /* hide back-to-top — the sticky order bar owns the bottom edge */
    .back-to-top {
        display: none;
    }
}

@media (max-width: 480px) {
    /* balanced 2-up badges; a lone last badge spans the full row */
    .pd-badges {
        grid-template-columns: repeat(2, 1fr);
    }

    .pd-badge-item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

/* ---------------------------------------------
   8. Reduced motion
   --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .pd-breadcrumb,
    .pd-gallery,
    .pd-details,
    .pd-order-card {
        animation: none !important;
    }

    .pd-gallery__arrow,
    .pd-gallery__thumb,
    .pd-badge-item,
    .pd-recommend__card,
    .pd-recommend__img img {
        transition: none;
    }
}
