/* ============================================
   DESIGN SYSTEM - CSS VARIABLES
   ============================================ */
:root {
    /* Primary Palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --primary-glow-strong: rgba(99, 102, 241, 0.3);
    
    /* Accent */
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.15);
    
    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    --gradient-text: linear-gradient(135deg, #6366f1, #a855f7);
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --warning: #f59e0b;
    --info: #06b6d4;
    
    /* Surfaces - Light */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-navbar: rgba(255, 255, 255, 0.85);
    --bg-footer: #0f172a;
    --bg-dropdown: #ffffff;
    --bg-modal: #ffffff;
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: var(--primary);
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    --text-link: var(--primary);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.04);
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.1);
    
    /* Spacing */
    --navbar-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Backward compat */
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-color: #0f172a;
    --light-bg: #f8fafc;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
    --bg-body: #0b0f19;
    --bg-surface: #131825;
    --bg-surface-hover: #1a2035;
    --bg-elevated: #1a2035;
    --bg-card: #151a28;
    --bg-input: #1a2035;
    --bg-navbar: rgba(11, 15, 25, 0.9);
    --bg-footer: #060912;
    --bg-dropdown: #1a2035;
    --bg-modal: #151a28;
    
    --border-color: #1e293b;
    --border-light: #1e293b;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.25);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.5);
    
    --gradient-card: linear-gradient(145deg, rgba(21,26,40,0.9), rgba(21,26,40,0.6));
    
    color-scheme: dark;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .card {
    background-color: var(--bg-card) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-dropdown);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-surface-hover);
}

[data-theme="dark"] .modal-content {
    background-color: var(--bg-modal);
    color: var(--text-primary);
}

[data-theme="dark"] .alert-info {
    background-color: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--info);
}

[data-theme="dark"] .swal2-popup {
    background: var(--bg-modal) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .swal2-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .swal2-html-container {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .swal2-input {
    background: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: 0 !important;
    margin-top: 0 !important;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary-glow-strong);
    color: var(--primary-dark);
}

/* ============================================
   NAVBAR - GLASSMORPHISM
   ============================================ */
.navbar-store {
    background: var(--bg-navbar) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--shadow-md) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 200000 !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-image: none !important;
    margin: 0 !important;
    padding: 0.5rem 0.35rem !important;
    transition: all var(--transition-base);
    min-height: var(--navbar-height);
}

.navbar-store,
.navbar-store .navbar-shell,
.navbar-store .navbar-collapse,
.navbar-store .navbar-nav,
.navbar-store .nav-item.dropdown {
    overflow: visible !important;
}

.navbar-store .dropdown-menu,
.navbar-store .dropdown-menu.show {
    z-index: 200010 !important;
    position: absolute !important;
}

.navbar-store .navbar-shell {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: clamp(0.2rem, 0.7vw, 0.7rem);
    padding-right: clamp(0.2rem, 0.7vw, 0.7rem);
    position: relative;
    z-index: 2;
}

.navbar-store.scrolled {
    box-shadow: var(--shadow-lg) !important;
    border-bottom-color: transparent !important;
}

/* Accent line under navbar */
.navbar-store::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0.8;
    z-index: 0;
    pointer-events: none;
}

.purple-line {
    display: none;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--transition-base);
    letter-spacing: -0.02em;
    flex-shrink: 0;
    white-space: nowrap;
}

.navbar-brand:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.navbar-brand img {
    transition: all var(--transition-base);
}

.navbar-store .navbar-collapse {
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    position: relative;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    color: var(--primary) !important;
    background: var(--primary-glow);
}

.nav-link.active {
    color: var(--primary) !important;
}

@keyframes arrowAttentionGlow {
    0%, 100% {
        opacity: 0.88;
        filter: drop-shadow(0 0 0 rgba(99, 102, 241, 0));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.45));
    }
}

