/*
 * Shopidy storefront styles.
 *
 * Theme-aware: themes may override these variables and be loaded after this
 * file. Everything is hand-written and served from /public/css.
 */

body.shop {
    background: var(--bg);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 1rem;
}

/* ----------------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 4.25rem;
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.site-header__brand:hover {
    text-decoration: none;
}

.site-header__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 11px;
    background: var(--primary);
    color: var(--primary-contrast);
}

.site-nav {
    display: flex;
    flex: 1;
    gap: 1rem;
}

.site-nav__link {
    color: var(--text);
    font-size: .92rem;
}

.site-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ------------------------------------------------------------------- hero */

.hero {
    padding: 3.5rem 0;
    background: linear-gradient(150deg, var(--primary-soft), var(--bg));
}

.hero__title {
    margin-bottom: .75rem;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.hero__text {
    max-width: 40rem;
    color: var(--muted);
}

.section {
    padding: 2.5rem 0;
}

.section__title {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

/* ------------------------------------------------------------ product grid */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1.25rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.product-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.product-card__media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__body {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .9rem 1rem 1.1rem;
}

.product-card__title {
    margin: 0;
    font-size: .95rem;
}

.product-card__price {
    color: var(--primary-600);
    font-weight: 700;
}

/* ------------------------------------------------- thumbhash placeholders */

[data-thumbhash] {
    position: relative;
    background-color: var(--surface-2);
    background-size: cover;
    background-position: center;
}

[data-thumbhash] > img {
    opacity: 0;
    transition: opacity 300ms ease;
}

[data-thumbhash].is-decoded > img {
    opacity: 1;
}

/* ----------------------------------------------------------------- footer */

.site-footer {
    margin-top: 3rem;
    padding: 2.5rem 0 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: .875rem;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.site-footer__title {
    margin-bottom: .6rem;
    color: var(--text);
    font-size: .95rem;
}

.site-footer__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer__list li {
    margin-bottom: .35rem;
}

.site-footer__bottom {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

@media (max-width: 768px) {
    .site-nav {
        display: none;
    }
}

/* ------------------------------------------------------------- catalogue */

.catalog__search {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.catalog__search-field {
    position: relative;
    flex: 1 1 auto;
}

.suggestions {
    position: absolute;
    z-index: 20;
    inset-inline: 0;
    margin: .25rem 0 0;
    padding: .25rem;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.suggestions__link {
    display: block;
    padding: .45rem .6rem;
    border-radius: var(--radius-sm);
    color: var(--text);
}

.suggestions__link:hover {
    background: var(--surface-2);
}

.catalog__layout {
    display: grid;
    grid-template-columns: minmax(14rem, 17rem) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.catalog__sidebar .card {
    position: sticky;
    top: 1rem;
}

.catalog__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.filter-group__title {
    margin: 0 0 .5rem;
    font-size: .9rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .35rem;
    font-size: .9rem;
}

.price-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.product-card__brand {
    font-size: .75rem;
}

.product-card__badge {
    position: absolute;
    inset-block-start: .5rem;
    inset-inline-start: .5rem;
}

.product-card__thumb {
    position: absolute;
    inset: 0;
}

.product-card__thumb > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ----------------------------------------------------------- product page */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.25rem;
    color: var(--muted);
    font-size: .875rem;
}

.product {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.product__main-image {
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.product__main-image > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr));
    gap: .5rem;
    margin-top: .75rem;
}

.product__thumb {
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.product__thumb > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product__title {
    margin: 0 0 .5rem;
    font-size: 1.5rem;
}

.product__brand {
    margin-bottom: .75rem;
}

.product__price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    margin-bottom: .75rem;
}

.product__price-value {
    color: var(--primary-600);
    font-size: 1.35rem;
    font-weight: 700;
}

.product__stock {
    margin-bottom: 1rem;
}

.product__summary {
    line-height: 1.9;
}

.product__section-title {
    margin: 1.25rem 0 .6rem;
    font-size: 1rem;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.variant-option {
    padding: .4rem .85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.variant-option.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-600);
}

.variant-option.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    text-decoration: line-through;
}

.product__actions {
    margin-top: 1.5rem;
}

.product__description {
    line-height: 2;
}

@media (max-width: 900px) {
    .catalog__layout,
    .product {
        grid-template-columns: 1fr;
    }

    .catalog__sidebar .card {
        position: static;
    }
}

/* Cart & Checkout */
.cart-page .title,
.checkout-page .title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 16px;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert--danger { background: var(--danger-soft, rgba(239,68,68,.12)); color: var(--danger); border: 1px solid var(--danger); }
.alert--success { background: var(--success-soft, rgba(34,197,94,.12)); color: var(--success); border: 1px solid var(--success); }
.alert--warning { background: var(--warning-soft, rgba(234,179,8,.12)); color: var(--warning); border: 1px solid var(--warning); }

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 768px) {
    .grid-two { grid-template-columns: 1fr; }
}

.cart-layout,
.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .cart-layout,
    .checkout-layout { grid-template-columns: 1fr; }
}

.cart-item {
    display: grid;
    grid-template-columns: 72px 1fr 96px 110px 64px;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
@media (max-width: 768px) {
    .cart-item { grid-template-columns: 64px 1fr; gap: 8px; }
    .cart-item__qty, .cart-item__total, .cart-item__remove { grid-column: 1 / -1; }
}
.cart-item__image img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-item__title { font-weight: 700; }
.cart-item__variant { display: block; color: var(--muted); font-size: 0.85rem; }
.cart-item__price { display: block; color: var(--primary); font-weight: 700; }

.cart-summary,
.checkout-summary {
    padding: 16px;
}
.cart-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.cart-summary__total {
    font-weight: 800;
    font-size: 1.05rem;
    border-bottom: none;
}

.form-control--sm { width: 84px; }

.checkout-address { cursor: pointer; }

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { padding: 32px; text-align: center; color: var(--muted); }

.site-header__cart { display: inline-flex; align-items: center; gap: 8px; }
.cart-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-contrast);
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Support floating widget */
.support-fab {
    position: fixed;
    inset-inline-end: 20px;
    bottom: 20px;
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.support-fab__toggle {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-contrast);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.support-fab__toggle:hover {
    background: var(--primary-600);
    transform: translateY(-2px);
}

.support-fab__menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    min-width: 180px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.support-fab__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.support-fab__item:hover {
    background: var(--surface-2);
    color: var(--primary);
}

.support-fab__icon { font-size: 18px; }
.support-fab__label { font-size: 14px; font-weight: 600; }

/* Ticket conversation thread */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ticket-message {
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.ticket-message--admin {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.ticket-message__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.ticket-message__body {
    white-space: pre-wrap;
    line-height: 1.9;
}

.ticket-message__attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ticket-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary);
    font-size: 12px;
    text-decoration: none;
}

.ticket-attachment::before { content: "📎"; }

@media (max-width: 640px) {
    .support-fab {
        inset-inline-end: 14px;
        bottom: 14px;
    }

    .support-fab__toggle {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

/* ── Phase 15: product comparison ─────────────────────────── */
.compare-button.is-active {
    border-color: var(--primary);
    color: var(--primary-600);
    background: var(--primary-soft);
}

.shop-compare-bar {
    position: fixed;
    inset-inline: 12px;
    bottom: 12px;
    z-index: 65;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.shop-compare-bar__count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.shop-compare-bar__actions {
    display: inline-flex;
    gap: 8px;
}

.compare-table th {
    white-space: nowrap;
}

.compare-table__product {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.compare-table__thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------- Homepage & Storefront Overhaul */

.shop-top-banner {
    display: block;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    border-bottom: 1px solid var(--border);
}

.shop-top-banner img {
    width: 100%;
    max-height: 60px;
    object-fit: cover;
}

/* Hero Section */
.hero-section {
    padding: 1.5rem 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.25rem;
    align-items: stretch;
}

.hero-slider {
    position: relative;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    background: var(--surface-2);
    min-height: 380px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}

.hero-slider__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease-in-out;
    display: flex;
    align-items: center;
}

.hero-slider__slide.is-active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    min-height: 380px;
}

.hero-slider__backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-slider__backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slider__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.45) 50%, rgba(15, 23, 42, 0.1) 100%);
    z-index: 2;
}

.hero-slider__content {
    position: relative;
    z-index: 3;
    padding: 2.5rem;
    max-width: 520px;
    color: #fff;
}

.hero-slider__title {
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    font-weight: 800;
    line-height: 1.4;
    margin: 0 0 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-slider__desc {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.9);
    margin: 0 0 1.5rem;
}

.hero-slider__nav {
    position: absolute;
    inset-inline: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 4;
}

.hero-slider__arrow {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    color: #111;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all .2s;
}

.hero-slider__arrow:hover {
    background: #fff;
    transform: scale(1.08);
}

.hero-slider__dots {
    position: absolute;
    bottom: 1rem;
    inset-inline: 0;
    display: flex;
    justify-content: center;
    gap: .5rem;
    z-index: 4;
}

.hero-slider__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.4);
    border: none;
    cursor: pointer;
    transition: all .3s;
    padding: 0;
}

