/* Premium app layer - Eclosion+ */
:root {
    --premium-emerald: #00875a;
    --premium-emerald-2: #00a976;
    --premium-navy: #061b33;
    --premium-navy-2: #0b315d;
    --premium-ink: #0f1f2f;
    --premium-muted: #62748a;
    --premium-soft: #f4f8fb;
    --premium-card: rgba(255, 255, 255, 0.88);
    --premium-line: rgba(15, 31, 47, 0.1);
    --premium-shadow: 0 16px 38px rgba(6, 27, 51, 0.12);
    --premium-shadow-soft: 0 8px 22px rgba(6, 27, 51, 0.08);
    --premium-glass: rgba(255, 255, 255, 0.72);
    --premium-gradient: linear-gradient(135deg, var(--premium-navy), var(--premium-navy-2) 52%, var(--premium-emerald));
    --premium-action: linear-gradient(135deg, var(--premium-emerald), var(--premium-emerald-2));
    --premium-radius: 8px;
    --premium-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html {
    background: var(--premium-soft);
}

body {
    min-height: 100vh;
    font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--premium-ink);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 251, 0.96)),
        repeating-linear-gradient(135deg, rgba(0, 135, 90, 0.035) 0 1px, transparent 1px 20px),
        var(--premium-soft);
    transition: background 0.28s var(--premium-ease), color 0.28s var(--premium-ease);
}

body::selection {
    background: rgba(0, 135, 90, 0.18);
}

a,
button,
.btn,
.card,
.shop-product-card,
.market-product-card,
.category-tile,
.filter-chip,
.mobile-menu-link {
    transition:
        transform 0.22s var(--premium-ease),
        box-shadow 0.22s var(--premium-ease),
        background 0.22s var(--premium-ease),
        border-color 0.22s var(--premium-ease),
        color 0.22s var(--premium-ease);
}

.main-header {
    position: sticky !important;
    top: 0;
    z-index: 1040;
    background: rgba(6, 27, 51, 0.94) !important;
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.top-bar {
    background: rgba(3, 13, 25, 0.92) !important;
}

.nav-secondary {
    background: linear-gradient(90deg, #081f3a, #0b315d) !important;
}

.navbar-middle {
    background:
        radial-gradient(circle at 15% 20%, rgba(0, 135, 90, 0.14), transparent 28%),
        rgba(6, 27, 51, 0.88) !important;
}

.logo-image-link {
    border-radius: 8px;
}

.brand-logo-img {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
}

.search-form .input-group {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16) !important;
}

.search-form .btn,
.search-form .btn-warning {
    background: var(--premium-action) !important;
    color: #fff !important;
}

.premium-theme-toggle,
.mobile-menu-button,
.header-tools-toggle,
.cart-link-header,
.admin-notification-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: none;
}

.premium-theme-toggle:hover,
.mobile-menu-button:hover,
.header-tools-toggle:hover,
.cart-link-header:hover,
.admin-notification-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

body.premium-menu-open .mobile-menu-button i {
    transform: rotate(90deg) scale(0.92);
}

.mobile-menu-button i,
.premium-theme-toggle i {
    transition: transform 0.22s var(--premium-ease);
}

.btn {
    border-radius: 999px;
    font-weight: 900;
}

.btn-success,
.btn-primary {
    background: var(--premium-action) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 12px 24px rgba(0, 135, 90, 0.22);
}

.btn-success:hover,
.btn-primary:hover,
.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(0, 135, 90, 0.28);
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-secondary,
.btn-outline-dark {
    border-color: rgba(0, 53, 102, 0.18);
    color: var(--premium-navy);
    background: rgba(255, 255, 255, 0.7);
}

.card,
.admin-panel,
.admin-card,
.auth-card,
.filter-panel,
.shop-toolbar,
.category-showcase,
.market-section,
.market-mini-card,
.market-product-card,
.market-team-card,
.market-formation-card,
.delivery-card,
.stock-control-panel {
    border: 1px solid var(--premium-line) !important;
    border-radius: var(--premium-radius) !important;
    background: var(--premium-card) !important;
    box-shadow: var(--premium-shadow-soft) !important;
    backdrop-filter: blur(14px);
}

.card:hover,
.shop-product-card:hover,
.market-product-card:hover,
.market-team-card:hover,
.market-formation-card:hover,
.category-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--premium-shadow) !important;
}

.shop-product-card,
.product-card,
.similar-product-card,
.market-product-card {
    border: 1px solid rgba(255, 255, 255, 0.66) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.68)),
        rgba(255, 255, 255, 0.74) !important;
}

