/**
 * Rid'Air — V5 "Editorial Altitude" Global Styles
 * Token-driven component styles for ALL pages (not just homepage).
 * Works with both dark (default) and light themes via CSS custom properties.
 * Loaded unconditionally in <head> alongside dark-mode.css.
 */

/* ═══ V5 THEME TOKENS (global) ═══ */
:root {
    --v5-primary: #19a4b0;
    --v5-primary-h: #148890;
    --v5-accent: #FF6B35;
    --v5-accent-h: #e55a2b;
    --v5-navy: #2e6488;

    /* Surfaces — dark default */
    --v5-bg: #0a0f1a;
    --v5-bg2: #111827;
    --v5-bg3: #1a2236;
    --v5-fg: #f0f4f8;
    --v5-fg2: #94a3b8;
    --v5-fg3: #64748b;
    --v5-border: rgba(148,163,184,.12);
}
[data-theme="light"] {
    --v5-bg: #f8fafc;
    --v5-bg2: #ffffff;
    --v5-bg3: #f1f5f9;
    --v5-fg: #0f172a;
    --v5-fg2: #475569;
    --v5-fg3: #94a3b8;
    --v5-border: rgba(15,23,42,.08);
}

/* ═══ CATEGORY HERO BANNER ═══ */
.v5-cat-hero {
    position: relative;
    overflow: hidden;
    padding: 8rem 0 3.5rem;
    min-height: 300px;
    display: flex;
    align-items: flex-end;
}
@media (min-width: 768px) {
    .v5-cat-hero {
        min-height: 380px;
        padding: 10rem 0 3.5rem;
    }
}
.v5-cat-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.v5-cat-hero__bg picture {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}
.v5-cat-hero__bg img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.v5-cat-hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--v5-bg) 0%, rgba(10,15,26,.55) 40%, rgba(10,15,26,.3) 100%);
}
[data-theme="light"] .v5-cat-hero__bg::after {
    background: linear-gradient(to top, var(--v5-bg) 0%, rgba(248,250,252,.55) 40%, rgba(248,250,252,.25) 100%);
}
/* Fallback gradient when no image */
.v5-cat-hero--gradient .v5-cat-hero__bg {
    background: linear-gradient(135deg, #0c2340 0%, #0f636a 50%, #14838d 80%, #1a4d5a 100%);
}
.v5-cat-hero--gradient .v5-cat-hero__bg::after {
    background: linear-gradient(to top, var(--v5-bg) 0%, transparent 100%);
}
[data-theme="light"] .v5-cat-hero--gradient .v5-cat-hero__bg {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2dfdb 50%, #80cbc4 80%, #4db6ac 100%);
}
.v5-cat-hero__content {
    position: relative;
    z-index: 2;
}
.v5-cat-hero h1 {
    font-size: clamp(2.25rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.03em;
    color: var(--v5-fg);
}
.v5-cat-hero__desc {
    margin-top: .75rem;
    font-size: clamp(.875rem, 1.5vw, 1.0625rem);
    color: var(--v5-fg2);
    max-width: 560px;
    line-height: 1.6;
}
.v5-cat-hero__count {
    margin-top: .75rem;
    font-size: .8125rem;
    color: var(--v5-fg3);
}

/* ═══ V5 BREADCRUMB (inside hero) ═══ */
.v5-breadcrumb {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .75rem;
    color: var(--v5-fg3);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.v5-breadcrumb a {
    color: var(--v5-fg3);
    transition: color .15s;
}
.v5-breadcrumb a:hover {
    color: var(--v5-primary);
}
.v5-breadcrumb svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: .5;
}
.v5-breadcrumb__current {
    color: var(--v5-fg);
    font-weight: 500;
}

/* ═══ V5 SUBCATEGORY CHIPS ═══ */
.v5-chips-bar {
    border-bottom: 1px solid var(--v5-border);
}
.v5-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 1.25rem 0;
}
.v5-chip {
    padding: .5rem 1rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid var(--v5-border);
    color: var(--v5-fg2);
    transition: all .2s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}
.v5-chip:hover {
    border-color: var(--v5-primary);
    color: var(--v5-primary);
    background: rgba(25,164,176,.06);
}
.v5-chip--active {
    background: var(--v5-primary);
    color: #fff !important;
    border-color: var(--v5-primary);
}
.v5-chip__count {
    font-size: .625rem;
    opacity: .5;
}

/* ═══ V5 TOOLBAR ═══ */
.v5-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--v5-border);
}
.v5-toolbar__count {
    font-size: .8125rem;
    color: var(--v5-fg3);
}
.v5-toolbar__actions {
    display: flex;
    align-items: center;
    gap: .625rem;
}
.v5-select {
    appearance: none;
    background: var(--v5-bg2);
    border: 1px solid var(--v5-border);
    color: var(--v5-fg2);
    padding: .5rem 2rem .5rem .75rem;
    border-radius: .5rem;
    font-size: .75rem;
    font-weight: 550;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .5rem center;
    background-size: 1rem;
    transition: border-color .2s;
}
.v5-select:focus {
    outline: none;
    border-color: var(--v5-primary);
}