.hero-slider__dot.is-active {
    width: 28px;
    background: #fff;
}

/* Side Promos */
.hero-side-promos {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hero-promo-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    border-radius: var(--radius-lg, 16px);
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
    overflow: hidden;
    position: relative;
}

.hero-promo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.hero-promo-card--first {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, var(--surface) 100%);
    border-color: rgba(239, 68, 68, 0.2);
}

.hero-promo-card--second {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, var(--surface) 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

.hero-promo-card__tag {
    align-self: flex-start;
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
}

.hero-promo-card__title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: .75rem 0 .5rem;
}

.hero-promo-card__desc {
    font-size: .88rem;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.hero-promo-card__action {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 700;
    color: var(--primary);
}

/* Value Props Strip */
.value-props {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding: 1.25rem;
    margin: 1.5rem 0 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
}

.value-props__item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.value-props__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.value-props__icon svg {
    width: 24px;
    height: 24px;
}

.value-props__title {
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    color: var(--text);
}

.value-props__desc {
    font-size: .8rem;
    color: var(--muted);
    margin: 0;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header__title-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.section-header__accent {
    width: 5px;
    height: 24px;
    background: var(--primary);
    border-radius: 999px;
}

.section-header__title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    color: var(--text);
}

.section-header__link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: gap .2s;
}

