/* ========== GENERAL SECTION SPACING - START ========== */
.custom-homepage section {
    padding: 34px 0;
}

/* Add margin-top: 0 to all h2 elements in the custom homepage */
.custom-homepage h2 {
    margin: 0 0 12px;
}

@media (min-width: 767px) {
    .custom-homepage section {
        padding: 45px 0;
    }
}


/* Hero slider section has no default padding since it's handled by the hero slider element */
section.hero-slider-section {
    padding: 0;
}
/* ========== GENERAL SECTION SPACING - END ========== */

/* ========== HEADER BANNER ROW - START ========== */
.custom-homepage .homepage-banner-row {
    padding: 0;
    margin: 0;
}

.custom-homepage .homepage-hero-wrap {
    margin: 20px 0 16px;
}

.homepage-banner-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.homepage-banner-card {
    position: relative;
    display: block;
    border-radius: calc(var(--border-radius) + 4px);
    overflow: hidden;
    min-height: 240px;
    background: var(--surface-3);
    border: none;
    box-shadow: var(--box-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.homepage-banner-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.homepage-banner-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(var(--brand-primary-rgb), 0.04) 0%, rgba(var(--brand-primary-rgb), 0.66) 100%);
}

.homepage-banner-label {
    position: absolute;
    left: 20px;
    bottom: 18px;
    z-index: 1;
    color: var(--white);
    font-weight: 800;
    text-shadow: var(--text-shadow);
    letter-spacing: 0.02em;
}

.homepage-banner-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-hover);
}

.homepage-banner-card:focus-visible {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
}

@media (max-width: 900px) {
    .homepage-banner-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .homepage-banner-grid {
        grid-template-columns: 1fr;
    }
}
/* ========== HEADER BANNER ROW - END ========== */

/* ========== FAVORITE CATEGORIES - START ========== */
.favorite-categories-section {
    background: linear-gradient(180deg, var(--surface-2) 0%, rgba(var(--brand-bg-rgb), 0) 100%);
    position: relative;
}

.favorite-categories-section h2 {
    color: var(--black);
}

/* Add class for keyboard accessibility */
.favorite-categories-container {
    position: relative;
    z-index: 1;
    padding: 5px 0 15px 0;
    margin-bottom: 20px;
    /* Remove left padding/margin to align first card properly */
    padding-left: 0;
    margin-left: 0;
}

.favorite-categories-container .category-item {
    flex: 0 0 auto;
    width: 150px;
    height: 100px;
    margin: 5px;
    position: relative;
    text-align: center;
}

/* Modify first category item to align with other elements */
.favorite-categories-container .category-item:first-child {
    margin-left: 0;
}

.favorite-categories-section .jk-category-slider::-webkit-scrollbar-track {
    background-color: var(--footer-bottom-bg);
}

.favorite-categories-section .jk-category-slider::-webkit-scrollbar-thumb {
    background-color: var(--black);
    border-color: var(--footer-bottom-bg);
}

@media (min-width: 767px) {
    .favorite-categories-container .category-item {
        width: 200px;
        height: 150px;
    }
}

.favorite-categories-container .category-image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: calc(var(--border-radius) + 2px);
    background: var(--background-grey) center center / cover no-repeat;
    border: none;
    box-shadow: var(--box-shadow);
}

.favorite-categories-container .category-title {
    position: absolute;
    font-size: 14px;
    bottom: 5px;
    left: 0;
    width: 100%;
    color: var(--white);
    font-weight: bold;
    text-shadow: var(--text-shadow);
}

/* Enhanced focus styles for categories with consistent rectangular border */
.favorite-categories-container .category-item a:focus-visible {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    border-radius: var(--border-radius) !important;
    z-index: 2;
}

/* Accessibility: Make sure clickable areas have sufficient size */
.favorite-categories-container .category-item a {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 44px; /* Minimum touch target size */
    position: relative;
}


/* New controls container for buttons and "All Categories" */
.categories-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.scroll-btn-group {
    display: flex;
}

.categories-center-btn {
    flex-grow: 1;
    text-align: center;
}

/* For NVDA/screen reader users - visually hidden but available */
.sr-scroll-hint {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
/* ========== FAVORITE CATEGORIES - END ========== */

/* ========== PRODUCT SLIDER SECTION - START ========== */
.product-slider-section {
    background: transparent;
    position: relative;
}

.recommended-products-section,
.random-products-section {
    background: transparent;
}

.custom-homepage .top-picks-slider-wrapper {
    margin-top: 6px;
}

/* Same accessibility enhancements for product sliders */
.product-slider {
    position: relative;
}

.product-slider:focus-within .product-scroll-btn,
body.using-keyboard .product-slider:hover .product-scroll-btn {
    display: flex;
}

.product-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    z-index: 10;
}

/* CRITICAL: Prevent jumps when product scroll buttons are focused - preserve absolute positioning */
.product-scroll-btn,
.product-scroll-btn:focus,
.product-scroll-btn:focus-visible,
.product-scroll-btn:hover {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.product-scroll-btn.left,
.product-scroll-btn.left:focus,
.product-scroll-btn.left:focus-visible,
.product-scroll-btn.left:hover {
    left: 10px !important;
}

.product-scroll-btn.right,
.product-scroll-btn.right:focus,
.product-scroll-btn.right:focus-visible,
.product-scroll-btn.right:hover {
    right: 10px !important;
}

.product-slider-container {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    .product-slider-container {
        scroll-behavior: auto;
    }
}
/* ========== PRODUCT SLIDER SECTION - END ========== */

/* ========== RANDOM PRODUCTS SECTION - START ========== */
.random-products-section {
    background: transparent;
    padding-bottom: 80px;
}

.random-products-section h2 {
    margin-bottom: 12px;
}
/* ========== RANDOM PRODUCTS SECTION - END ========== */

/* ========== ACCESSIBILITY ENHANCEMENTS - START ========== */
/* For screen readers - Defined in navigation-general.css */
/* Skip link - Defined in style.css as .skip-link */
/* ========== ACCESSIBILITY ENHANCEMENTS - END ========== */