/* ═══ V5 PRODUCT GRID ═══ */
.v5-pgrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 2rem 0;
}
@media (min-width: 768px) {
    .v5-pgrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}
@media (min-width: 1024px) {
    .v5-pgrid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

/* ═══ V5 PRODUCT CARD (enhance existing .product-card) ═══ */
.v5-pgrid .product-card {
    background: var(--v5-bg2);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--v5-border);
    transition: all .3s;
    position: relative;
}
.v5-pgrid .product-card:hover {
    border-color: rgba(25,164,176,.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
[data-theme="light"] .v5-pgrid .product-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,.06);
}
.v5-pgrid .product-card__image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--v5-bg3) !important;
    position: relative;
}
.v5-pgrid .product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .75rem;
    transition: transform .5s;
}
.v5-pgrid .product-card:hover .product-card__image img {
    transform: scale(1.05);
}
/* V5 Badge style */
.v5-pgrid .product-card .absolute.top-3 span {
    border-radius: 9999px;
    padding: .25rem .625rem;
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
/* V5 Card body */
.v5-pgrid .product-card__info {
    padding: 1rem 1.25rem 1.25rem;
}
.v5-pgrid .product-card__brand {
    font-size: .6875rem;
    font-weight: 700;
    color: var(--v5-primary);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.v5-pgrid .product-card__name {
    font-size: .875rem;
    font-weight: 600;
    margin-top: .25rem;
    line-height: 1.3;
    color: var(--v5-fg);
}
.v5-pgrid .product-card__price--current {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--v5-fg);
}
.v5-pgrid .product-card__price--old {
    font-size: .8125rem;
    color: var(--v5-fg3);
}
.v5-pgrid .product-card__price--promo {
    color: var(--v5-accent) !important;
}
/* Quick add button — V5 style */
.v5-pgrid .product-card__add-cart {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--v5-bg3);
    border: 1px solid var(--v5-border);
    color: var(--v5-fg2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: all .3s;
}
.v5-pgrid .product-card:hover .product-card__add-cart {
    opacity: 1;
    transform: translateY(0);
}
.v5-pgrid .product-card__add-cart:hover {
    background: var(--v5-primary);
    color: #fff;
    border-color: var(--v5-primary);
}

/* ═══ V5 PAGINATION ═══ */
.v5-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: 2rem 0;
    flex-wrap: wrap;
}
.v5-pagination a,
.v5-pagination span:not(.v5-pagination__info) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .5rem;
    border-radius: .5rem;
    font-size: .8125rem;
    font-weight: 550;
    border: 1px solid var(--v5-border);
    color: var(--v5-fg2);
    transition: all .15s;
    text-decoration: none;
}
.v5-pagination a:hover {
    border-color: var(--v5-primary);
    color: var(--v5-primary);
}
.v5-pagination .v5-page-active {
    background: var(--v5-primary);
    color: #fff;
    border-color: var(--v5-primary);
}
.v5-pagination .v5-page-dots {
    border: none;
    color: var(--v5-fg3);
}
.v5-pagination__info {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: .75rem;
    font-size: .75rem;
    color: var(--v5-fg3);
}