.navbar-store .dropdown-toggle::after {
    margin-left: 0.55rem;
    vertical-align: middle;
    border-top: 0.36em solid currentColor;
    border-right: 0.34em solid transparent;
    border-left: 0.34em solid transparent;
    transition: transform var(--transition-fast), filter var(--transition-fast), opacity var(--transition-fast);
    animation: arrowAttentionGlow 1.8s ease-in-out infinite;
}

.navbar-store .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

[data-theme="light"] .navbar-store .dropdown-toggle::after {
    color: var(--primary-dark);
    opacity: 1;
    filter: drop-shadow(0 1px 6px rgba(99, 102, 241, 0.22));
}

[data-theme="dark"] .navbar-store .dropdown-toggle::after {
    color: #c4b5fd;
    opacity: 1;
    filter: drop-shadow(0 1px 8px rgba(168, 85, 247, 0.35));
}

/* ============================================
   DARK MODE TOGGLE
   ============================================ */
.theme-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--bg-surface-hover);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    padding: 0 3px;
    margin: 0 0.5rem;
}

.theme-toggle:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
}

.theme-toggle-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-primary);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(24px);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

[data-theme="dark"] .theme-toggle {
    background: #1e293b;
    border-color: #334155;
}

/* ============================================
   HEADER AVATAR
   ============================================ */
.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    transition: all var(--transition-base);
    box-shadow: 0 0 0 2px var(--bg-surface);
}

.nav-link:hover .header-avatar {
    transform: scale(1.08);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--bg-surface), 0 0 12px var(--primary-glow);
}

/* ============================================
   USER DROPDOWN - REDESIGNED
   ============================================ */
.user-dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    padding: 8px;
    min-width: 240px;
    margin-top: 12px !important;
    background: var(--bg-dropdown);
    backdrop-filter: blur(20px);
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
    text-align: center;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.user-dropdown-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 0%, var(--rank-glow, rgba(139, 92, 246, 0.25)), transparent 38%);
    opacity: 0.9;
    pointer-events: none;
}

.user-dropdown-header img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 3px solid var(--bg-surface);
    box-shadow: 0 0 0 2px var(--primary-light);
    position: relative;
    z-index: 1;
}

.user-dropdown-header .user-name {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.user-dropdown-header .user-email {
    display: block;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    position: relative;
    z-index: 1;
}

.account-level-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 60px;
    padding: 6px 8px;
    border-radius: 12px;
    color: #fff;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--rank-color) 82%, #ffffff 18%), var(--rank-color)),
        var(--rank-color);
    border: 1px solid color-mix(in srgb, var(--rank-color) 62%, #ffffff 38%);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--rank-color) 34%, transparent);
}

.account-level-badge::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.18);
    pointer-events: none;
}

.account-level-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.account-level-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.05;
    text-align: center;
}

.account-level-copy small {
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.78;
}

.account-level-copy strong {
    font-size: 0.65rem;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

.mobile-user-welcome {
    position: relative;
}

.mobile-account-level-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: calc(100% - 24px);
    padding: 0.42rem 0.62rem;
    border-radius: 12px;
    color: var(--rank-color);
    background: color-mix(in srgb, var(--rank-color) 16%, var(--bg-card));
    border: 1px solid color-mix(in srgb, var(--rank-color) 34%, transparent);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--rank-color) 18%, transparent);
}

.mobile-account-level-badge i {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--rank-color) 14%, transparent);
    font-size: 0.72rem;
}

.mobile-account-level-badge span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
}

.user-dropdown-menu .dropdown-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-dropdown-menu .dropdown-item:hover {
    background-color: var(--primary-glow);
    color: var(--primary);
    transform: translateX(4px);
}

.user-dropdown-menu .dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.user-dropdown-menu .dropdown-item.theme-dropdown-item {
    justify-content: space-between;
}

.theme-dropdown-copy {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.theme-dropdown-state {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-glow);
    border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    line-height: 1;
}

.user-dropdown-menu .dropdown-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

/* ============================================
   CART BADGE
   ============================================ */
.cart-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-full);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ============================================
   NOTIFICATION CENTER
   ============================================ */