.section-header__link:hover {
    gap: .6rem;
    text-decoration: none;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.25rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    text-decoration: none;
    color: inherit;
    transition: all .25s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    text-decoration: none;
}

.category-card__thumb {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .85rem;
    overflow: hidden;
    border: 2px solid var(--border);
}

.category-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card__name {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .25rem;
}

.category-card__count {
    font-size: .75rem;
    color: var(--muted);
}

/* Special Offers / Flash Sale Container */
.special-offers-box {
    margin: 3rem 0;
    padding: 1.75rem;
    border-radius: var(--radius-lg, 20px);
    background: linear-gradient(135deg, #e11d48 0%, #be123c 60%, #9f1239 100%);
    box-shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.3);
}

.special-offers-box__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.special-offers-box__title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
}

.special-offers-box__timer {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(0,0,0,0.25);
    padding: .4rem .9rem;
    border-radius: 999px;
    font-size: .9rem;
    direction: ltr;
}

.timer-unit {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 28px;
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1;
}

.timer-sep {
    font-weight: 800;
    opacity: .6;
}

.special-offers-box__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.25rem;
}

/* Product Card Enhanced */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px -4px rgba(0,0,0,0.08);
    border-color: var(--primary-light, #cbd5e1);
}

.product-card__gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    overflow: hidden;
}

.product-card__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.product-card:hover .product-card__thumb {
    transform: scale(1.05);
}

.product-card__quick-actions {
    position: absolute;
    inset-inline-end: .6rem;
    top: .6rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    z-index: 5;
    opacity: 0;
    transform: translateX(6px);
    transition: all .2s ease;
}

.product-card:hover .product-card__quick-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-card__badges {
    position: absolute;
    inset-inline-start: .6rem;
    top: .6rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    z-index: 5;
}

.product-card__discount-badge {
    font-size: .75rem;
    font-weight: 800;
    padding: .2rem .5rem;
    border-radius: 6px;
    background: #ef4444;
    color: #fff;
    box-shadow: 0 2px 4px rgba(239,68,68,0.3);
}

.product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
}

.product-card__brand {
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: .35rem;
}

.product-card__title {
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text);
    margin: 0 0 .75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.85rem;
}

.product-card__title a {
    color: inherit;
    text-decoration: none;
}

.product-card__title a:hover {
    color: var(--primary);
}

.product-card__footer {
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.product-card__pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.product-card__old-price {
    font-size: .8rem;
    color: var(--muted);
    text-decoration: line-through;
    line-height: 1.2;
}

.product-card__current-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-600, #0284c7);
}

.product-card__currency {
    font-size: .75rem;
    font-weight: 500;
    color: var(--muted);
    margin-inline-start: .2rem;
}

.product-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid transparent;
    transition: all .2s;
    cursor: pointer;
}

.product-card__btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Middle Promo Banners */
.promo-banners-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin: 2.5rem 0;
}

.promo-banner {
    display: block;
    position: relative;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    aspect-ratio: 2.4 / 1;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform var(--transition);
}

