/* ============================================================
   co-shop-item.css — Product Detail Page
   BuyUSAFirst storefront · Bootstrap 5 overlay
   ============================================================ */

.product-detail-page {
    --pdp-blue:   #0075B2;
    --pdp-red:    #E21F26;
    --pdp-green:  #2ECC71;
    --pdp-gold:   #FFC107;
    --pdp-border: #e2e8f0;
    --pdp-surface:#f8fafc;
    --pdp-text:   #1e293b;
    --pdp-muted:  #64748b;
    --pdp-radius: 12px;
    --pdp-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ── Gallery wrapper ────────────────────────────────── */
.pdp-gallery-wrapper {
    position: relative;
    border-radius: var(--pdp-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--pdp-shadow);
}

.pdp-gallery-wrapper .product-image {
    border: none !important;
}

.pdp-gallery-wrapper .product-image-wrapper {
    padding: 1.5rem;
}

.pdp-gallery-wrapper .product-image-wrapper img {
    transition: transform .4s ease;
}

.pdp-gallery-wrapper:hover .product-image-wrapper img {
    transform: scale(1.03);
}

.pdp-gallery-nav {
    padding: .8rem 1rem 1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid var(--pdp-border);
}

.pdp-gallery-nav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .65rem;
    color: #475569;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .01em;
}

.pdp-gallery-nav__title {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--pdp-text);
}

.pdp-gallery-nav__count {
    color: var(--pdp-muted);
    font-weight: 600;
}

.pdp-gallery-wrapper .product-image-thumbs {
    gap: .7rem;
    padding: .15rem 0 .1rem;
    background: transparent;
    border: 0;
}

.pdp-gallery-nav__item {
    width: 82px;
    padding: 3px;
}

.pdp-gallery-nav__item .thumb-image {
    border: 0;
    background: transparent;
}

.pdp-gallery-wrapper .thumb-link {
    position: relative;
    display: block;
    width: 100%;
    padding: 4px;
    border: 0 !important;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 0 1px var(--pdp-border);
    transition: transform .18s ease, box-shadow .18s ease;
}

.pdp-gallery-wrapper .thumb-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px rgba(0, 117, 178, .45), 0 6px 14px rgba(15, 23, 42, .12);
}

.pdp-gallery-wrapper .thumb-link.active {
    box-shadow: 0 0 0 3px var(--pdp-blue), 0 6px 16px rgba(15, 23, 42, .14);
}

.pdp-gallery-wrapper .thumb-link:focus-visible {
    outline: 3px solid rgba(0, 117, 178, .35);
    outline-offset: 4px;
}

.pdp-gallery-wrapper .thumb-link img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 7px;
}

/* Floating USA badge over gallery */
.pdp-usa-float-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,.95);
    border: 1px solid var(--pdp-border);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--pdp-text);
    backdrop-filter: blur(6px);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    pointer-events: none;
}

/* Favorites button */
.pdp-fav-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,.95);
    border: 1px solid var(--pdp-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: border-color .2s, box-shadow .2s;
    backdrop-filter: blur(6px);
    padding: 0;
}

.pdp-fav-btn:hover {
    border-color: var(--pdp-red);
    box-shadow: 0 2px 10px rgba(226,31,38,.25);
}

.pdp-fav-btn .fa-heart {
    font-size: 1rem;
    color: #94a3b8;
    transition: color .2s, transform .25s cubic-bezier(.36,.07,.19,.97);
}

.pdp-fav-btn.active .fa-heart {
    color: var(--pdp-red);
}

.pdp-fav-btn.pop .fa-heart {
    transform: scale(1.45);
}

/* Favorites feedback toast */
#favorites-response-message {
    font-size: .8rem;
    border-radius: 0 0 var(--pdp-radius) var(--pdp-radius);
    transition: opacity .3s;
}

/* ── Command Center ─────────────────────────────────── */
/* No sticky/inner scroll: the column is content-heavy (description + specs)
   and a nested scrollbar beside the page scrollbar confuses shoppers. */

/* Title */
.pdp-title {
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--pdp-text);
    margin-bottom: .5rem;
}

/* Seller + badge row */
.pdp-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.pdp-seller-link {
    font-size: .875rem;
    color: var(--pdp-blue);
    text-decoration: none;
    font-weight: 500;
}
.pdp-seller-link:hover { text-decoration: underline; color: var(--pdp-blue); }

.pdp-usa-inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ── Item policy badges (made to order, no returns) ── */
.pdp-policy-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.25rem 0 1rem;
}

.pdp-policy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
}