/* Esconder o ícone de notificação duplicado da direita */
.notification-center.desktop-only {
    display: list-item !important;
}

/* Garantir que o menu do usuário fique na extrema direita */
.navbar-nav {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

@media (min-width: 992px) {
    .navbar-store .navbar-nav {
        transform: translateX(-18px);
        max-width: calc(100vw - 260px);
    }

    .navbar-store .navbar-nav > .nav-item:last-child {
        margin-left: 0.55rem;
    }

    .navbar-store .navbar-nav > .nav-item:last-child .btn-primary-custom {
        min-width: 176px;
        white-space: nowrap;
    }
}

@media (min-width: 992px) and (max-width: 1240px) {
    .navbar-store .navbar-nav {
        transform: translateX(-28px);
        gap: 0.15rem;
    }

    .navbar-store .nav-link {
        padding-left: 0.55rem !important;
        padding-right: 0.55rem !important;
    }

    .navbar-store .navbar-nav > .nav-item:last-child .btn-primary-custom {
        min-width: 164px;
    }
}

/* Restaurar o ícone de notificação mobile/interno do menu se necessário */
.mobile-notification-btn {
    display: none !important;
}

.navbar {
    position: relative;
}

.notification-bell {
    font-size: 1.15rem;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.notification-bell:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.notification-bell.has-notifications {
    animation: bellSwing 2s ease-in-out infinite;
    color: var(--primary);
}

@keyframes bellSwing {
    0%, 100% { transform: rotate(0); }
    10% { transform: rotate(12deg); }
    20% { transform: rotate(-10deg); }
    30% { transform: rotate(8deg); }
    40% { transform: rotate(-6deg); }
    50% { transform: rotate(0); }
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.notification-badge-static {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0 3px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

/* Notification Dropdown */
.notification-dropdown-menu {
    width: 360px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0;
    overflow: visible;
    background: var(--bg-dropdown);
    z-index: 9999 !important;
    margin-top: 8px !important;
    position: relative;
}

.notification-center .notification-dropdown-menu {
    margin-right: -34px !important;
    transform: translateX(-34px) !important;
}

.mobile-notification-btn .notification-dropdown-menu,
.mobile-header-notification + .notification-dropdown-menu {
    margin-right: 0 !important;
    transform: none !important;
}

.notification-header {
    position: relative;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-glow);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.notification-header h6 {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.notification-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.notification-clear-btn {
    min-width: 34px;
    height: 34px;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0 0.7rem !important;
    background: transparent !important;
    color: var(--primary) !important;
    text-decoration: none !important;
    transition: all var(--transition-fast);
}

.notification-clear-btn i {
    font-size: 0.95rem;
}

.notification-clear-btn-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.88;
}

.notification-clear-btn:hover {
    background: rgba(99, 102, 241, 0.10) !important;
    border-color: rgba(99, 102, 241, 0.16) !important;
    color: var(--primary-dark) !important;
    text-decoration: none !important;
}

.notification-sound-btn {
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none !important;
    transition: all var(--transition-fast);
}

.notification-sound-btn i {
    font-size: 0.95rem;
}

.notification-sound-btn.is-enabled {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.10);
    border-color: rgba(99, 102, 241, 0.16);
}

.notification-sound-btn:hover {
    color: var(--primary-dark);
    background: rgba(99, 102, 241, 0.10);
    border-color: rgba(99, 102, 241, 0.16);
    text-decoration: none !important;
}

.notification-clear-btn:focus,
.notification-clear-btn:active,
.notification-sound-btn:focus,
.notification-sound-btn:active {
    text-decoration: none !important;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.notification-list::-webkit-scrollbar {
    width: 4px;
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.notification-item {
    display: flex;
    padding: 12px 16px;
    gap: 12px;
    text-decoration: none;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

.notification-item:hover {
    background: var(--bg-surface-hover);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notification-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.notification-empty {
    padding: 30px;
    text-align: center;
    color: var(--text-tertiary);
}

.notification-empty i {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
    opacity: 0.5;
}

.notification-footer {
    display: none;
}

.notification-sound-config {
    display: none;
}

/* ============================================
   MOBILE STYLES
   ============================================ */
.mobile-avatar-btn {
    display: none;
    padding: 5px;
}

@media (max-width: 991px) {
    .mobile-avatar-btn { display: block; }
    .desktop-user-menu { display: none !important; }
    .desktop-only { display: none !important; }
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 0.5rem;
    transition: all var(--transition-base);
    border-radius: var(--radius-sm);
}

.mobile-menu-toggle:hover {
    color: var(--primary);
    background: var(--primary-glow);
}

@media (max-width: 991px) {
    .mobile-menu-toggle { display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0.4rem !important; margin-left: 0.25rem !important; }
    .navbar-collapse { display: none !important; }
    .menu-panel-lateral { width: 100%; right: -100%; max-width: 380px; visibility: hidden; }
    .menu-panel-lateral.active { right: 0; visibility: visible; }
    .notification-dropdown-menu { width: 300px; }
    .navbar-store .navbar-shell { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; padding-left: 0.2rem; padding-right: 0.2rem; }
    .navbar-brand { margin-right: auto; }
    .d-flex.align-items-center { flex-shrink: 0; gap: 0.125rem; display: flex; align-items: center; }
    .theme-toggle { margin: 0 0.125rem; flex-shrink: 0; }
    .search-icon { padding: 0.4rem !important; flex-shrink: 0; }
    .mobile-header-notification { flex-shrink: 0; padding: 0.4rem !important; }
    .nav-link.d-lg-none { padding: 0.4rem !important; flex-shrink: 0; }
    .mobile-account-level-badge {
        left: 10px;
        top: 10px;
        max-width: 120px;
    }
}

/* ============================================
   SEARCH PANEL - REDESIGNED
   ============================================ */
.search-panel-lateral {
    position: fixed;
    top: 0;
    right: -460px;
    width: 460px;
    height: 100vh;
    background: var(--bg-elevated);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    overflow-y: auto;
}

.search-panel-lateral.active {
    right: 0;
}

.search-panel-top {
    background: var(--gradient-primary);
    padding: 2rem;
    position: relative;
}

.search-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-panel-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.search-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.search-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.search-panel-form {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.search-panel-input {
    background: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    font-size: 0.95rem;
    width: 100%;
    margin-bottom: 0.75rem;
    transition: all var(--transition-base);
    color: #1f2937;
}

.search-panel-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-panel-btn {
    background: white;
    color: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    width: 100%;
    transition: all var(--transition-base);
    cursor: pointer;
    font-size: 0.9rem;
}

.search-panel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.search-live-results {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.16);
    overflow: hidden;
    min-height: 160px;
    display: flex;
    flex-direction: column;
}

.search-live-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
}

.search-live-header h6 {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.search-live-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.74rem;
    font-weight: 700;
}

.search-live-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 430px;
    overflow-y: auto;
}

.search-live-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.7rem;
    min-height: 170px;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.85);
}

.search-live-state i {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.search-live-state strong {
    font-size: 1rem;
    font-weight: 700;
}

.search-live-state p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.6;
    max-width: 280px;
    color: rgba(255, 255, 255, 0.74);
}

.search-live-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.search-live-item {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.75rem;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.26);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
    transition: transform var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}

.search-live-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.34);
}

