/* static/css/pages/home.css */
/* ====================================================
   HOME PAGE SPECIFIC STYLES
   Extends main.css – uses CSS variables from :root
   ==================================================== */

/* ====================================================
   HERO SECTION – Compact (25% viewport height)
   ==================================================== */
.hero {
    min-height: 25vh;
    display: flex;
    align-items: center;
    background: var(--white);
    padding: 1.5rem 0;
    position: relative;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    width: 100%;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-charcoal);
    margin: 0;
}

.hero-highlight {
    color: var(--primary-blue);
    position: relative;
}

.hero-highlight::after {
    content: '';
    position: absolute;
    bottom: 0.05rem;
    left: 0;
    width: 100%;
    height: 0.2rem;
    background: var(--primary-green);
    border-radius: 0.125rem;
}

.hero-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--dark-charcoal);
    opacity: 0.8;
    line-height: 1.5;
    margin: 0;
    max-width: 550px;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.hero-actions .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    /* No order property – image stays in natural grid order */
}

.hero-img {
    max-width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: contain;
}

/* ====================================================
   NEW ARRIVALS (SCROLLING)
   ==================================================== */
.new-arrivals {
    padding: 2rem 0;
    background: var(--white);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-charcoal);
    margin: 0;
}

.section-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--dark-charcoal);
    opacity: 0.7;
    margin: 0.15rem 0 0 0;
}

/* New Arrivals header – center title and subtitle on desktop */
.new-arrivals .section-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
}

.view-all {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.view-all:hover {
    color: var(--bright-blue);
    text-decoration: underline;
}

.scroll-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.scroll-track {
    display: flex;
    gap: 1.25rem;
    width: max-content;
    animation: scrollRightToLeft 30s linear infinite;
    will-change: transform;
}

.scroll-item {
    flex: 0 0 180px;
    width: 180px;
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.scroll-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-blue);
}

.scroll-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.scroll-image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--light-blue-bg);
    overflow: hidden;
}

.scroll-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.scroll-item:hover .scroll-image img {
    transform: scale(1.05);
}

.scroll-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--light-gray);
    color: var(--dark-charcoal);
}

.scroll-badge.out-of-stock {
    background: #FEE2E2;
    color: #991B1B;
}

.scroll-badge.low-stock {
    background: #FEF3C7;
    color: #92400E;
}

.scroll-info {
    padding: 0.5rem 0.75rem;
}

.scroll-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--dark-charcoal);
    margin: 0 0 0.15rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scroll-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-green);
}

/* ====================================================
   FEATURED CATEGORIES
   ==================================================== */
.featured-category {
    padding: 2rem 0;
    border-top: 1px solid var(--light-gray);
}

.featured-category:first-of-type {
    border-top: none;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 0.75rem;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-blue);
}

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--light-blue-bg);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.75rem;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--light-gray);
    color: var(--dark-charcoal);
}

.product-badge.out-of-stock {
    background: #FEE2E2;
    color: #991B1B;
}

.product-badge.low-stock {
    background: #FEF3C7;
    color: #92400E;
}

.product-info {
    padding: 0.5rem 0.75rem 0.75rem;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-charcoal);
    margin: 0 0 0.35rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4rem;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.product-stock {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
}

.product-stock.in-stock {
    color: var(--dark-green);
    background: var(--light-green-bg);
}

.product-stock.out-of-stock-text {
    color: #991B1B;
    background: #FEE2E2;
}

.add-to-cart-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ====================================================
   CTA SECTION
   ==================================================== */
.cta-section {
    padding: 2.5rem 0;
    background: var(--light-blue-bg);
    margin-top: 1.5rem;
}

.cta-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--dark-charcoal);
    margin: 0 0 0.5rem 0;
}

