/* ============================================================
   StoreWe — components.css
   Reusable UI components: skeleton loaders, promo ribbon,
   trust ribbon, newsletter, bottom mobile nav, scroll-to-top,
   product card v2, sort pills, urgency chips.
   ============================================================ */

/* ── 1. SKELETON LOADERS ──────────────────────────────────── */
@keyframes sw-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0;  }
}

.sw-skeleton {
    background: linear-gradient(90deg,
        var(--sw-surface-2) 25%,
        var(--sw-border)    50%,
        var(--sw-surface-2) 75%
    );
    background-size: 600px 100%;
    animation: sw-shimmer 1.4s infinite linear;
    border-radius: var(--sw-radius-sm);
}

.sw-skeleton-card {
    background: var(--sw-surface);
    border-radius: var(--sw-radius);
    border: 1px solid var(--sw-border);
    overflow: hidden;
    height: 100%;
}

.sw-skeleton-img {
    width:  100%;
    aspect-ratio: 4 / 3;
}

.sw-skeleton-line {
    height: 14px;
    margin-bottom: 8px;
}

.sw-skeleton-line.short   { width: 60%; }
.sw-skeleton-line.medium  { width: 80%; }
.sw-skeleton-line.w-40    { width: 40%; }
.sw-skeleton-title { height: 18px; margin-bottom: 10px; }

.sw-skeleton-body {
    padding: 1rem;
}

.sw-skeleton-btn {
    height: 34px;
    width: 90px;
    border-radius: var(--sw-radius-sm);
}

/* ── 2. PROMOTIONAL ANNOUNCEMENT RIBBON ─────────────────── */
.sw-promo-ribbon {
    background: linear-gradient(90deg, #1b5e20 0%, #2e7d32 50%, #1b5e20 100%);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.5rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sw-promo-ribbon::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.1), transparent);
    animation: sw-promo-shine 4s infinite linear;
}

@keyframes sw-promo-shine {
    0%   { left: -100%; }
    60%  { left: 150%;  }
    100% { left: 150%;  }
}

.sw-promo-ribbon a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sw-promo-ribbon .sw-promo-items {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.sw-promo-ribbon .sw-promo-sep {
    opacity: .4;
}

.sw-promo-dismiss {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    transition: color .2s;
}

.sw-promo-dismiss:hover { color: #fff; }

/* ── 3. TRUST RIBBON ─────────────────────────────────────── */
.sw-trust-ribbon {
    border-top: 1px solid var(--sw-border);
    border-bottom: 1px solid var(--sw-border);
    background: var(--sw-surface);
    padding: 1.25rem 0;
}

.sw-trust-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1rem;
}

.sw-trust-item + .sw-trust-item {
    border-left: 1px solid var(--sw-border);
}

@media (max-width: 575.98px) {
    .sw-trust-item + .sw-trust-item { border-left: none; border-top: 1px solid var(--sw-border); }
    .sw-trust-item { border-left: none !important; }
}

.sw-trust-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(46,125,50,.1) 0%, rgba(46,125,50,.18) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--sw-primary);
    flex-shrink: 0;
    transition: transform .25s, background .25s;
}

.sw-trust-item:hover .sw-trust-icon {
    transform: scale(1.12);
    background: linear-gradient(135deg, rgba(46,125,50,.18) 0%, rgba(46,125,50,.3) 100%);
}

.sw-trust-label {
    font-weight: 700;
    font-size: .875rem;
    color: var(--sw-text);
    line-height: 1.2;
}

.sw-trust-sub {
    font-size: .75rem;
    color: var(--sw-text-muted);
    margin-top: 1px;
}

/* ── 4. PRODUCT CARD V2 ──────────────────────────────────── */
.sw-card {
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .28s cubic-bezier(.4,0,.2,1), box-shadow .28s cubic-bezier(.4,0,.2,1), border-color .28s;
    position: relative;
}

.sw-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sw-shadow-md);
    border-color: rgba(46,125,50,.2);
}

/* Image wrapper */
.sw-card-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--sw-surface-2);
    flex-shrink: 0;
}

.sw-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s cubic-bezier(.4,0,.2,1);
    display: block;
}

.sw-card:hover .sw-card-img img {
    transform: scale(1.07);
}

/* Quick view slide-up overlay */
.sw-card-quickview {
    position: absolute;
    bottom: -44px;
    left: 0;
    right: 0;
    padding: .6rem;
    background: rgba(18, 18, 18, .82);
    color: #fff;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: bottom .25s cubic-bezier(.4,0,.2,1);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    backdrop-filter: blur(4px);
}