.search-live-thumb {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.search-live-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-live-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.search-live-name {
    margin: 0;
    color: white;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.search-live-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-live-price {
    color: white;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.search-live-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.74rem;
    font-weight: 600;
}

.search-live-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.search-live-btn {
    border: none;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.72rem 0.95rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

.search-live-btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.search-live-btn-primary:hover {
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.search-live-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.search-live-btn-secondary:hover {
    color: white;
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.search-live-btn-disabled {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    cursor: not-allowed;
}

.search-live-footer {
    padding: 0.9rem 1.1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
}

.search-live-footer.active {
    display: block;
}

.search-live-view-all {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-base);
}

.search-live-view-all:hover {
    color: white;
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.search-panel-lateral.has-live-results .search-tips {
    display: none;
}

.search-tips {
    padding: 1.5rem 2rem;
    color: var(--text-secondary);
}

.search-tips h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.search-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-tips li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.search-tips li i {
    color: var(--primary);
    font-size: 0.75rem;
}

.search-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s;
}

.search-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.password-visibility-group {
    position: relative;
}

.password-visibility-group .form-control,
.password-visibility-group .swal2-input {
    padding-right: 3rem !important;
}

.password-visibility-group .form-control.is-invalid,
.password-visibility-group .form-control.is-valid,
.password-visibility-group .form-control.is-invalid:focus,
.password-visibility-group .form-control.is-valid:focus {
    background-image: none !important;
    padding-right: 3rem !important;
}

.password-visibility-toggle {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 5;
}

.password-visibility-toggle:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.password-visibility-toggle:focus {
    outline: none;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
}

@media (max-width: 768px) {
    .search-panel-lateral {
        width: 100%;
        right: -100%;
    }

    .search-live-item {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.7rem;
    }

    .search-live-thumb {
        width: 60px;
        height: 60px;
    }

    .search-live-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-live-btn {
        width: 100%;
    }
}

/* ============================================
   MENU PANEL LATERAL (MOBILE) - REDESIGNED
   ============================================ */
.menu-panel-lateral {
    position: fixed;
    top: 0;
    right: -460px;
    width: 460px;
    height: 100vh;
    background: var(--bg-elevated);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    overflow-y: auto;
    visibility: hidden;
}

.menu-panel-lateral.active {
    right: 0;
    visibility: visible;
}

.menu-panel-top {
    background: var(--gradient-primary);
    padding: 1.5rem;
}

.menu-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.menu-panel-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.menu-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.menu-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.menu-panel-body {
    padding: 1rem 1.5rem;
}

.menu-panel-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-panel-menu li {
    margin: 2px 0;
}

.menu-panel-menu a {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.95rem;
    font-weight: 500;
}

.menu-panel-menu a:hover {
    background: var(--primary-glow);
    color: var(--primary);
}

.menu-panel-menu a i {
    width: 24px;
    margin-right: 12px;
    font-size: 15px;
    color: var(--text-tertiary);
}

.menu-panel-menu a:hover i {
    color: var(--primary);
}

.menu-item-with-submenu {
    margin: 2px 0;
}

.menu-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
}

.menu-toggle-item:hover {
    background: var(--primary-glow);
    color: var(--primary);
}

.menu-toggle-item.active {
    background: var(--primary-glow);
    color: var(--primary);
}

.submenu-arrow {
    font-size: 11px;
    transition: transform var(--transition-base);
    color: var(--text-tertiary);
    animation: arrowAttentionGlow 1.8s ease-in-out infinite;
}

[data-theme="light"] .submenu-arrow {
    color: var(--primary-dark);
    opacity: 0.92;
}

[data-theme="dark"] .submenu-arrow {
    color: #c4b5fd;
    opacity: 0.95;
}

.menu-toggle-item.active .submenu-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.mobile-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-submenu.open {
    max-height: 500px;
}

.mobile-submenu li {
    margin: 0;
}

.mobile-submenu a {
    padding: 10px 14px 10px 50px;
    font-size: 0.88rem;
    opacity: 0.85;
}

.mobile-submenu a:hover {
    opacity: 1;
}

.menu-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s;
}

.menu-panel-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ============================================
   NAV DIVIDER
   ============================================ */
.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.search-icon {
    padding: 0.5rem 0.75rem !important;
}

/* ============================================
   CARD PRODUCT - MODERN
   ============================================ */
.card-product {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-card);
    position: relative;
    height: 100%;
}

.card-product:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-light);
}

