/**
 * HOMEPAGE UX IMPROVEMENTS
 * Brutalist design with organized layout
 * Uses unified spacing system from brutalist.css
 */

/* ========================================
   HOMEPAGE-SPECIFIC VARIABLES
   ======================================== */
:root {
    /* Border system (homepage-specific variations) */
    --border-thin: 2px;
    --border-medium: 3px;
    --border-thick: 4px;
    --border-chunky: 5px;
}

/* ========================================
   SECTION STRUCTURE
   ======================================== */
.products-section {
    padding: var(--space-8) 0;
    border-bottom: var(--border-chunky) solid var(--black);
    background: var(--white);
}

/* Remove bottom border from last section */
.products-section:last-of-type {
    border-bottom: none;
}

/* Alternating section backgrounds for visual rhythm */
.featured-products-section {
    background: var(--white);
}

.featured-services-section {
    background: #fafafa;
}

.featured-brands-section {
    background: var(--white);
    padding: var(--space-8) 0;
}

/* ========================================
   SECTION HEADER (improved hierarchy)
   ======================================== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-2);
    border-bottom: var(--border-thick) solid var(--black);
}

.section-title {
    font-size: clamp(30px, 2.8vw, 42px);
    font-weight: bold;
    letter-spacing: clamp(2px, 0.4vw, 4px);
    margin-bottom: var(--space-1);
    line-height: 1.1;
    text-transform: uppercase;
}

.section-subtitle {
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--black);
    opacity: 0.7;
    text-transform: uppercase;
    margin: 0;
}

/* ========================================
   SECTION CTA (call to action)
   ======================================== */
.section-cta {
    text-align: center;
    margin-top: var(--space-8);
    padding-top: var(--space-5);
}

/* ========================================
   PRODUCT GRID (consistent spacing)
   ======================================== */
.product-grid.five-column {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-3);
    margin-bottom: 0;
}