.sw-card:hover .sw-card-quickview {
    bottom: 0;
}

/* Top badges */
.sw-card-badges {
    position: absolute;
    top: .625rem;
    left: .625rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    z-index: 2;
}

/* Wishlist button */
.sw-card-wishlist {
    position: absolute;
    top: .5rem;
    right: .5rem;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    color: var(--sw-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    opacity: 0;
    transform: scale(.85);
    font-size: .875rem;
}

.sw-card:hover .sw-card-wishlist,
.sw-card-wishlist.active {
    opacity: 1;
    transform: scale(1);
}

.sw-card-wishlist:hover,
.sw-card-wishlist.active {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Card body */
.sw-card-body {
    flex: 1;
    padding: .875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.sw-card-vendor {
    font-size: .72rem;
    font-weight: 600;
    color: var(--sw-primary);
    display: flex;
    align-items: center;
    gap: .3rem;
    text-decoration: none;
}

.sw-card-vendor:hover { text-decoration: underline; }

.sw-card-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--sw-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    transition: color .2s;
}

.sw-card-title:hover { color: var(--sw-primary); }

.sw-card-rating {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
}

.sw-card-stars { color: #f59e0b; }
.sw-card-rating-count { color: var(--sw-text-muted); }

/* Price row */
.sw-card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: .5rem;
    border-top: 1px solid var(--sw-border);
    gap: .5rem;
}

.sw-card-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--sw-primary);
    line-height: 1;
}

.sw-card-original {
    font-size: .78rem;
    text-decoration: line-through;
    color: var(--sw-text-muted);
    font-weight: 400;
}

/* Urgency chip */
.sw-urgency {
    font-size: .7rem;
    font-weight: 700;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: .25rem;
}

.sw-urgency-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #dc2626;
    animation: sw-pulse 1.4s infinite;
    flex-shrink: 0;
}

@keyframes sw-pulse {
    0%, 100% { opacity: 1; transform: scale(1);   }
    50%       { opacity: .5; transform: scale(.7); }
}

/* Add to cart button in card */
.sw-card-atc {
    background: var(--sw-gradient);
    color: #fff !important;
    border: none;
    border-radius: var(--sw-radius-sm);
    padding: .4rem .9rem;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: opacity .2s, transform .2s;
    flex-shrink: 0;
}

.sw-card-atc:hover  { opacity: .92; transform: translateY(-1px); }
.sw-card-atc:active { transform:    translateY(0); }
.sw-card-atc:disabled {
    background: var(--sw-border);
    color: var(--sw-text-muted) !important;
    cursor: not-allowed;
    transform: none;
}

/* ── 5. SORT PILLS ───────────────────────────────────────── */
.sw-sort-pills {
    display: flex;
    gap: .375rem;
    flex-wrap: wrap;
    align-items: center;
}

.sw-sort-pill {
    background: var(--sw-surface-2);
    border: 1px solid var(--sw-border);
    color: var(--sw-text-muted);
    border-radius: var(--sw-radius-full);
    padding: .3rem .9rem;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.sw-sort-pill:hover {
    background: rgba(46,125,50,.08);
    border-color: var(--sw-primary);
    color: var(--sw-primary);
}

.sw-sort-pill.active {
    background: var(--sw-gradient);
    border-color: transparent;
    color: #fff;
}

/* ── 6. FILTER CHIPS ─────────────────────────────────────── */
.sw-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-bottom: .875rem;
}

.sw-chip {
    background: rgba(46,125,50,.1);
    border: 1px solid rgba(46,125,50,.25);
    color: var(--sw-primary);
    border-radius: var(--sw-radius-full);
    padding: .25rem .75rem;
    font-size: .78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.sw-chip:hover {
    background: rgba(198,40,40,.1);
    border-color: rgba(198,40,40,.3);
    color: #dc2626;
}

.sw-chip-x {
    font-size: .9rem;
    line-height: 1;
    opacity: .7;
}

/* ── 7. SECTION HEADERS ──────────────────────────────────── */
.sw-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
}

.sw-section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--sw-primary);
    margin-bottom: .5rem;
}

.sw-section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--sw-text);
    line-height: 1.2;
    margin: 0;
}

.sw-section-sub {
    color: var(--sw-text-muted);
    font-size: .9375rem;
    margin: .375rem 0 0;
}