.promo-banner:hover {
    transform: translateY(-3px);
}

.promo-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Blog Cards */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.blog-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--surface-2);
}

.blog-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card__date {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .5rem;
}

.blog-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 .5rem;
    color: var(--text);
}

.blog-card__excerpt {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Trust CTA Section */
.trust-cta-section {
    margin: 3rem 0 1.5rem;
    padding: 2.5rem;
    border-radius: var(--radius-lg, 20px);
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border);
    text-align: center;
}

.trust-cta-section__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 .5rem;
}

.trust-cta-section__desc {
    color: var(--muted);
    max-width: 550px;
    margin: 0 auto 1.5rem;
    font-size: .95rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .value-props {
        grid-template-columns: repeat(2, 1fr);
    }
    .promo-banners-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .value-props {
        grid-template-columns: 1fr;
    }
    .hero-slider, .hero-slider__slide.is-active {
        min-height: 300px;
    }
    .hero-slider__content {
        padding: 1.5rem;
    }
    .product-card__quick-actions {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ============================================================
   Phase 19 — Storefront UX: cart drawer, quick search, mobile nav
   ============================================================ */

/* Cart drawer ---------------------------------------------------------- */
.cart-drawer { position: relative; z-index: 95; }

.cart-drawer__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
    animation: cart-drawer-fade .2s ease-out;
}

.cart-drawer__panel {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 96;
    width: min(26rem, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-inline-start: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: cart-drawer-slide .24s cubic-bezier(.22, .61, .36, 1);
}

body:has(.cart-drawer__panel) { overflow: hidden; }

@keyframes cart-drawer-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes cart-drawer-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-block-end: 1px solid var(--border);
}

.cart-drawer__title {
    margin: 0;
    font-size: 1.05rem;
    display: flex;
    align-items: baseline;
    gap: .5rem;
}

.cart-drawer__count {
    font-size: .75rem;
    font-weight: 500;
    color: var(--muted);
}

.cart-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.cart-drawer__close:hover { background: var(--surface-2); color: var(--danger); }

.cart-drawer__error { margin: 1rem 1.25rem 0; }

.cart-drawer__empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--muted);
}

.cart-drawer__empty-icon { color: var(--muted); opacity: .7; }
.cart-drawer__empty-text { margin: 0; }

.cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 1.25rem;
}

.cart-drawer__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .75rem;
}

.cart-drawer__item {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
    grid-template-areas: "thumb info controls" "total total total";
    gap: .25rem .75rem;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.cart-drawer__thumb {
    grid-area: thumb;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.cart-drawer__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cart-drawer__info { grid-area: info; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }

.cart-drawer__item-title {
    font-size: .875rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    line-height: 1.5;
}

.cart-drawer__variant { font-size: .75rem; color: var(--muted); }
.cart-drawer__unit { font-size: .75rem; color: var(--muted); }
.cart-drawer__unit del { color: var(--danger); margin-inline-start: .35rem; }

.cart-drawer__controls {
    grid-area: controls;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: .35rem;
}

.cart-drawer__line-total {
    grid-area: total;
    text-align: end;
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary);
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    overflow: hidden;
}

.qty-stepper button {
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition);
}

.qty-stepper button:hover { background: var(--primary-soft); color: var(--primary); }

.qty-stepper__value {
    min-width: 1.75rem;
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
}

.cart-drawer__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.cart-drawer__remove:hover { background: var(--danger-soft); color: var(--danger); }

.cart-drawer__footer {
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-block-start: 1px solid var(--border);
    background: var(--surface-2);
    display: grid;
    gap: .5rem;
}

.cart-drawer__summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .85rem;
    color: var(--muted);
}

.cart-drawer__summary-row--discount { color: var(--danger); }

.cart-drawer__summary-row--total {
    padding-block-start: .5rem;
    border-block-start: 1px dashed var(--border);
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.cart-drawer__checkout { margin-block-start: .5rem; }

.cart-drawer__secondary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Quick search ---------------------------------------------------------- */
.quick-search { position: relative; width: 100%; max-width: 26rem; }

.quick-search__form { position: relative; display: flex; align-items: center; }

.quick-search__icon {
    position: absolute;
    inset-inline-start: .65rem;
    color: var(--muted);
    pointer-events: none;
}

.quick-search__input {
    width: 100%;
    padding: .5rem 2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .85rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.quick-search__input::placeholder { color: var(--muted); }
.quick-search__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.quick-search__results {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + .4rem);
    z-index: 90;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.quick-search__list { list-style: none; margin: 0; padding: .25rem; max-height: 22rem; overflow-y: auto; }

.quick-search__link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition);
}

