/**
 * Homepage Styles for IMS Company Theme
 * Fowkes.co.za inspired design
 */

/* Promotional Banner */
.promo-banner {
    text-align: center;
    background-color: #333333 !important;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
}

.promo-banner > .wp-block-group {
    max-width: 100% !important;
    margin: 0 auto !important;
    justify-content: center !important;
}

.promo-banner p {
    margin: 0 auto !important;
    line-height: 1.4;
    color: #f9c457 !important;
    text-align: center !important;
    width: 100% !important;
}

/* Compact Header */
.compact-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #333333 !important;
    border-bottom: 1px solid #f9c457;
}

.compact-header > .wp-block-group {
    max-width: 100%;
    width: 100%;
    margin: 0;
}

/* Compact Logo */
.compact-logo {
    flex-shrink: 0;
}

.compact-logo img {
    height: auto !important;
    width: auto !important;
    max-height: 67px;
    max-width: 240px;
    object-fit: contain;
}

.compact-logo figure {
    margin: 0 !important;
    display: flex;
    align-items: center;
}

.compact-logo a {
    display: flex;
    align-items: center;
}

/* Compact Search */
.compact-search {
    flex: 1;
    max-width: 600px;
}

.compact-search .wp-block-search {
    margin: 0;
}

.compact-search .wp-block-search__input {
    border: 1px solid #555;
    background: #444;
    color: white;
    padding: 0.5rem 1rem;
}

.compact-search .wp-block-search__input::placeholder {
    color: #999;
}