.sw-section-link {
    color: var(--sw-primary);
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: gap .2s;
}

.sw-section-link:hover { gap: .6rem; text-decoration: none; color: var(--sw-primary); }

/* ── 8. NEWSLETTER SECTION ───────────────────────────────── */
.sw-newsletter {
    background: linear-gradient(135deg, #0d2b0e 0%, #1a4a1c 60%, #0d2b0e 100%);
    padding: 3.5rem 0;
    position: relative;
    overflow: hidden;
}

.sw-newsletter::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    pointer-events: none;
}

.sw-newsletter::after {
    content: '';
    position: absolute;
    bottom: -100px; left: -60px;
    width: 350px; height: 350px;
    border-radius: 50%;
    background: rgba(255,255,255,.03);
    pointer-events: none;
}

.sw-newsletter-title {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: .5rem;
    line-height: 1.2;
}

.sw-newsletter-sub {
    color: rgba(255,255,255,.75);
    font-size: .9375rem;
    margin: 0;
}

.sw-newsletter-form {
    display: flex;
    gap: .625rem;
    max-width: 440px;
    width: 100%;
}

.sw-newsletter-form input[type="email"] {
    flex: 1;
    border: none;
    border-radius: var(--sw-radius-sm);
    padding: .75rem 1.125rem;
    font-size: .9375rem;
    font-family: var(--sw-font);
    background: rgba(255,255,255,.95);
    color: #111;
    outline: none;
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
}

.sw-newsletter-form input[type="email"]::placeholder {
    color: #9ca3af;
}

.sw-newsletter-form input[type="email"]:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(76,175,80,.45), 0 2px 12px rgba(0,0,0,.2);
}

.sw-newsletter-form button {
    background: #fff;
    color: var(--sw-primary);
    border: none;
    border-radius: var(--sw-radius-sm);
    padding: .75rem 1.375rem;
    font-size: .9375rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    font-family: var(--sw-font);
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
}

.sw-newsletter-form button:hover {
    background: var(--sw-primary);
    color: #fff;
    transform: translateY(-1px);
}

.sw-newsletter-trust {
    color: rgba(255,255,255,.5);
    font-size: .78rem;
    margin-top: .625rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

@media (max-width: 767.98px) {
    .sw-newsletter { padding: 2.5rem 0; }
    .sw-newsletter-form { flex-direction: column; max-width: 100%; }
    .sw-newsletter-title { font-size: 1.4rem; }
}

/* ── 9. SELL ON STOREWE BANNER ───────────────────────────── */
.sw-vendor-cta {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    border-radius: var(--sw-radius-lg);
    padding: 2.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.sw-vendor-cta::after {
    content: '\f07a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 6rem;
    opacity: .08;
    pointer-events: none;
}

.sw-vendor-cta h3 {
    color: #fff;
    font-weight: 800;
    margin-bottom: .5rem;
}

.sw-vendor-cta p { color: rgba(255,255,255,.8); margin-bottom: 1.25rem; }

.sw-vendor-cta .btn-light {
    font-weight: 700;
    border-radius: var(--sw-radius-sm);
    color: #1565c0;
}

/* ── 10. HERO IMAGE MOSAIC ───────────────────────────────── */
.sw-hero-mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows:    1fr 1fr;
    gap: .75rem;
    height: 380px;
    border-radius: var(--sw-radius-lg);
    overflow: hidden;
}

.sw-hero-mosaic-item {
    border-radius: var(--sw-radius);
    overflow: hidden;
    position: relative;
}

.sw-hero-mosaic-item:first-child {
    grid-row: 1 / 3;
    border-radius: var(--sw-radius);
}

.sw-hero-mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.sw-hero-mosaic:hover .sw-hero-mosaic-item img {
    transform: scale(1.04);
}

.sw-hero-mosaic-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .5rem;
    color: rgba(255,255,255,.5);
    font-size: .875rem;
    font-weight: 600;
    background: rgba(255,255,255,.07);
    border-radius: var(--sw-radius);
}

@media (max-width: 767.98px) {
    .sw-hero-mosaic { height: 250px; gap: .5rem; }
}

