/* Hero Action Buttons */
.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 24px 0;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.hero-btn-primary {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.hero-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    z-index: 1;
}

.scroll-indicator img.home-scroll-arrow {
    position: static;
    transform: none;
    animation: scrollBounce 2s ease-in-out infinite;
    opacity: 0.8;
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* ============================================
   QUICK LINKS SECTION
   ============================================ */
.home-quick-links {
    padding: 15px 24px 15px;
    /*background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);*/
}

.home-quick-links .container {
    max-width: 1200px;
    margin: 0 auto;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

/* Product category buttons under quick links */
.product-category-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 18px 0 8px;
}
.product-category-buttons .category-btn {
    display: inline-block;
    padding: 10px 14px;
    background: #f1f5f9;
    color: var(--primary-color);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}
.product-category-buttons .category-btn:hover {
    background: #e2e8f0;
}

/* New product category card grid */
.product-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0 0;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e8f0fb;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    min-height: 88px;
}

.product-category-grid .category-card {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.product-category-grid img {
    border-radius: 12px;
}

.product-category-grid .category-card:nth-child(1) { animation-delay: 0.12s; }
.product-category-grid .category-card:nth-child(2) { animation-delay: 0.24s; }
.product-category-grid .category-card:nth-child(3) { animation-delay: 0.36s; }
.product-category-grid .category-card:nth-child(4) { animation-delay: 0.48s; }
.product-category-grid .category-card:nth-child(5) { animation-delay: 0.60s; }
.product-category-grid .category-card:nth-child(6) { animation-delay: 0.60s; }

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(16, 24, 40, 0.06);
}
.category-thumb {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fbfdff;
    border-radius: 8px;
    padding: 8px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}
.category-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.category-body h4 {
    margin: 0;
    font-size: 1.03rem;
    color: var(--primary-color);
}
.category-body .muted {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.92rem;
}
.category-arrow {
    margin-left: auto;
    font-size: 20px;
    color: #9aa7c7;
}

@media (max-width: 1024px) {
    .product-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .product-category-grid {
        grid-template-columns: 1fr;
    }
    .category-thumb {
        width: 56px;
        height: 56px;
        flex: 0 0 56px;
    }
}

/* Favourite products on home */
.favourite-products {
    padding: 18px 16px;
    max-width: 999px;
    margin-left: auto;
    margin-right: auto;
}
.favourite-products h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
    color: var(--primary-color);
}
.fav-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
}
.fav-card {
    display: flex;
    position: relative;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e6eef8;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.favourite-products .fav-card {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeInUp 0.6s ease-out forwards;
}
.favourite-products .fav-card:nth-child(1) { animation-delay: 0.12s; }
.favourite-products .fav-card:nth-child(2) { animation-delay: 0.24s; }
.favourite-products .fav-card:nth-child(3) { animation-delay: 0.36s; }
.favourite-products .fav-card:nth-child(4) { animation-delay: 0.48s; }
.favourite-products .fav-card:nth-child(5) { animation-delay: 0.60s; }
.favourite-products .fav-card:nth-child(6) { animation-delay: 0.72s; }
.favourite-products .fav-card:nth-child(7) { animation-delay: 0.84s; }
.favourite-products .fav-card:nth-child(8) { animation-delay: 0.96s; }
.favourite-products .fav-card:nth-child(9) { animation-delay: 1.08s; }
.favourite-products .fav-card:nth-child(10) { animation-delay: 1.20s; }
.favourite-products .fav-card:nth-child(11) { animation-delay: 1.32s; }
.favourite-products .fav-card:nth-child(12) { animation-delay: 1.44s; }

.fav-title { color: var(--primary-color); }
.fav-cas { font-size: 0.9rem; color: #64748b; }
.fav-card .product-category-list {
    margin-top: 4px;
}
.fav-card .product-category-group {
    display: inline-block;
    padding: 3px 8px;
    background: #f0f4f8;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    margin-right: 4px;
    margin-bottom: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .fav-card:hover {
        transform: translateY(-4px);
        border-color: #d4e2f5;
        box-shadow: 0 14px 30px rgba(16, 24, 40, 0.08);
    }

    .fav-card:hover img[alt="External Link"] {
        opacity: 1 !important;
    }
}



.fav-see-more {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.fav-see-more-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.fav-see-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 23, 96, 0.2);
}

@media (max-width: 1024px) {
    .fav-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
    .fav-grid { grid-template-columns: 1fr; }
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    padding: 32px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #1a3fa4);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.quick-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 23, 96, 0.12);
    border-color: transparent;
}

.quick-link-card:hover::before {
    transform: scaleX(1);
}

.quick-link-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef4ff, #dbeafe);
    border-radius: 16px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.quick-link-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 8px;
}

