/* Homepage Modern Redesign - Amazon Style */

.hero-banner {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Homepage category blocks: 4 blocks per row on desktop (16 products), 1 block per row on mobile */
#homepageBlocksContainer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-block-slot-empty {
    min-height: 0;
    visibility: hidden;
    pointer-events: none;
}

.category-block-card {
    background: var(--white);
    border-radius: 12px;
    padding: 0.75rem;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    min-width: 0;
}

.category-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.category-block-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.25;
    margin: 0;
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

.category-block-header .see-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.45rem 0.75rem;
    background: var(--primary);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 8px;
    border: 1px solid var(--primary-dark, #e1550c);
    box-shadow: 0 2px 6px rgba(251, 100, 27, 0.35);
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.category-block-header .see-more-btn:hover {
    background: var(--primary-dark, #e1550c);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(251, 100, 27, 0.45);
}

.category-block-header .see-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(251, 100, 27, 0.3);
}

.category-block-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.homepage-block-product {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.homepage-block-product:hover {
    transform: scale(1.02);
}

.homepage-block-product .discount-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    font-size: 0.6rem;
    padding: 2px 5px;
}

.homepage-block-product-img {
    position: relative;
    padding-top: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: #f9fafb;
}

.homepage-block-product-img picture,
.homepage-block-product-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.homepage-block-product-meta {
    margin-top: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.homepage-block-product-name {
    font-size: 0.72rem;
    font-weight: 500;
    color: #4b5563;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

.homepage-block-product-price {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.section-container {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    color: var(--text-main);
}

.see-more {
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Horizontal Scroll for Sections on Desktop */
.product-row-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.product-row-scroll::-webkit-scrollbar {
    height: 6px;
}

.product-row-scroll::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.product-row-scroll .product-card {
    min-width: 220px;
    flex: 0 0 auto;
}

/* Redefined Product Card for Redesign */
.product-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

.product-price-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.add-to-cart-btn {
    width: 100%;
    background: #FFD814;
    border: 1px solid #FCD200;
    padding: 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.add-to-cart-btn:hover {
    background: #F7CA00;
}

@media (min-width: 769px) and (max-width: 1199px) {
    #homepageBlocksContainer {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .category-block-slot-empty {
        display: none;
    }

    #homepageBlocksContainer {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .category-block-card {
        padding: 1rem;
    }

    .category-block-title {
        font-size: 1.35rem;
    }

    .category-block-header .see-more-btn {
        padding: 0.55rem 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .category-block-products {
        gap: 0.65rem;
    }

    .homepage-block-product-name {
        font-size: 0.82rem;
    }

    .homepage-block-product-price {
        font-size: 0.85rem;
    }

    .hero-banner {
        height: 180px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .product-row-scroll {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        overflow-x: visible;
    }

    .product-row-scroll .product-card {
        min-width: 0;
    }
}