/* ==========================================================================
   Skeleton loading screen (replaces the old #preloader)
   Neutral light-gray placeholders + gentle shimmer. No blue.
   ========================================================================== */

#page-skeleton {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #F3F5F6;
    z-index: 999999;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: opacity 0.3s ease;
}
#page-skeleton.skl-hide {
    opacity: 0;
    pointer-events: none;
}

/* Base placeholder block with left-to-right shimmer */
.skl {
    position: relative;
    overflow: hidden;
    background: #E6EAE7;
    border-radius: 6px;
}
.skl::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: skl-shimmer 1.4s infinite;
}
@keyframes skl-shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Green utility bar (restrained brand accent) */
.skl-topbar {
    background: #70A936;
}
.skl-topbar.skl::after {
    display: none;
}

/* White card surfaces */
.skl-card {
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 10px;
    overflow: hidden;
}

.skl-circle {
    border-radius: 50%;
}

.skl-btn {
    background: #DDE3DF;
    border-radius: 4px;
}

/* Text-bar helpers */
.skl-line {
    height: 12px;
    border-radius: 4px;
}
.skl-line.w-30 { width: 30%; }
.skl-line.w-40 { width: 40%; }
.skl-line.w-60 { width: 60%; }
.skl-line.w-80 { width: 80%; }
.skl-line.w-90 { width: 90%; }

/* Header skeleton */
.skl-header-util { height: 38px; border-radius: 0; }
.skl-header-main {
    background: #FFFFFF;
    border-bottom: 1px solid #E5E5E5;
    padding: 14px 0;
}
.skl-logo { width: 180px; max-width: 60%; height: 40px; }
.skl-search { height: 44px; border-radius: 4px; flex: 1; }
.skl-cart { width: 40px; height: 40px; border-radius: 50%; }
.skl-nav { height: 44px; background: #FFFFFF; border-bottom: 1px solid #E5E5E5; }

/* Hero skeleton */
.skl-hero-lg { height: 440px; border-radius: 10px; }
.skl-hero-sm { height: 205px; border-radius: 10px; margin-bottom: 30px; }

/* Category card skeleton */
.skl-cat-card {
    background: #FFFFFF;
    border: 1px solid #F0F0F0;
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    margin-bottom: 20px;
}
.skl-cat-circle { width: 70px; height: 70px; margin: 0 auto 12px; border-radius: 50%; }
.skl-cat-line { width: 70%; height: 12px; margin: 0 auto; }

/* Promo banner skeleton */
.skl-banner { height: 150px; border-radius: 10px; margin-bottom: 30px; }

/* Section heading + tabs skeleton */
.skl-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 12px;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}
.skl-heading { width: 200px; max-width: 50%; height: 24px; }
.skl-tabs { display: flex; gap: 22px; flex-wrap: wrap; }
.skl-tab { width: 110px; height: 15px; }

/* Product card skeleton */
.product-card-skl {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #F0F0F0;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
}
.product-thumb-skl {
    position: relative;
    overflow: hidden;
    height: 175px;
    background: #E6EAE7;
    flex-shrink: 0;
}
.product-thumb-skl::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: skl-shimmer 1.4s infinite;
}
.skl-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 42px;
    height: 18px;
    border-radius: 3px;
    background: #DDE3DF;
    z-index: 1;
}
.product-card-body-skl {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}
.skl-btns { display: flex; gap: 8px; margin-top: 4px; }
.skl-btns .skl-btn { flex: 1; height: 32px; }

/* Brand skeleton */
.skl-brand-card {
    background: #FFFFFF;
    border: 1px solid #F0F0F0;
    border-radius: 10px;
    padding: 20px 10px;
    text-align: center;
    margin-bottom: 20px;
}
.skl-brand-logo { width: 90px; height: 90px; margin: 0 auto; border-radius: 10px; }

/* Footer strip */
.skl-footer { height: 60px; border-radius: 0; margin-top: 30px; }

/* Reduced motion: no shimmer, no fade */
@media (prefers-reduced-motion: reduce) {
    .skl::after,
    .product-thumb-skl::after {
        animation: none;
    }
    #page-skeleton {
        transition: none;
    }
}

/* ==========================================================================
   Progress bar — top edge of the skeleton overlay
   Time-based, asymptotic toward 95%, honest about what it represents.
   ========================================================================== */
#skl-progress-track {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.08);
    z-index: 1000000;
    pointer-events: none;
}
#skl-progress-fill {
    height: 100%;
    width: 0%;
    background: #70A936;
    transition: width 0.25s ease-out;
    will-change: width;
}

/* ==========================================================================
   Bootstrap 5 blue-override — neutralise #0d6efd focus rings/states
   that show during the skeleton and early page load.
   These rules are scoped to avoid disrupting legitimate blue UI elements
   on non-homepage pages (they still apply globally but only override the
   specific focus-glow / checked-state colours; brand accents remain green).
   ========================================================================== */