.quick-link-card p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.quick-link-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    color: #ffffff;
    margin-top: 20px;
    align-self: flex-end;
    transition: all 0.3s ease;
}

.quick-link-card:hover .quick-link-arrow {
    transform: translateX(4px);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        padding: 0 20px;
    }
    
    .hero-btn {
        justify-content: center;
    }
    
    .home-quick-links {
        padding: 40px 16px 60px;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-link-card {
        padding: 24px;
    }
    
    .scroll-indicator {
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        gap: 12px;
    }
    
    .hero-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* ============================================
   LEGACY STYLES (Preserved for compatibility)
   ============================================ */
header.home-title img.home-banner {
    margin-top: 30px;
    width: 300px;
    height: auto;
    filter: none;
    /* Removed background, padding, shadow, border-radius */
}

/* Header text color modes (controlled by small JS that reads data-text on .bg-slide) */
header.home-title.light-text h1,
header.home-title.light-text p {
    color: #ffffff;
    transition: color 220ms ease;
}

header.home-title.dark-text h1,
header.home-title.dark-text p {
    color: #001760; /* primary blue */
    transition: color 220ms ease;
}

#company_banner.is-transparent {
    background-color: transparent;
}

/* 1. Your Main Header Container */
header.home-title {
    position: relative;
    width: 100%;
    /* Use JS-updated --vh to account for mobile address/task bars */
    height: calc(var(--vh, 1vh) * 100 - 40px);
    padding-top: 70px;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #001760;
    text-align: center;
    z-index: 9997;
    overflow: hidden; /* CRITICAL: Keeps the zooming images contained */
    --home-arrow-bottom-offset: 00px;
}

/* 2. The Slideshow Container */
.bg-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Puts the slideshow behind your text */
}

.bg-slideshow::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 35%;

    /* Subtle gradient overlay at bottom of slideshow for improved contrast */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    pointer-events: none;
}

/* 3. The Individual Slides */
.bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0; /* Start hidden */

    /* 35s total duration = 5 images * 7 seconds each */
    animation: zoomAndFade 35s infinite ease-in-out both;
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.2);
    background-repeat: no-repeat;
    backface-visibility: hidden;
    will-change: opacity, transform;
}

/* Assign your images */
.slide-1 {
    background-image: url('../../assets/images/background.png');
    animation-delay: 0s; /* Starts immediately */
}

.slide-2 {
    background-image: url('../../assets/images/S__104964176_0.jpg');
    animation-delay: 7s; /* Starts after 3 seconds */
}

.slide-3 {
    background-image: url('../../assets/images/S__104964177_0.jpg');
    animation-delay: 14s; /* Starts after 6 seconds */
}

.slide-4 {
    background-image: url('../../assets/images/CIMG0052.JPG');
    animation-delay: 21s; /* Starts after 6 seconds */
}

.slide-5 {
    background-image: url('../../assets/images/DSC01791.JPG');
    animation-delay: 28s; /* Starts after 6 seconds */
}

/* 4. The Animation Keyframes */
@keyframes zoomAndFade {
    /* Each slide occupies ~20% of the animation (7s of 35s).
       Fade-in: 0%->5%, visible: 5%->25%, fade-out: 25%->30% */
    0% {
        opacity: 0;
        transform: scale(1);
    }
    5% {
        opacity: 1;
    }
    25% {
        opacity: 1;
    }
    30% {
        opacity: 0;
        transform: scale(1.15);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    header.home-title {
        height: calc(var(--vh, 1vh) * 100 - 40px);
    }
}

@media (max-width: 1024px) {
    header.home-title {
        /* On smaller screens, use full viewport height computed via --vh */
        height: calc(var(--vh, 1vh) * 100);
        top: 0;
    }

    section#company_banner {
        top: 0;
    }
}