/* ── 11. BOTTOM MOBILE NAV ───────────────────────────────── */
.sw-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--sw-surface);
    border-top: 1px solid var(--sw-border);
    z-index: var(--z-sticky);
    box-shadow: 0 -4px 16px rgba(0,0,0,.1);
    padding: 0 .5rem;
    /* safe area for phones */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 991.98px) {
    .sw-bottom-nav { display: flex; }
    /* Push page content up to avoid bottom nav overlap */
    body { padding-bottom: 60px; }
}

.sw-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--sw-text-muted);
    font-size: .65rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: color .2s;
    cursor: pointer;
    background: none;
    border: none;
    padding: .5rem 0;
}

.sw-bottom-nav-item i {
    font-size: 1.2rem;
    transition: transform .2s;
}

.sw-bottom-nav-item.active,
.sw-bottom-nav-item:hover {
    color: var(--sw-primary);
}

.sw-bottom-nav-item.active i {
    transform: translateY(-2px);
}

.sw-bottom-nav-badge {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    min-width: 16px;
    height: 16px;
    border-radius: 99px;
    background: var(--sw-danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    border: 2px solid var(--sw-surface);
}

/* ── 12. SCROLL TO TOP ───────────────────────────────────── */
.sw-scroll-top {
    position: fixed;
    right: 1.25rem;
    bottom: 4.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sw-gradient);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--sw-shadow-green);
    transition: opacity .3s, transform .3s;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    z-index: 1055;
}

.sw-scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.sw-scroll-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(46,125,50,.45);
}

@media (max-width: 991.98px) {
    .sw-scroll-top { right: 1rem; bottom: 4.75rem; }
}

/* ── 13. SCROLL-REVEAL ANIMATION ─────────────────────────── */
.sw-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .55s cubic-bezier(.4,0,.2,1), transform .55s cubic-bezier(.4,0,.2,1);
}

.sw-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.sw-reveal-delay-1 { transition-delay: .1s; }
.sw-reveal-delay-2 { transition-delay: .2s; }
.sw-reveal-delay-3 { transition-delay: .3s; }
.sw-reveal-delay-4 { transition-delay: .4s; }

/* ── 14. ENHANCED SEARCH BAR ─────────────────────────────── */
.sw-search-wrap {
    display: flex;
    background: var(--sw-surface);
    border: 1.5px solid var(--sw-border);
    border-radius: var(--sw-radius-sm);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    min-width: 300px;
}

.sw-search-wrap:focus-within {
    border-color: var(--sw-primary);
    box-shadow: 0 0 0 3px rgba(46,125,50,.12);
}

.sw-search-wrap input {
    flex: 1;
    border: none !important;
    box-shadow: none !important;
    padding: .45rem 1rem;
    background: transparent;
    font-size: .9rem;
    color: var(--sw-text);
    outline: none;
    min-width: 0;
}

.sw-search-wrap input::placeholder { color: var(--sw-text-subtle); }

.sw-search-wrap button[type="submit"] {
    background: var(--sw-gradient);
    color: #fff;
    border: none;
    padding: .45rem 1rem;
    cursor: pointer;
    font-size: .875rem;
    transition: opacity .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sw-search-wrap button[type="submit"]:hover { opacity: .88; }

/* ── 15. HERO STAT COUNTERS ──────────────────────────────── */
.sw-hero-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,.18);
}

.sw-hero-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.sw-hero-stat-label {
    font-size: .78rem;
    color: rgba(255,255,255,.65);
    margin-top: 2px;
}

/* ── DARK MODE OVERRIDES ──────────────────────────────────── */
[data-theme="dark"] .sw-skeleton,
.dark-mode .sw-skeleton {
    background: linear-gradient(90deg,
        var(--sw-surface-2) 25%,
        rgba(255,255,255,.05) 50%,
        var(--sw-surface-2) 75%
    );
    background-size: 600px 100%;
}

[data-theme="dark"] .sw-bottom-nav,
.dark-mode .sw-bottom-nav {
    background: var(--sw-surface);
    border-top-color: var(--sw-border);
}

[data-theme="dark"] .sw-search-wrap,
.dark-mode .sw-search-wrap {
    background: var(--sw-surface-2);
}

/* Full-site polish utility components */
.sw-surface-card {
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius);
    box-shadow: var(--sw-shadow-sm);
}

.sw-section-title {
    font-size: clamp(1.2rem, 2.4vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: .35rem;
}

.sw-section-subtitle {
    font-size: .92rem;
    color: var(--sw-text-muted);
    margin-bottom: 0;
}

.sw-stack {
    display: grid;
    gap: 1rem;
}

.sw-media-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