.pdp-policy-badge--info {
    color: #005A8B;
    background: rgba(0, 117, 178, 0.1);
    border: 1px solid rgba(0, 117, 178, 0.25);
}

.pdp-policy-badge--warning {
    color: #856404;
    background: #FFF3CD;
    border: 1px solid #FFECB5;
}

/* Price — compact, with room to breathe */
.pdp-price {
    font-size: clamp(1.4rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--pdp-blue);
    line-height: 1;
    letter-spacing: -.01em;
    margin: 0.5rem 0 1.75rem;
}

/* ── Variant Pills ──────────────────────────────────── */
.pdp-variant-group {
    margin-bottom: 1.25rem;
}

.pdp-variant-group .variant-group-label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--pdp-text);
    margin-bottom: .6rem;
    display: block;
}

.pdp-variant-group .selected-value-label {
    color: var(--pdp-blue);
    font-weight: 700;
}

.variant-pill {
    min-width: 48px;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: .875rem;
    font-weight: 500;
    border: 2px solid var(--pdp-border);
    background: #fff;
    color: var(--pdp-text);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    line-height: 1.4;
}

.variant-pill:hover:not(:disabled) {
    border-color: var(--pdp-blue);
    color: var(--pdp-blue);
}

.variant-pill.active {
    border-color: var(--pdp-blue);
    background: var(--pdp-blue);
    color: #fff;
}

.variant-pill:disabled {
    text-decoration: line-through;
    opacity: .4;
    cursor: not-allowed;
}

.variant-pill.is-disabled-combo {
    text-decoration: line-through;
    opacity: .55;
}

.variant-pill.active.is-disabled-combo {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--pdp-muted);
}

.variant-pill[hidden] {
    display: none !important;
}

.variant-pills-loading,
.variant-pills-empty {
    color: var(--pdp-muted);
    font-size: .85rem;
    font-style: italic;
    padding: 6px 0;
    display: block;
}

/* Variant info display (price/stock after selection) */
#variant-info {
    font-size: .9rem;
    margin-bottom: .5rem;
}

.variant-price-display {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--pdp-blue);
    display: block;
    margin-bottom: 2px;
}

.variant-stock-info {
    font-size: .8rem;
    color: var(--pdp-muted);
}

/* ── Qty Stepper ────────────────────────────────────── */
.pdp-qty-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pdp-qty-label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--pdp-text);
    white-space: nowrap;
    margin: 0;
}

.qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1.5px solid var(--pdp-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.qty-btn {
    background: var(--pdp-surface);
    border: none;
    width: 38px;
    height: 40px;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--pdp-text);
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover { background: #e2e8f0; }

.qty-field {
    width: 52px;
    text-align: center;
    border: none;
    border-left: 1.5px solid var(--pdp-border);
    border-right: 1.5px solid var(--pdp-border);
    font-size: 1rem;
    font-weight: 600;
    color: var(--pdp-text);
    -moz-appearance: textfield;
    height: 40px;
    background: #fff;
}

.qty-field::-webkit-outer-spin-button,
.qty-field::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Add to Cart CTA — compact ──────────────────────── */
.btn-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 220px;
    padding: 10px 22px;
    margin-top: 0.5rem;
    background: var(--pdp-red);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .1s, box-shadow .2s, background .2s, opacity .2s;
    letter-spacing: .01em;
}

.btn-add-to-cart:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(226,31,38,.35);
    transform: translateY(-2px);
}

.btn-add-to-cart:active:not(:disabled) {
    transform: scale(.98);
    box-shadow: none;
}

.btn-add-to-cart:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-add-to-cart.state-loading { background: #6c757d; }
.btn-add-to-cart.state-success { background: var(--pdp-green); }

/* ── Confirmed cart mutation ────────────────────────── */
.pdp-cart-confirmation {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.9rem;
    margin-top: 0.75rem;
    border: 1px solid #9fd8b4;
    border-radius: 10px;
    background: #f2fbf5;
    color: #173f27;
}

.pdp-cart-confirmation[hidden] { display: none; }

.pdp-cart-confirmation__icon {
    color: var(--pdp-green);
    font-size: 1.35rem;
    line-height: 1.2;
}

.pdp-cart-confirmation__title {
    font-weight: 800;
    line-height: 1.25;
}

.pdp-cart-confirmation__detail {
    margin-top: 0.1rem;
    color: #3f5f4a;
    font-size: 0.88rem;
}

.pdp-cart-confirmation__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.pdp-cart-confirmation__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 38px;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--pdp-green);
    border-radius: 7px;
    color: #176b38;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}

.pdp-cart-confirmation__action:hover {
    color: #0f542b;
    background: #e4f5ea;
}