/* Animation utility */
@keyframes fadeUp {
    from {
        transform: translateY(12px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   HERO SECTION (refined)
   ======================================== */
.hero-section {
    min-height: auto;
    position: relative;
    border-bottom: var(--border-chunky) solid var(--black);
    padding: var(--space-7) 0 var(--space-8);
    background: radial-gradient(circle at 20% 20%, #ffffff 0%, #f7f7f7 35%, #f0f0f0 70%);
    overflow: hidden;
}

.hero-shell {
    max-width: var(--shell-max-width);
    margin: 0 auto;
    padding: 0 var(--shell-gutter);
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(280px, 0.95fr);
    align-items: center;
    gap: var(--space-6);
}

.hero-copy {
    display: grid;
    gap: var(--space-3);
    animation: fadeUp 0.6s ease forwards;
}

.hero-kicker {
    font-size: 11px;
    letter-spacing: 3px;
    font-weight: 800;
    margin: 0;
    color: var(--black);
}

.hero-kicker-city {
    display: inline-block;
}


.hero-title {
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.05;
    letter-spacing: -1px;
    margin: 0;
    text-transform: uppercase;
}

.hero-title span {
    display: inline-block;
    padding: 6px 10px;
    border: var(--border-medium) solid var(--black);
    background: var(--white);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: 0.5px;
    max-width: 540px;
    margin: 0;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
}

/* GIF Slider */
.gif-slider-container {
    position: relative;
    border: var(--border-thick) solid var(--black);
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 700px;
    justify-self: start;
    margin-left: clamp(-32px, -4vw, -12px);
    aspect-ratio: 16 / 9;
    background: #000; /* Fallback */
}

.gif-slider {
    display: block;
    width: 100%;
    height: 100%;
}

.gif-slide {
    height: 100%;
    width: 100%;
    display: block;
    opacity: 1;
    position: absolute;
    top: 0;
    left: 0;
}

/* Ensure only the active one is on top if we ever have multiples, 
   but display:block for all ensures the first one (static) is seen */
.gif-slide.active {
    z-index: 2;
}

.gif-slide video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    visibility: visible;
}

.slider-controls {
    display: none; /* Hidden since we removed slider logic */
}

.service-placeholder {
    border: var(--border-thick) solid var(--black);
    background: var(--white);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    position: relative;
    overflow: hidden;
}

.service-placeholder::after {
    content: 'COMING SOON';
    position: absolute;
    right: -32px;
    top: 12px;
    transform: rotate(8deg);
    padding: 6px 14px;
    border: var(--border-thin) dashed var(--black);
    background: #fff7cc;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.service-placeholder-title {
    font-size: 16px;
    letter-spacing: 1.5px;
    margin: 0;
}

.service-placeholder-meta {
    font-size: 11px;
    letter-spacing: 1px;
    margin: 0;
    opacity: 0.7;
}

/* Animation utility */
@keyframes fadeUp {
    from {
        transform: translateY(12px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   BRAND GRID
   ======================================== */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-7);
}

.brand-card {
    aspect-ratio: 16 / 9;
    border: var(--border-thick) solid var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: var(--white);
    transition: all 0.2s ease;
}

.brand-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--black);
}

/* ========================================
   PRODUCT CARD IMPROVEMENTS
   ======================================== */
/* Override brutalist.css with organized spacing */
.product-info {
    padding: 12px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.product-name {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 0;
    line-height: 1.3;
    max-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    position: relative;
}

/* Smaller font for homepage product cards to prevent wrapping */
.featured-products-section .product-name,
.featured-services-section .product-name {
    font-size: 12px;
    letter-spacing: 0.8px;
}

/* Marquee animation support - matches brutalist.css */
.product-name.marquee {
    display: block;
    white-space: nowrap;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

.product-name.marquee span {
    display: inline-block;
    animation: none;
    will-change: transform;
}

.product-name.marquee span::after {
    content: attr(data-text);
    padding-left: 2em;
}

.product-name.marquee.animate-once span {
    animation: marquee-card-seamless 8s linear 1;
}

.product-card:hover .product-name.marquee span {
    animation: marquee-card-seamless 8s linear infinite;
}

.product-vendor {
    font-size: 11px;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    opacity: 0.8;
    line-height: 1.3;
    max-height: 1.3em;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* Stock info for vendor cards */
.product-stock {
    font-size: 10px;
    letter-spacing: 0.5px;
    margin-top: 4px;
    opacity: 0.7;
}

/* Variation badge styling */
.variation-badge {
    display: inline-block;
    margin-bottom: var(--space-1);
}

.variation-badge-text {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 4px 8px;
    border: var(--border-thin) solid var(--black);
    background-color: var(--white);
    color: var(--black);
}

/* Price stack improvements */
.product-price-stack {
    margin-top: auto;
    padding-top: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.price-current {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.price-original {
    font-size: 12px;
    white-space: nowrap;
}

.price-badge {
    padding: 2px 8px;
    font-size: 10px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1.2;
}

/* Product CTA grid with consistent spacing */
.product-cta {
    margin-top: auto;
    min-height: 44px;
    height: 44px;
    flex-shrink: 0;
}

.product-card .product-cta-item {
    padding: 8px 12px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    white-space: nowrap;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* TABLET (1024px and below) */
@media (max-width: 1024px) {
    .section-title {
        font-size: 36px;
        letter-spacing: 3px;
    }

    .hero-shell {
        grid-template-columns: 1fr;
    }

    .gif-slider-container {
        margin-left: -12px;
        max-width: 620px;
    }

    .product-grid.five-column {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-3);
    }

    .brand-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-3);
    }

    .product-card {
        min-height: 360px;
    }

    .product-name {
        font-size: 13px;
        letter-spacing: 0.8px;
    }

    .product-vendor {
        font-size: 10px;
    }

    .price-current {
        font-size: 15px;
    }
}

/* MOBILE (768px and below) */
@media (max-width: 768px) {
    .products-section {
        padding: var(--space-7) 0;
    }

    .section-header {
        margin-bottom: var(--space-4);
        padding-bottom: var(--space-3);
    }

    .section-title {
        font-size: 28px;
        letter-spacing: 2px;
        margin-bottom: var(--space-1);
    }

    .section-subtitle {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .section-cta {
        margin-top: var(--space-4);
        padding-top: var(--space-3);
    }

    .hero-section {
        padding: var(--space-6) 0 var(--space-7);
    }

    .hero-shell {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .gif-slider-container {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        aspect-ratio: 16 / 9;
    }

    .product-grid.five-column {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .btn-large,
    .btn-secondary-large {
        padding: var(--space-1) var(--space-4);
        font-size: 13px;
        letter-spacing: 2px;
    }

    .brand-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    /* Product card mobile optimization */
    .product-card {
        min-height: 340px;
    }

    .product-image {
        height: 180px;
        min-height: 180px;
    }

    .product-info {
        padding: 10px 10px 6px;
        gap: 5px;
    }

    .product-name {
        font-size: 12px;
        letter-spacing: 0.8px;
        line-height: 1.3;
        max-height: 2.6em;
    }

    .product-vendor {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    .product-stock {
        font-size: 9px;
    }

    .price-current {
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .price-original {
        font-size: 11px;
    }

    .price-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .variation-badge-text {
        font-size: 8px;
        padding: 3px 6px;
    }

    .product-cta {
        min-height: 40px;
        height: 40px;
    }

    .product-card .product-cta-item {
        padding: 6px 8px !important;
        font-size: 9px !important;
        letter-spacing: 0.8px !important;
    }
}

/* SMALL MOBILE (480px and below) */
@media (max-width: 480px) {
    .section-title {
        font-size: 22px;
        letter-spacing: 1.5px;
    }

    .section-subtitle {
        font-size: 9px;
        letter-spacing: 1px;
    }

    .product-grid.five-column {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .btn-large,
    .btn-secondary-large {
        width: 100%;
        padding: var(--space-1) var(--space-3);
        font-size: 11px;
    }

    .brand-grid {
        grid-template-columns: 1fr;
    }

    /* Extra compact product cards for small screens */
    .product-card {
        min-height: 320px;
    }

    .product-image {
        height: 160px;
        min-height: 160px;
    }

    .product-info {
        padding: 8px 8px 6px;
        gap: 4px;
    }

    .product-name {
        font-size: 11px;
        letter-spacing: 0.5px;
        line-height: 1.3;
        max-height: 2.6em;
    }

    .product-vendor {
        font-size: 8px;
        letter-spacing: 0.3px;
    }

    .product-stock {
        font-size: 8px;
    }

    .price-current {
        font-size: 12px;
        letter-spacing: 0.3px;
    }

    .price-original {
        font-size: 9px;
    }

    .price-badge {
        font-size: 8px;
        padding: 2px 5px;
    }

    .variation-badge-text {
        font-size: 7px;
        padding: 2px 5px;
    }

    .product-cta {
        min-height: 38px;
        height: 38px;
    }

    .product-card .product-cta-item {
        padding: 6px 6px !important;
        font-size: 8px !important;
        letter-spacing: 0.5px !important;
    }
}

/* ========================================
   SEARCH FIXES
   ======================================== */
@media (max-width: 1200px) {
    .nav-search {
        flex-basis: 240px;
        max-width: 240px;
    }
    .search-dropdown {
        width: min(400px, 90vw);
    }
}