.compact-search .wp-block-search__button {
    background: linear-gradient(to bottom, #f9c457, #deb052);
    color: #333;
    padding: 0.5rem 1rem;
}

/* Compact Icons */
.compact-icons {
    flex-shrink: 0;
}

.header-icon {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    text-decoration: none;
}

.header-icon:hover {
    color: #f9c457;
}

.header-icon svg {
    width: 24px;
    height: 24px;
}

/* Hamburger Menu */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger-menu span {
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu:hover span {
    background: #f9c457;
}

/* Mini Cart in Compact Header */
.compact-icons .wp-block-woocommerce-mini-cart {
    margin: 0;
}

.compact-icons .wc-block-mini-cart__button {
    background: transparent !important;
    border: none !important;
    color: white !important;
    padding: 0 !important;
    min-height: auto !important;
}

.compact-icons .wc-block-mini-cart__button:hover {
    color: #f9c457 !important;
}


/* Hero Slider Container */
.hero-slider-container {
    margin: 0 !important;
    padding: 0 !important;
}

.hero-splide {
    margin: 0 !important;
}

.hero-slide {
    margin: 0 !important;
}

/* Ensure consistent slide heights */
.splide__slide {
    height: 500px !important;
}

.hero-slide {
    height: 500px !important;
}

/* Catalog Hero Responsive */
@media (max-width: 1024px) {
    .catalog-hero > div {
        flex-direction: column !important;
        text-align: center !important;
        padding: 4rem 2rem !important;
    }
    
    .catalog-hero h1 {
        font-size: 2.2rem !important;
    }
}

@media (max-width: 768px) {
    .catalog-hero h1 {
        font-size: 1.8rem !important;
    }
    
    .catalog-hero > div > div:last-child {
        display: none !important;
    }
    
    .splide__slide {
        height: auto !important;
        min-height: 400px !important;
    }
    
    .hero-slide {
        height: auto !important;
        min-height: 400px !important;
    }
}

/* Homepage Category Accordion */
.homepage-category-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-accordion-header {
    cursor: pointer; /* Make entire header clickable */
}

.category-accordion-item {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.category-accordion-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-accordion-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
}

.category-toggle-btn {
    background: #333;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.category-toggle-btn:hover {
    background: #f9c457;
    color: #333;
}

.category-toggle-btn .toggle-icon {
    display: block;
    transition: transform 0.3s ease;
}

.category-toggle-btn[aria-expanded="true"] .toggle-icon {
    transform: rotate(45deg);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.category-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.see-all-link {
    color: #f9c457;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.see-all-link:hover {
    color: #deb052;
    text-decoration: underline;
}

/* Accordion Content */
.category-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.4s ease;
    background: white;
    opacity: 0;
}

.category-accordion-content.open {
    max-height: 2000px !important; /* Large enough to fit content */
    opacity: 1;
    border-top: 1px solid #eee;
}

.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 0 1.5rem 1.5rem 4.5rem; /* Left padding aligns with category name */
}

.subcategory-item {
    display: block;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.subcategory-item:hover {
    background: #f9c457;
    color: #333;
    border-color: #f9c457;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 1024px) {
    .subcategories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .subcategories-grid {
        grid-template-columns: 1fr;
        padding-left: 1.5rem;
    }
    
    .category-accordion-header {
        padding: 0.75rem 1rem;
    }
}

/* Hero CTA Button */
.hero-cta-btn {
    transition: all 0.3s ease !important;
}

.hero-cta-btn:hover {
    background: linear-gradient(to bottom, #deb052, #c99842) !important;
    box-shadow: 0 0 20px rgba(249, 196, 87, 0.6) !important;
    filter: brightness(1.1) !important;
}

/* Splide Customization */
.splide__pagination__page {
    background: rgba(255,255,255,0.5) !important;
}

.splide__pagination__page.is-active {
    background: #f9c457 !important;
}

/* Hero Arrows - No Movement */
.hero-arrow {
    transition: background-color 0.3s ease !important;
    transform: none !important;
}

.hero-arrow:hover {
    background: rgba(249,196,87,1) !important;
    transform: none !important;
}

.hero-arrow:active {
    transform: none !important;
}

.splide__arrow {
    transition: background-color 0.3s ease !important;
}

.splide__arrow:hover {
    background: rgba(249,196,87,1) !important;
}

.hero-section h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-section .wp-block-button__link {
    background: linear-gradient(to bottom, #f9c457, #deb052);
    color: #333333;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.hero-section .wp-block-button__link:hover {
    background: linear-gradient(to bottom, #deb052, #c99842);
    box-shadow: 0 2px 8px rgba(249, 196, 87, 0.3);
}

/* Top Brands Section */
.brands-carousel {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.brands-carousel .wp-block-image {
    margin: 0;
    flex: 0 0 auto;
}

.brands-carousel .wp-block-image img {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.brands-carousel .wp-block-image:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Info Boxes */
.info-boxes .wp-block-column {
    text-align: center;
    padding: 1rem;
}

.info-boxes h3 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.info-boxes p {
    color: #6b7280;
}

/* Category Preview Cards */
.wp-block-columns .wp-block-group {
    transition: all 0.3s ease;
    cursor: pointer;
}

.wp-block-columns .wp-block-group:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wp-block-columns .wp-block-group h3 {
    color: #1f2937;
}

/* Featured Products */
.featured-products .woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* IMS Gradient Button */
.ims-gradient-button .wp-block-button__link {
    background: linear-gradient(to bottom, #f9c457, #deb052) !important;
    color: #333333 !important;
    font-weight: 700;
}

.ims-gradient-button .wp-block-button__link:hover {
    background: linear-gradient(to bottom, #deb052, #c99842) !important;
    box-shadow: 0 2px 8px rgba(249, 196, 87, 0.3);
}

/* About Section */
.about-section {
    text-align: center;
}

.about-section .wp-block-button.is-style-outline .wp-block-button__link {
    color: white;
    background-color: transparent;
}

.about-section .wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .compact-search {
        max-width: 400px;
    }
    
    .brands-carousel {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .compact-header > .wp-block-group > .wp-block-group {
        flex-wrap: wrap;
    }
    
    .compact-search {
        order: 3;
        flex-basis: 100%;
        max-width: 100%;
        margin-top: 0.75rem;
    }
    
    .compact-logo {
        order: 1;
    }
    
    .compact-icons {
        order: 2;
    }
    
    .hero-section {
        min-height: 400px !important;
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .hero-section p {
        font-size: 1rem !important;
    }
    
    .brands-carousel {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .wp-block-columns {
        flex-direction: column;
    }
    
    .info-boxes .wp-block-column {
        padding: 0.75rem;
    }
    
    /* Stack navigation on mobile */
    .main-navigation {
        display: none; /* Use mobile menu instead */
    }
    
    /* Adjust search bar for mobile */
    .main-header .wp-block-search {
        max-width: 100%;
    }
    
    /* Featured products grid */
    .featured-products .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 350px !important;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .hero-section h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    .hero-section p {
        font-size: 0.875rem !important;
    }
    
    .promo-banner p {
        font-size: 11px !important;
        line-height: 1.3;
    }
    
    .brands-carousel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-boxes .wp-block-column h3 {
        font-size: 0.875rem !important;
    }
    
    .info-boxes .wp-block-column p {
        font-size: 0.75rem !important;
    }
    
    /* Featured products - single column on very small screens */
    .featured-products .woocommerce ul.products {
        grid-template-columns: 1fr;
    }
    
    /* Button sizing */
    .wp-block-button__link {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.875rem !important;
    }
}