.pdp-cart-confirmation__action--primary {
    color: #fff;
    background: var(--pdp-green);
}

.pdp-cart-confirmation__action--primary:hover {
    color: #fff;
    background: #146c43;
    border-color: #146c43;
}

/* ── Trust Row ──────────────────────────────────────── */
.pdp-trust-row {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 8px;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--pdp-border);
}

.pdp-trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    flex: 1;
}

.pdp-trust-item i {
    font-size: 1.25rem;
}

.pdp-trust-item span {
    font-size: .68rem;
    color: var(--pdp-muted);
    font-weight: 500;
    line-height: 1.3;
}

/* ── Inline info: description + specs beside the gallery ── */
.pdp-inline-info {
    border-top: 1px solid var(--sf-border, #DCE1E7);
    padding-top: 1.25rem;
}

.pdp-inline-info__title {
    margin: 0 0 0.75rem;
    color: var(--sf-text, #3F4B59);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ── Below-fold Reviews ─────────────────────────────── */
.pdp-reviews-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--pdp-border);
}

/* Description */
.pdp-description {
    max-width: 70ch;
    line-height: 1.75;
    color: var(--pdp-text);
    font-size: .95rem;
}

/* Specs table */
.pdp-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    max-width: 600px;
}

.pdp-specs-table tr:nth-child(even) th,
.pdp-specs-table tr:nth-child(even) td {
    background: var(--pdp-surface);
}

.pdp-specs-table th {
    width: 38%;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--pdp-muted);
    text-align: left;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--pdp-border);
}

.pdp-specs-table td {
    padding: 10px 14px;
    color: var(--pdp-text);
    border-bottom: 1px solid var(--pdp-border);
}

/* ── Reviews ────────────────────────────────────────── */
.pdp-reviews-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--pdp-surface);
    border-radius: 10px;
    border: 1px solid var(--pdp-border);
}

.pdp-avg-rating {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--pdp-text);
    line-height: 1;
}

.pdp-star-display {
    color: var(--pdp-gold);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.pdp-star-display-sm {
    color: var(--pdp-gold);
    font-size: .85rem;
    letter-spacing: .5px;
}

.pdp-review-card {
    border-left: 3px solid var(--pdp-gold);
    padding: 1rem 1.25rem;
    margin-bottom: .875rem;
    background: #fff;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.pdp-review-card .review-title {
    font-weight: 700;
    font-size: .95rem;
    color: var(--pdp-text);
}

.pdp-review-card .review-date {
    font-size: .75rem;
    color: var(--pdp-muted);
    white-space: nowrap;
}

.pdp-review-card .review-body {
    font-size: .875rem;
    color: #475569;
    margin-top: 6px;
    line-height: 1.55;
}

/* ── Recommended ────────────────────────────────────── */
.pdp-recommended {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--pdp-border);
}

.pdp-recommended h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--pdp-text);
}

/* Card lift effect on recommended items */
.pdp-item-card-wrap {
    transition: transform .2s, box-shadow .2s;
    border-radius: 10px;
    overflow: hidden;
}

.pdp-item-card-wrap:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

/* ── Mobile Sticky Bottom Bar ───────────────────────── */
.pdp-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 16px;
    box-shadow: 0 -2px 16px rgba(0,0,0,.12);
    z-index: 1040;
    transform: translateY(100%);
    transition: transform .3s ease;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--pdp-border);
}

.pdp-mobile-bar.visible {
    transform: translateY(0);
}

.pdp-mobile-bar .mini-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--pdp-blue);
    white-space: nowrap;
    min-width: 70px;
}

.pdp-mobile-bar .btn-add-to-cart-mini {
    flex: 1;
    padding: 11px 16px;
    background: var(--pdp-red);
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pdp-mobile-bar .btn-add-to-cart-mini:hover { opacity: .92; }
.pdp-mobile-bar .btn-add-to-cart-mini:disabled { opacity: .55; cursor: not-allowed; }
.pdp-mobile-bar.cart-confirmed { display: none; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 991px) {
    .pdp-mobile-bar {
        display: flex;
    }

    .product-detail-page {
        padding-bottom: 72px;
    }
}

@media (max-width: 575px) {
    .pdp-price     { font-size: 1.85rem; }
    .pdp-title     { font-size: 1.25rem; }
    .pdp-trust-row { gap: 4px; }
    .pdp-trust-item i { font-size: 1.1rem; }
    .pdp-cart-confirmation__actions { display: grid; grid-template-columns: 1fr; }
    .pdp-cart-confirmation__action { width: 100%; }
}