.card-product .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: all var(--transition-slow);
}

.card-product:hover .card-img-top {
    transform: scale(1.05);
}

.card-product .card-body {
    padding: 1.1rem;
}

.card-product .card-title {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.card-product .card-title .title-main {
    font-weight: 700;
    color: var(--text-primary);
}

.card-product .card-title .title-sub {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.card-product .card-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-tag {
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-product .btn-primary-custom {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.card-product .btn-outline-custom {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    border-width: 1.5px;
}

/* Scroll animation */
.card-product.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.card-product.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   BUTTONS - MODERN
   ============================================ */
.btn-primary-custom {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-primary-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}

.btn-primary-custom:hover::before {
    left: 100%;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    color: white;
}

.btn-outline-custom {
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    background: transparent;
}

.btn-outline-custom:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* ============================================
   FOOTER - MODERN
   ============================================ */
.footer-store {
    background: var(--bg-footer);
    color: #e2e8f0;
    padding: 3.5rem 0 1.5rem;
    margin-top: 4rem;
    position: relative;
}

.footer-store::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.footer-store h5 {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1.2rem;
}

.footer-store p {
    color: #94a3b8;
}

.footer-store .text-muted {
    color: #64748b !important;
}

.footer-store a {
    color: #cbd5e1;
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.footer-store a:hover {
    color: var(--primary-light);
    padding-left: 4px;
}

.footer-store i {
    color: #94a3b8;
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    min-width: 0;
    overflow-x: clip;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
canvas,
iframe {
    max-width: 100%;
}

.content-wrapper .container,
.content-wrapper .container-fluid,
.content-wrapper .row,
.content-wrapper [class*="col-"],
.content-wrapper .card,
.content-wrapper .card-body,
.content-wrapper .modal-body,
.content-wrapper .tab-content {
    min-width: 0;
}

.content-wrapper .card-body:has(> table),
.content-wrapper .card-body:has(.table),
.content-wrapper .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.content-wrapper table {
    width: 100%;
}

.content-wrapper pre,
.content-wrapper code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.content-wrapper .btn,
.content-wrapper .form-control,
.content-wrapper .form-select,
.content-wrapper .input-group {
    max-width: 100%;
}

.content-wrapper .btn {
    white-space: normal;
}

.navbar-store .navbar-shell > * {
    min-width: 0;
}

.navbar-brand {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-menu {
    max-width: calc(100vw - 24px);
}

@media (max-width: 768px) {
    .nav-divider { display: none; }
    .search-icon { padding: 0.5rem !important; }
    .content-wrapper {
        margin-top: 56px;
        padding: 0;
    }
    :root {
        --navbar-height: 56px;
    }

    .content-wrapper .container,
    .content-wrapper .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .content-wrapper .row {
        --bs-gutter-x: 0.875rem;
        --bs-gutter-y: 0.875rem;
    }

    .content-wrapper table.table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .content-wrapper .card-body {
        padding: 1rem;
    }

    .content-wrapper .btn-group,
    .content-wrapper .btn-toolbar,
    .content-wrapper .d-flex {
        min-width: 0;
    }

    .modal-dialog {
        margin: 0.75rem;
        max-width: calc(100vw - 1.5rem);
    }

    .dropdown-menu,
    .notification-dropdown-menu {
        max-width: calc(100vw - 24px);
    }

    .swal2-popup {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
    }

    .swal2-html-container {
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }
}

/* ============================================
   SWEETALERT2 ADJUSTMENTS
   ============================================ */
.swal2-container {
    z-index: 300000 !important;
}

.swal2-popup {
    border-radius: var(--radius-xl) !important;
}

.swal2-toast {
    z-index: 300000 !important;
    margin-top: 90px !important;
}

/* Posicionar toast abaixo do header */
.swal2-container.swal2-top-end,
.swal2-container.swal2-top-right,
.swal2-container.swal2-top-start,
.swal2-container.swal2-top-left {
    top: 90px !important;
}

@media (max-width: 576px) {
    .swal2-container.swal2-top-end,
    .swal2-container.swal2-top-right,
    .swal2-container.swal2-top-start,
    .swal2-container.swal2-top-left {
        top: calc(var(--navbar-height, 76px) + 0.75rem) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 0 0.75rem !important;
        align-items: stretch !important;
        z-index: 300001 !important;
    }

    .swal2-toast {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 16px !important;
        transform: none !important;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ============================================
   PRICE STYLES
   ============================================ */
.price-original {
    text-decoration: line-through;
    color: var(--text-tertiary);
    font-size: 0.85em;
    margin-right: 5px;
}

.price-discounted {
    color: var(--success);
    font-weight: bold;
}

/* ============================================
   AUTH AND OTP MODALS
   ============================================ */
.auth-tabs-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
}

.auth-tab-btn {
    flex: 1;
    max-width: 200px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: var(--bg-surface-hover, #f1f5f9);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.auth-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.auth-tab-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
    transform: translateY(-2px);
}

.auth-tab-btn i {
    font-size: 16px;
}

.auth-tab-content {
    display: none;
}

.auth-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.auth-terms-box {
    margin: 0.25rem 0 1rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: var(--bg-surface-hover, #f8fafc);
}

.auth-terms-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    color: var(--text-secondary, #475569);
    font-size: 0.92rem;
    line-height: 1.35;
}

.auth-terms-check input {
    width: 18px;
    height: 18px;
    margin-top: 0.08rem;
    accent-color: var(--primary, #6366f1);
    flex: 0 0 auto;
}

.auth-terms-link,
.auth-terms-link:visited {
    color: var(--primary, #6366f1);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.auth-terms-link:hover,
.auth-terms-link:focus {
    color: var(--primary-dark, #4f46e5);
}

.terms-reader-modal {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.terms-reader-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(3px);
}

.terms-reader-dialog {
    position: relative;
    width: min(920px, 100%);
    height: min(78vh, 760px);
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 18px;
    background: var(--bg-modal, #ffffff);
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.35);
}

.terms-reader-header {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1rem 0 1.15rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-primary, #0f172a);
}

.terms-reader-header strong {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1rem;
}

.terms-reader-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: var(--bg-surface-hover, #f1f5f9);
    color: var(--text-secondary, #475569);
}

.terms-reader-frame {
    width: 100%;
    height: calc(100% - 58px);
    border: 0;
    background: #ffffff;
}

body.terms-reader-open {
    overflow: hidden;
}

@media (max-width: 576px) {
    .terms-reader-modal {
        padding: 10px;
    }

    .terms-reader-dialog {
        height: 86vh;
        border-radius: 14px;
    }

    .auth-terms-box {
        padding: 0.75rem;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.otp-container,
.reset-otp-container {
    text-align: center;
    padding: 1rem 0;
}

.otp-info,
.reset-otp-info {
    color: var(--text-secondary, #666);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.otp-spam-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    max-width: 420px;
    margin: 0 auto 1.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--text-secondary, #64748b);
    font-size: 0.88rem;
    line-height: 1.45;
    text-align: left;
}

.otp-spam-warning i {
    color: #f59e0b;
    margin-top: 0.15rem;
    flex: 0 0 auto;
}

.theme-dark .otp-spam-warning,
body.dark-mode .otp-spam-warning,
[data-theme="dark"] .otp-spam-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: rgba(226, 232, 240, 0.82);
}

.otp-inputs,
.reset-otp-inputs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 2rem 0;
}

.otp-input,
.reset-otp-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    transition: all 0.3s;
    background: var(--bg-input, #f8fafc);
    color: var(--text-primary, #1f2937);
}

.otp-input:focus,
.reset-otp-input:focus {
    outline: none;
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.otp-input.filled,
.reset-otp-input.filled {
    border-color: var(--success, #10b981);
    background: rgba(16, 185, 129, 0.05);
}

.otp-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.otp-verify-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.otp-verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.otp-resend-btn {
    background: transparent;
    color: var(--primary, #6366f1);
    border: 2px solid var(--primary, #6366f1);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.otp-timer {
    color: var(--text-tertiary, #999);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