.quick-search__link:hover, .quick-search__link:focus-visible { background: var(--surface-2); }

.quick-search__thumb {
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
}

.quick-search__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.quick-search__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.quick-search__name { font-size: .82rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-search__category { font-size: .7rem; color: var(--muted); }
.quick-search__price { flex: none; font-size: .75rem; font-weight: 700; color: var(--primary); white-space: nowrap; }

.quick-search__empty { margin: 0; padding: 1rem; text-align: center; font-size: .82rem; color: var(--muted); }

.quick-search__all {
    display: block;
    padding: .6rem .75rem;
    border-block-start: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--primary);
    font-size: .78rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.quick-search__all:hover { background: var(--primary-soft); }

/* Mobile bottom nav ----------------------------------------------------- */
.mobile-nav { display: none; }

@media (max-width: 768px) {
    .mobile-nav {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 80;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: stretch;
        background: var(--surface);
        border-block-start: 1px solid var(--border);
        box-shadow: 0 -2px 12px rgba(15, 23, 42, .08);
        padding-block-end: env(safe-area-inset-bottom, 0px);
    }

    body.shop { padding-block-end: calc(62px + env(safe-area-inset-bottom, 0px)); }

    .mobile-nav__item,
    .mobile-nav .site-header__cart {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .2rem;
        padding: .45rem .25rem;
        border: 0;
        background: transparent;
        color: var(--muted);
        font: inherit;
        font-size: .68rem;
        text-decoration: none;
        cursor: pointer;
        transition: color var(--transition);
    }

    .mobile-nav__item.is-active,
    .mobile-nav .site-header__cart.is-active { color: var(--primary); }

    .mobile-nav .site-header__cart { gap: .2rem; }

    .mobile-nav .cart-badge {
        position: absolute;
        top: .3rem;
        inset-inline-start: calc(50% - 1.6rem);
        min-width: 1.1rem;
        height: 1.1rem;
        padding: 0 .25rem;
        font-size: .62rem;
    }

    /* Quick search floats above the bottom bar on small screens. */
    .quick-search {
        position: fixed;
        inset-inline: 0;
        bottom: calc(62px + env(safe-area-inset-bottom, 0px));
        max-width: none;
        padding: .5rem .75rem 0;
        background: var(--surface);
        border-block-start: 1px solid var(--border);
        box-shadow: 0 -4px 16px rgba(15, 23, 42, .1);
    }

    .quick-search:not(.is-open) { display: none; }

    /* The sheet sits above the bottom bar, so the popup opens upward. */
    .quick-search__results {
        inset-inline: .75rem;
        top: auto;
        bottom: calc(100% - .25rem);
    }
}

/* Product gallery ------------------------------------------------------- */
.product__main-image { position: relative; cursor: grab; }
.product__main-image:active { cursor: grabbing; }
.product__main-image:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.product__thumb[data-thumbhash-painted] { background-size: cover; background-position: center; }

.product__gallery-counter {
    position: absolute;
    inset-block-end: .5rem;
    inset-inline-end: .5rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, .65);
    color: #fff;
    font-size: .72rem;
}

.product__thumbs {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-block-end: .25rem;
}

.product__thumb {
    flex: 0 0 4rem;
    width: 4rem;
    padding: 0;
    background: transparent;
    cursor: pointer;
    scroll-snap-align: start;
}

.product__thumb.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.product__sku { margin: .5rem 0 0; font-size: .78rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
    .cart-drawer__panel,
    .cart-drawer__backdrop { animation: none; }
}

/* Product video */
.product__video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius, .75rem);
    overflow: hidden;
}

.product__video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* SnappPay installment banner */
.snapppay-banner {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .75rem;
    padding: .65rem .85rem;
    border: 1px solid var(--primary-soft, #d9e2ff);
    border-radius: var(--radius, .75rem);
    background: linear-gradient(135deg, var(--primary-soft, #eef2ff), #fff);
}

.snapppay-banner__badge {
    flex: 0 0 auto;
    padding: .2rem .5rem;
    font-size: .72rem;
    font-weight: 700;
    color: #fff;
    background: #00d2ff;
    background: linear-gradient(135deg, #21aa58, #00d2ff);
    border-radius: .5rem;
    white-space: nowrap;
}

.snapppay-banner__text {
    margin: 0;
    font-size: .85rem;
    line-height: 1.6;
    color: var(--text, #1f2937);
}