.cta-text {
    font-size: 1rem;
    color: var(--dark-charcoal);
    opacity: 0.8;
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

/* ====================================================
   RESPONSIVE BREAKPOINTS
   ==================================================== */

/* Tablets and small laptops */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 1.8rem;
    }
    .hero-subtitle {
        font-size: 0.95rem;
    }
    .hero-img {
        max-height: 130px;
    }
    .scroll-item {
        flex: 0 0 160px;
        width: 160px;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

/* Tablets (portrait) and large phones */
@media (max-width: 768px) {
    .hero {
        min-height: 20vh;
        padding: 1rem 0;
    }
    
    .hero-container {
        grid-template-columns: 1fr;  /* single column – text first, image second */
        gap: 1rem;
        text-align: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    /* Image comes after text – no order property */
    .hero-image {
        margin-top: 0.5rem;  /* small spacing above image */
    }
    
    .hero-img {
        max-height: 100px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        max-width: 100%;
    }
    
    .hero-highlight::after {
        bottom: 0;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .scroll-item {
        flex: 0 0 140px;
        width: 140px;
    }
    
    .cta-title {
        font-size: 1.3rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hero {
        min-height: 18vh;
        padding: 0.75rem 0;
    }
    
    .hero-title {
        font-size: 1.3rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .hero-actions {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .hero-actions .btn {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
        flex: 1;
    }
    
    .hero-img {
        max-height: 80px;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.5rem;
    }
    
    .product-name {
        font-size: 0.8rem;
        min-height: 2rem;
    }
    
    .product-price {
        font-size: 0.85rem;
    }
    
    .scroll-item {
        flex: 0 0 120px;
        width: 120px;
    }
    
    .scroll-name {
        font-size: 0.7rem;
    }
    
    .scroll-price {
        font-size: 0.85rem;
    }
    
    .cta-title {
        font-size: 1.1rem;
    }
    
    .cta-text {
        font-size: 0.9rem;
    }
    
    .cta-section {
        padding: 1.5rem 0;
    }
}

/* Animation keyframes */
@keyframes scrollRightToLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ====================================================
   BANNER CAROUSEL – Clean & Balanced Layout
   ==================================================== */
.banner-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--white);
    min-height: 30vh;
    display: flex;
    align-items: center;
    padding: 1.5rem 0;
}

.carousel-track-wrapper {
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 0.5rem 1rem;
    min-height: 25vh;
}

/* Content first (left side) */
.carousel-content {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    justify-content: center;
    padding-right: 1rem;
}

.carousel-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--dark-charcoal);
    margin: 0;
    line-height: 1.2;
}

.carousel-description {
    font-size: 1.05rem;
    color: var(--dark-charcoal);
    opacity: 0.8;
    margin: 0;
    line-height: 1.5;
    max-width: 90%;
}

.carousel-offer {
    display: inline-block;
    background: var(--primary-green);
    color: var(--white);
    padding: 0.25rem 1.2rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    align-self: flex-start;
    margin-top: 0.1rem;
}

.carousel-cta {
    align-self: flex-start;
    margin-top: 0.3rem;
    padding: 0.6rem 2rem;
    font-size: 1rem;
}

/* Image second (right side) */
.carousel-image {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 1rem;
}

.carousel-image img {
    max-width: 100%;
    max-height: 220px;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
}

/* Carousel Controls */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: var(--white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, opacity 0.3s ease;
    z-index: 10;
    opacity: 0.7;
}

.carousel-btn:hover {
    background: rgba(0, 59, 128, 0.8);
    opacity: 1;
}

.carousel-prev {
    left: 0.5rem;
}
.carousel-next {
    right: 0.5rem;
}

/* Carousel Dots */
.carousel-dots {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dot.active {
    background: var(--primary-blue);
    transform: scale(1.25);
}

.carousel-dot:hover {
    background: var(--primary-blue);
}

/* ====================================================
   RESPONSIVE – Carousel (Tablets & Mobile)
   ==================================================== */
@media (max-width: 992px) {
    .carousel-slide {
        gap: 2rem;
        padding: 0.5rem 0.5rem;
        min-height: 22vh;
    }
    .carousel-title {
        font-size: 2rem;
    }
    .carousel-description {
        font-size: 0.95rem;
        max-width: 100%;
    }
    .carousel-image img {
        max-height: 170px;
    }
}

@media (max-width: 768px) {
    .banner-carousel {
        min-height: 20vh;
        padding: 1rem 0;
    }

    .carousel-slide {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        text-align: center;
        padding: 0.5rem 0.5rem 1.5rem;
        min-height: 18vh;
    }

    /* Text/Content comes FIRST on mobile */
    .carousel-content {
        order: 0;
        padding-right: 0;
        align-items: center;
        gap: 0.4rem;
    }

    .carousel-title {
        font-size: 1.6rem;
    }

    .carousel-description {
        font-size: 0.9rem;
        max-width: 100%;
    }

    .carousel-offer {
        align-self: center;
    }

    .carousel-cta {
        align-self: center;
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Image comes LAST on mobile */
    .carousel-image {
        order: 1;
        padding-left: 0;
    }

    .carousel-image img {
        max-height: 110px;
    }

    .carousel-btn {
        width: 34px;
        height: 34px;
        font-size: 1.4rem;
    }
    .carousel-prev {
        left: 0.25rem;
    }
    .carousel-next {
        right: 0.25rem;
    }
}

@media (max-width: 480px) {
    .banner-carousel {
        min-height: 16vh;
        padding: 0.5rem 0;
    }

    .carousel-slide {
        min-height: 16vh;
        padding: 0.25rem 0.25rem 1.5rem;
        gap: 0.5rem;
    }

    .carousel-title {
        font-size: 1.2rem;
    }

    .carousel-description {
        font-size: 0.8rem;
    }

    .carousel-offer {
        font-size: 0.75rem;
        padding: 0.15rem 0.8rem;
    }

    .carousel-cta {
        font-size: 0.8rem;
        padding: 0.35rem 1rem;
    }

    .carousel-image img {
        max-height: 80px;
    }

    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }
    .carousel-dot {
        width: 8px;
        height: 8px;
    }
}