/* ═══ V5 FAQ SECTION ═══ */
.v5-faq {
    padding: 3rem 0 4rem;
    background: var(--v5-bg2);
    border-top: 1px solid var(--v5-border);
}
.v5-faq__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--v5-fg);
    text-align: center;
    margin-bottom: 2rem;
}
.v5-faq details {
    background: var(--v5-bg3);
    border-radius: .75rem;
    border: 1px solid var(--v5-border);
    overflow: hidden;
    margin-bottom: .75rem;
}
.v5-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--v5-fg);
    transition: color .15s;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.v5-faq summary:hover {
    color: var(--v5-primary);
}
.v5-faq summary svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--v5-fg3);
    flex-shrink: 0;
    transition: transform .3s;
}
.v5-faq details[open] summary svg {
    transform: rotate(180deg);
}
.v5-faq .v5-faq__answer {
    padding: 0 1.5rem 1.25rem;
    color: var(--v5-fg2);
    line-height: 1.7;
    font-size: .9375rem;
}

/* ═══ V5 SEO INTERNAL LINKS ═══ */
.v5-seo-links {
    border-top: 1px solid var(--v5-border);
    padding: 2.5rem 0 3rem;
    background-color: var(--v5-bg2);
    background-image: linear-gradient(180deg, var(--v5-bg2) 0%, color-mix(in srgb, var(--v5-bg2) 78%, var(--v5-bg3) 22%) 100%);
    color: var(--v5-fg3);
}
.v5-seo-links__title {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 700;
    color: var(--v5-fg);
    margin-bottom: 1.75rem;
}
.v5-seo-links__grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 2rem;
}
.v5-seo-links__column {
    min-width: 0;
}
.v5-seo-links__heading {
    margin-bottom: .875rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--v5-primary);
}
.v5-seo-links__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .65rem;
}
.v5-seo-links__link,
.v5-seo-links__brand-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--v5-fg2);
    text-decoration: none;
    transition: color .15s ease, transform .15s ease;
}
.v5-seo-links__link:hover,
.v5-seo-links__brand-link:hover {
    color: var(--v5-primary);
    transform: translateX(2px);
}
.v5-seo-links__icon {
    width: .95rem;
    height: .95rem;
    flex-shrink: 0;
    color: var(--v5-primary);
}
.v5-seo-links__brand-link {
    margin-top: 1rem;
    font-size: .95rem;
    font-weight: 600;
}
.v5-seo-links__brand-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .v5-seo-links__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ═══ V5 EMPTY STATE ═══ */
.v5-empty {
    text-align: center;
    padding: 5rem 0;
}
.v5-empty__icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--v5-bg3);
    color: var(--v5-fg3);
}
.v5-empty__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--v5-fg);
    margin-bottom: .75rem;
}
.v5-empty__text {
    color: var(--v5-fg2);
}
.v5-empty__text a {
    color: var(--v5-primary);
    font-weight: 500;
}
.v5-empty__text a:hover {
    text-decoration: underline;
}

/* ═══ V5 REVEAL ANIMATIONS ═══ */
.v5-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
}
.v5-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.v5-reveal-d1 { transition-delay: .1s; }
.v5-reveal-d2 { transition-delay: .2s; }
.v5-reveal-d3 { transition-delay: .3s; }
.v5-reveal-d4 { transition-delay: .4s; }

/* ═══ V5 THEME TOGGLE (header) ═══ */
.v5-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .75rem;
    color: var(--v5-fg2);
    cursor: pointer;
    border: none;
    background: none;
    transition: all .15s;
    position: relative;
}
.v5-theme-toggle:hover {
    color: var(--v5-primary);
    background: rgba(25,164,176,.08);
}
.v5-theme-toggle svg {
    width: 20px;
    height: 20px;
}
/* Sun/Moon visibility */
.v5-theme-toggle .v5-icon-sun { display: none; }
.v5-theme-toggle .v5-icon-moon { display: block; }
[data-theme="dark"] .v5-theme-toggle .v5-icon-sun { display: block; }
[data-theme="dark"] .v5-theme-toggle .v5-icon-moon { display: none; }

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
    .v5-reveal { opacity: 1; transform: none; transition: none; }
    .v5-pgrid .product-card { transition: none; }
    .v5-pgrid .product-card__image img { transition: none; }
}