.shop-product-card__media,
.product-card .card-img-top,
.market-product-card__image,
.similar-product-card__image {
    background:
        linear-gradient(135deg, rgba(0, 135, 90, 0.08), rgba(11, 49, 93, 0.08)),
        #f8fbfd !important;
}

.category-tile,
.filter-chip,
.shop-summary > div {
    border-radius: var(--premium-radius) !important;
    background: var(--premium-glass) !important;
    backdrop-filter: blur(12px);
}

.category-tile__icon,
.filter-nav--modern a i,
.market-strip i {
    background: var(--premium-gradient) !important;
    color: #fff !important;
}

.filter-panel__header,
.admin-page-head--software,
.order-detail-modal__head {
    background: var(--premium-gradient) !important;
}

.filter-panel__header,
.category-showcase__head {
    position: relative;
}

.premium-collapse-toggle {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
}

.category-showcase__head .premium-collapse-toggle {
    color: var(--premium-navy);
    border-color: rgba(6, 27, 51, 0.12);
    background: rgba(6, 27, 51, 0.05);
}

.filter-panel.is-collapsed .filter-panel__body,
.category-showcase.is-collapsed .category-grid {
    display: none !important;
}

.shop-filters-bar--modern,
.shop-marquee {
    background: linear-gradient(90deg, var(--premium-navy), var(--premium-navy-2)) !important;
}

#eclosion-toast {
    min-width: min(92vw, 360px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px !important;
    background: rgba(6, 27, 51, 0.94) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24) !important;
    backdrop-filter: blur(16px);
}

.admin-notification-menu,
.dropdown-menu {
    border: 1px solid rgba(15, 31, 47, 0.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 18px 42px rgba(6, 27, 51, 0.16) !important;
}

.mobile-main-menu {
    width: min(92vw, 380px) !important;
    border: 0;
    border-radius: 8px 0 0 8px !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 251, 0.96)),
        #fff !important;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.24);
}

.mobile-main-menu__head {
    background: var(--premium-gradient) !important;
}

.mobile-menu-link {
    border-radius: 8px !important;
    background: rgba(6, 27, 51, 0.04);
}

.mobile-menu-link:hover,
.mobile-menu-link:focus-visible {
    transform: translateX(4px);
    background: rgba(0, 135, 90, 0.12);
}

.offcanvas-backdrop.show {
    opacity: 1 !important;
    background: rgba(2, 8, 23, 0.56) !important;
    backdrop-filter: blur(8px);
}

.premium-floating-actions {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1045;
    display: grid;
    gap: 0.65rem;
}

.premium-fab {
    width: 52px;
    height: 52px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    background: var(--premium-gradient);
    box-shadow: 0 16px 34px rgba(6, 27, 51, 0.24);
}

.premium-fab:hover {
    transform: translateY(-3px) scale(1.03);
    color: #fff;
}

.premium-fab--whatsapp {
    background: linear-gradient(135deg, #0fbf6a, #00875a);
}

.premium-fab--theme {
    display: none;
    background: rgba(6, 27, 51, 0.86);
    backdrop-filter: blur(12px);
}

.premium-chat-panel {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 4.25rem);
    z-index: 1046;
    width: min(92vw, 370px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 60px rgba(6, 27, 51, 0.28);
    backdrop-filter: blur(18px);
    transform: translateY(18px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s var(--premium-ease), transform 0.22s var(--premium-ease);
}

.premium-chat-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.premium-chat-panel__head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: var(--premium-gradient);
    color: #fff;
}

.premium-chat-panel__head span,
.premium-chat-panel__head strong {
    display: block;
}

.premium-chat-panel__head span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    font-weight: 850;
}

.premium-chat-panel__head strong {
    font-size: 1rem;
    font-weight: 950;
}

.premium-chat-panel__head button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.premium-chat-panel__body {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.premium-chat-message {
    padding: 0.78rem;
    border-radius: 8px;
    background: #eef6f1;
    color: var(--premium-ink);
    font-weight: 750;
}

.premium-chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.premium-chat-quick button {
    border: 1px solid rgba(0, 135, 90, 0.18);
    border-radius: 999px;
    background: #fff;
    color: var(--premium-emerald);
    padding: 0.45rem 0.68rem;
    font-weight: 900;
}

.premium-chat-input {
    width: 100%;
    resize: none;
    border: 1px solid rgba(15, 31, 47, 0.12);
    border-radius: 8px;
    padding: 0.75rem;
    outline: none;
}

.premium-chat-input:focus {
    border-color: rgba(0, 135, 90, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 135, 90, 0.12);
}

.premium-chat-panel__foot {
    padding: 0 1rem 1rem;
}

.premium-chat-panel__foot .btn {
    width: 100%;
}

body.is-page-loading::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--premium-emerald), transparent);
    animation: premiumLoader 0.9s linear infinite;
}

