/*
 * UltraStore — homepage.css
 * Loaded only on front-page.php.
 *
 * Contents:
 *   1.  Hero Slider
 *   2.  Category Slider
 *   3.  Section Shared Styles
 *   4.  Featured Products
 *   5.  Text + Image
 *   6.  Banner
 *   7.  New Arrivals
 *   8.  Testimonials
 */


/* ── 1. Hero Slider ──────────────────────────────────────────────────────── */

.hero-slider {
    position: relative;
    width: 100%;
    height: clamp(400px, 60vh, 720px);
    overflow: hidden;
    background: var(--color-surface);
}

.hero-track {
    display: flex;
    height: 100%;
}

.hero-slide {
    flex: 0 0 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    transition: opacity 600ms ease;
    opacity: 0;
    pointer-events: none;
}

.hero-slide.is-active {
    opacity: 1;
    pointer-events: all;
}

.hero-slide-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-content--center { align-items: center; text-align: center; }
.hero-content--left   { align-items: flex-start; text-align: left; }
.hero-content--right  { align-items: flex-end; text-align: right; }

.hero-headline {
    font-family: var(--font-primary);
    font-size: clamp(28px, 5vw, 64px);
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
    max-width: 800px;
}

.hero-subline {
    font-size: clamp(15px, 2vw, 20px);
    color: rgba(255,255,255,.88);
    margin: 0;
    max-width: 560px;
    text-shadow: 0 1px 4px rgba(0,0,0,.25);
}

.hero-cta {
    font-size: 16px;
    padding: 14px 32px;
    margin-top: 8px;
}

/* Prev / Next */
.hero-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    border-radius: 50%;
    width: 52px; height: 52px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 150ms ease;
}

.hero-nav:hover { background: rgba(255,255,255,.28); }
.hero-prev { left: 20px; transform: translateY(-50%) rotate(180deg); }
.hero-next { right: 20px; }

/* Dots */
.hero-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    border: none; padding: 0; cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
}

.hero-dot.is-active {
    background: #fff;
    transform: scale(1.3);
}

@media (max-width: 640px) {
    .hero-slider { height: clamp(280px, 55vw, 400px); }
    .hero-nav    { width: 40px; height: 40px; }
    .hero-prev   { left: 10px; }
    .hero-next   { right: 10px; }
}


/* ── 2. Category Slider ──────────────────────────────────────────────────── */

.category-slider {
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
}

.category-slider-inner {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.category-slider-inner::-webkit-scrollbar { display: none; }

.cat-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--color-text);
    flex-shrink: 0;
    transition: color 150ms ease;
    position: relative;
}

.cat-slide::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 2px;
    background: var(--color-primary);
    transition: left 200ms ease, right 200ms ease;
}

.cat-slide:hover::after,
.cat-slide:focus-visible::after {
    left: 16px;
    right: 16px;
}

.cat-slide:hover { color: var(--color-primary); }

.cat-slide-image {
    width: 64px; height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-surface);
    flex-shrink: 0;
    border: 2px solid var(--color-border);
    transition: border-color 150ms ease;
}

.cat-slide:hover .cat-slide-image { border-color: var(--color-primary); }

.cat-slide-image img {
    width: 100%; height: 100%; object-fit: cover;
}

.cat-slide-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .cat-slide { padding: 12px 14px; }
    .cat-slide-image { width: 52px; height: 52px; }
}


/* ── 3. Section Shared ───────────────────────────────────────────────────── */

.hp-section {
    padding-block: 64px;
}

.hp-section.bg-surface  { background: var(--color-surface); }
.hp-section.bg-dark     { background: var(--color-text); color: #fff; }
.hp-section.bg-dark .hp-section-title { color: #fff; }

.hp-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.hp-section-title {
    font-family: var(--font-primary);
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: 1.15;
}

.hp-section-subtitle {
    color: var(--color-text-muted);
    margin: 0;
    font-size: var(--font-size-base);
}

.hp-section-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.hp-section-link:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .hp-section { padding-block: 40px; }
}


/* ── 5. Text + Image ─────────────────────────────────────────────────────── */

.hp-text-image .ti-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.hp-text-image.img-left .ti-grid  { direction: rtl; }
.hp-text-image.img-left .ti-text  { direction: ltr; }
.hp-text-image.img-left .ti-image { direction: ltr; }

.ti-text {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ti-body {
    color: var(--color-text-muted);
    line-height: 1.75;
    font-size: var(--font-size-base);
}

.ti-body p { margin: 0 0 12px; }
.ti-body p:last-child { margin-bottom: 0; }

.ti-image img {
    width: 100%;
    height: auto;
    border-radius: var(--product-card-radius);
    display: block;
}

@media (max-width: 768px) {
    .hp-text-image .ti-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        direction: ltr !important;
    }
}


/* ── 6. Banner ───────────────────────────────────────────────────────────── */

.hp-banner.banner-style-full  { padding: 0; }
.hp-banner.banner-style-full  .container { max-width: 100%; padding: 0; }

.banner-inner {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
}

.banner-style-contained .banner-inner {
    border-radius: var(--product-card-radius);
    overflow: hidden;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: #000;
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.banner-headline {
    font-family: var(--font-primary);
    font-size: clamp(24px, 4vw, 48px);
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.banner-subline {
    color: rgba(255,255,255,.85);
    font-size: clamp(15px, 2vw, 18px);
    margin: 0;
    max-width: 540px;
}

@media (max-width: 640px) {
    .banner-inner { min-height: 200px; }
}


/* ── 8. Testimonials ─────────────────────────────────────────────────────── */

.hp-testimonials { background: var(--color-surface); }

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) { .testimonials-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .testimonials-grid { grid-template-columns: 1fr; } }

.testimonial-card {
    background: var(--color-background);
    border-radius: var(--product-card-radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--product-card-shadow);
}

.testimonial-stars { display: flex; gap: 2px; }

.star { font-size: 16px; color: var(--color-border); }
.star.is-filled { color: var(--color-rating); }

.testimonial-text {
    flex: 1;
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    line-height: 1.7;
}

.testimonial-text p { margin: 0; }

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.testimonial-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.testimonial-avatar-placeholder {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.testimonial-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.testimonial-name    { font-size: var(--font-size-sm); font-weight: 700; color: var(--color-text); }
.testimonial-product { font-size: 12px; color: var(--color-text-muted); }