/* -- Form controls -------------------------------------------------------- */
.form-control:focus {
    border-color: var(--primary-color-solid, #70A936) !important;
    box-shadow: 0 0 0 .25rem rgba(112, 169, 54, 0.25) !important;
    outline: 0 !important;
}
.form-select:focus {
    border-color: var(--primary-color-solid, #70A936) !important;
    box-shadow: 0 0 0 .25rem rgba(112, 169, 54, 0.25) !important;
    outline: 0 !important;
}
.form-check-input:focus {
    border-color: var(--primary-color-solid, #70A936) !important;
    box-shadow: 0 0 0 .25rem rgba(112, 169, 54, 0.25) !important;
    outline: 0 !important;
}
.form-check-input:checked {
    background-color: var(--primary-color-solid, #70A936) !important;
    border-color: var(--primary-color-solid, #70A936) !important;
}
.form-check-input[type=checkbox]:indeterminate {
    background-color: var(--primary-color-solid, #70A936) !important;
    border-color: var(--primary-color-solid, #70A936) !important;
}
.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 .25rem rgba(112, 169, 54, 0.25) !important;
}
.form-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 .25rem rgba(112, 169, 54, 0.25) !important;
}
.form-range::-webkit-slider-thumb { background-color: var(--primary-color-solid, #70A936) !important; }
.form-range::-moz-range-thumb { background-color: var(--primary-color-solid, #70A936) !important; }

/* -- Buttons -------------------------------------------------------------- */
.btn:focus,
.btn:focus-visible,
.btn-check:focus + .btn {
    box-shadow: 0 0 0 .25rem rgba(112, 169, 54, 0.25) !important;
    outline: 0 !important;
}
.btn-close:focus {
    box-shadow: 0 0 0 .25rem rgba(112, 169, 54, 0.25) !important;
}
.btn-check:focus + .btn-primary,
.btn-primary:focus {
    background-color: var(--primary-color-solid, #70A936) !important;
    border-color: var(--primary-color-solid, #70A936) !important;
    box-shadow: 0 0 0 .25rem rgba(112, 169, 54, 0.3) !important;
}
.btn-check:focus + .btn-outline-primary,
.btn-outline-primary:focus {
    box-shadow: 0 0 0 .25rem rgba(112, 169, 54, 0.5) !important;
}

/* -- Accordion ------------------------------------------------------------ */
.accordion-button:not(.collapsed) {
    color: var(--primary-color-dark, #5e8f2d) !important;
    background-color: rgba(112, 169, 54, 0.08) !important;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .125) !important;
}
.accordion-button:focus {
    border-color: var(--primary-color-solid, #70A936) !important;
    box-shadow: 0 0 0 .25rem rgba(112, 169, 54, 0.25) !important;
    outline: 0 !important;
}

/* -- Navigation links ----------------------------------------------------- */
/* Override the Bootstrap default .nav-link blue only for the main nav;
   keep it restrained so other nav links elsewhere aren't affected globally */
.site-header .nav-link,
.site-header .nav-link:hover,
.site-header .nav-link:focus {
    color: inherit;
    text-decoration: none;
}

/* -- Pagination ----------------------------------------------------------- */
.page-link {
    color: var(--primary-color-solid, #70A936) !important;
}
.page-link:hover {
    color: var(--primary-color-dark, #5e8f2d) !important;
}
.page-link:focus {
    color: var(--primary-color-dark, #5e8f2d) !important;
    box-shadow: 0 0 0 .25rem rgba(112, 169, 54, 0.25) !important;
    outline: 0 !important;
}
.page-item.active .page-link {
    background-color: var(--primary-color-solid, #70A936) !important;
    border-color: var(--primary-color-solid, #70A936) !important;
    color: #fff !important;
}

/* -- Dropdown active item ------------------------------------------------- */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary-color-solid, #70A936) !important;
    color: #fff !important;
}

/* -- Nav pills active ----------------------------------------------------- */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--primary-color-solid, #70A936) !important;
}

/* -- List group active ---------------------------------------------------- */
.list-group-item.active {
    background-color: var(--primary-color-solid, #70A936) !important;
    border-color: var(--primary-color-solid, #70A936) !important;
}

/* -- Bootstrap progress bar ---------------------------------------------- */
.progress-bar {
    background-color: var(--primary-color-solid, #70A936) !important;
}

/* -- Mobile menu nav-tabs (Bootstrap default colours override) ------------ */
.mobile-menu .nav-tabs {
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}
.mobile-menu .nav-tabs .nav-link {
    border-color: transparent !important;
    color: #555 !important;
    background: transparent !important;
}
.mobile-menu .nav-tabs .nav-item.show .nav-link,
.mobile-menu .nav-tabs .nav-link.active {
    background: var(--primary-color-solid, #70A936) !important;
    border-color: var(--primary-color-solid, #70A936) !important;
    color: #fff !important;
}

/* -- Input group focus z-index override ----------------------------------- */
.input-group > .form-control:focus,
.input-group > .form-select:focus {
    z-index: 3;
}

/* Reduced motion: disable progress bar transition */
@media (prefers-reduced-motion: reduce) {
    #skl-progress-fill {
        transition: none;
    }
}

/* Responsive skeleton geometry */
@media (max-width: 991px) {
    .skl-hero-lg { height: 320px; }
    .skl-hero-sm { height: 180px; }
}
@media (max-width: 767px) {
    .skl-hero-lg { height: 260px; margin-bottom: 30px; }
    .skl-hero-sm { height: 150px; }
    .product-thumb-skl { height: 150px; }
}
@media (max-width: 575px) {
    .skl-hero-lg { height: 220px; }
    .product-thumb-skl { height: 130px; }
    .skl-section-title {
        flex-direction: column;
        align-items: flex-start;
    }
    .skl-heading { max-width: 70%; }
}