.premium-skeleton {
    position: relative;
    overflow: hidden;
    color: transparent !important;
    background: #e8eef4 !important;
    border-radius: 8px;
}

.premium-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: premiumShimmer 1.2s infinite;
}

@keyframes premiumLoader {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

@keyframes premiumShimmer {
    to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

html.theme-dark {
    color-scheme: dark;
}

html.theme-dark body {
    color: #edf6ff;
    background:
        linear-gradient(180deg, rgba(5, 18, 34, 0.98), rgba(7, 25, 47, 0.98)),
        repeating-linear-gradient(135deg, rgba(0, 135, 90, 0.06) 0 1px, transparent 1px 20px),
        #051222;
}

html.theme-dark .card,
html.theme-dark .admin-panel,
html.theme-dark .admin-card,
html.theme-dark .auth-card,
html.theme-dark .filter-panel,
html.theme-dark .shop-toolbar,
html.theme-dark .category-showcase,
html.theme-dark .market-section,
html.theme-dark .market-mini-card,
html.theme-dark .market-product-card,
html.theme-dark .market-team-card,
html.theme-dark .market-formation-card,
html.theme-dark .delivery-card,
html.theme-dark .shop-product-card,
html.theme-dark .product-card,
html.theme-dark .similar-product-card {
    border-color: rgba(255, 255, 255, 0.09) !important;
    background: rgba(11, 31, 54, 0.82) !important;
    color: #edf6ff !important;
}

html.theme-dark .text-muted,
html.theme-dark p,
html.theme-dark small,
html.theme-dark .shop-product-card p,
html.theme-dark .market-section-head > a,
html.theme-dark .market-section-head p {
    color: #a7b8ca !important;
}

html.theme-dark h1,
html.theme-dark h2,
html.theme-dark h3,
html.theme-dark h4,
html.theme-dark h5,
html.theme-dark h6,
html.theme-dark strong,
html.theme-dark .shop-product-card h3 a,
html.theme-dark .market-product-card h3 a,
html.theme-dark .market-team-card strong,
html.theme-dark .market-formation-card h3 {
    color: #f8fbff !important;
}

html.theme-dark .form-control,
html.theme-dark .form-select,
html.theme-dark textarea,
html.theme-dark input {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: #f8fbff !important;
}

html.theme-dark .dropdown-menu,
html.theme-dark .premium-chat-panel,
html.theme-dark .mobile-main-menu {
    background: rgba(8, 25, 45, 0.96) !important;
    color: #f8fbff !important;
}

html.theme-dark .premium-chat-message,
html.theme-dark .premium-chat-quick button,
html.theme-dark .premium-chat-input,
html.theme-dark .category-tile,
html.theme-dark .filter-chip,
html.theme-dark .shop-summary > div {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f8fbff !important;
}

html.theme-dark .site-footer {
    background: linear-gradient(180deg, #04101f, #020914) !important;
}

html.theme-dark .premium-theme-toggle i,
html.theme-dark .premium-fab--theme i,
html.theme-dark [data-theme-toggle] i {
    transform: rotate(-16deg);
}

@media (max-width: 767px) {
    body {
        font-size: 14px;
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
    }

    .main-header {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    }

    .navbar-middle {
        padding-block: 0.34rem !important;
    }

    .premium-theme-toggle {
        display: none;
    }

    .premium-fab--theme {
        display: inline-grid;
    }

    .premium-floating-actions {
        right: max(0.75rem, env(safe-area-inset-right));
        bottom: max(0.75rem, env(safe-area-inset-bottom));
    }

    .premium-fab {
        width: 48px;
        height: 48px;
    }

    .premium-chat-panel {
        left: 0.65rem;
        right: 0.65rem;
        bottom: calc(max(0.75rem, env(safe-area-inset-bottom)) + 4rem);
        width: auto;
    }

    .shop-product-card,
    .market-product-card,
    .similar-product-card,
    .product-card {
        border-radius: 8px !important;
    }

    .filter-panel {
        position: static;
    }
}