/*@media (max-width: 767px) {*/
/*    section#company_banner {*/
/*        position: sticky;*/
/*        display: grid;*/
/*        grid-template-columns: 60px minmax(0, 1fr) 60px;*/
/*        align-items: center;*/
/*        top: 0;*/
/*    }*/
/*}*/

.product-category-grid a.see_more {
    display: none;
}

@media (max-width: 767px) {
    #desktop_products {
        display: none;
    }

    header.home-title.light-text h1 {
        font-size: 20px;
    }

    header.home-title.light-text p {
        font-size: 14px;
    }

    .product-category-grid a.see_more {
        display: block;
    }

    .category-card {
        height: 60px !important;
        max-height: 60px !important;
        min-height: 60px !important;
    }
}

section#content article {
    display: flex;
    flex-direction: column;
    align-items: center;
}

section#content article a.profile-download-btn {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    margin-left: 0;
    padding: 14px 28px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    text-indent: 0;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(0, 23, 96, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    /*border: 2px solid var(--primary-color);*/
    /*border-radius: 8px;*/
    background: white; /* Start transparent */
    color: var(--primary-color); /* Initial text color */
    text-decoration: none;
    font-weight: 600;
    overflow: hidden; /* Crucial: clips the sliding background */
    z-index: 1;
    transition: color 0.4s ease; /* Smooth text color swap */
}

/* The Blue Wrap Background */
.hero-btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    z-index: -1; /* Sits behind the span and svg */

    /* Animation Start: Hidden to the left */
    transform: scaleX(0);
    transform-origin: left;

    /* Cubic-bezier makes it feel "much more smooth" */
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- HOVER STATE --- */

.hero-btn-primary:hover {
    color: white; /* Inverts text color to white */
}

.hero-btn-primary:hover::before {
    /* Slides the background to fill from left to right */
    transform: scaleX(1);
}

/* Ensure the SVG icon also changes color */
.hero-btn-primary svg {
    transition: stroke 0.4s ease;
}

.hero-btn-primary:hover svg {
    stroke: white;
}

/* Hide the white logo by default */
.logo-scrolled {
    transform: translateY(-100%);
}

/*!* State when scrolled (triggered by JS adding class to a parent like #navigation or #company_banner) *!*/
/*.is-scrolled .logo-initial {*/
/*    opacity: 0;*/
/*    !*transform: scale(0.8);*!*/
/*}*/

.is-scrolled .logo-scrolled {
    transform: translateY(0);
}

section#content article a.profile-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 23, 96, 0.3);
}

section#content article a.profile-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 23, 96, 0.2);
}

section#content article a.profile-download-btn img {
    width: 20px;
    height: 20px;
    margin: 0;
    display: inline-block;
    filter: brightness(0) invert(1);
}

@media (max-width: 1280px) and (min-width: 1025px) {
    section#company_banner > .company-title-area {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
        flex-direction: column;
        justify-content: center;

        /* New properties to support the animation */
        position: relative;
        background: transparent; /* Remove static background */
        overflow: hidden;        /* Clips the blue slide-in */
        z-index: 1;
    }

    /* The Animated Background Layer */
    section#company_banner > .company-title-area::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--primary-color);
        z-index: -1; /* Sits behind the text/logo */

        /* Initial State: Slid up 100% */
        transform: translateY(-100%);
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Scrolled State: Slides down to 0 */
    section#company_banner.is-scrolled > .company-title-area::before {
        transform: translateY(0);
    }
}

#company_banner {
    display: flex;
    align-items: center;
    position: fixed; /* Or 'sticky' if it should follow after the 40px bar */
    top: 40px;      /* Sits right under your first banner */
    width: 100%;
    height: 70px;
    z-index: 999;
    background: transparent;
    overflow: hidden; /* Crucial for the slide-in effect */
    transition: color 0.3s ease;
}

/* The "Blue Slide" Layer */
#company_banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    z-index: -1;

    /* Start state: Hidden above the banner's own top edge */
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* The Active State */
#company_banner.is-scrolled::before {
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.quick-links-grid .quick-link-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}
.quick-links-grid .quick-link-card:nth-child(1) { animation-delay: 0.2s; }
.quick-links-grid .quick-link-card:nth-child(2) { animation-delay: 0.4s; }
.quick-links-grid .quick-link-card:nth-child(3) { animation-delay: 0.6s; }

/* Home banner image styling */
section#content article img.home-banner {
    display: block;
    width: 300px !important;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
}