:root[data-theme="light"] {
    --surface: #f7f9fc;
    --surface-2: #ffffff;
    --surface-3: #eef2ff;
    --text-strong: #0f172a;
    --text-muted: #475569;
    --accent: #dc3545;
    --accent-2: #0ea5e9;
    --outline: rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.12);
    --trevieta-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
    --trevieta-card-bg: rgba(255, 255, 255, 0.96);
    --trevieta-text: #1f2a44;
    --trevieta-text-muted: #556079;
    --trevieta-cta-bg: #dc3545;
    --trevieta-cta-text: #ffffff;
    --trevieta-shadow: 0 10px 30px rgba(31, 42, 68, 0.15);
    --trevieta-border: rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] {
    --surface: #0b1220;
    --surface-2: #0f172a;
    --surface-3: #111827;
    --text-strong: #e2e8f0;
    --text-muted: #9ca3af;
    --accent: #ff5a6a;
    --accent-2: #22d3ee;
    --outline: rgba(255, 255, 255, 0.08);
    --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.45);
    --trevieta-bg: linear-gradient(180deg, rgba(12, 20, 36, 0.9) 0%, rgba(12, 20, 36, 0) 100%);
    --trevieta-card-bg: linear-gradient(135deg, #0f1b2f 0%, #162a45 100%);
    --trevieta-text: #f8fafc;
    --trevieta-text-muted: #cbd5e1;
    --trevieta-cta-bg: #ff5a6a;
    --trevieta-cta-text: #ffffff;
    --trevieta-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    --trevieta-border: rgba(255, 255, 255, 0.12);
}

html[data-theme] body {
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-3) 40%, var(--surface-2) 100%);
    color: var(--text-strong);
    transition: background 0.35s ease, color 0.35s ease;
}

html[data-theme] .card,
html[data-theme] .modal-content,
html[data-theme] .dropdown-menu,
html[data-theme] .offcanvas,
html[data-theme] .list-group-item,
html[data-theme] .form-control {
    background: var(--surface-2) !important;
    color: var(--text-strong) !important;
    border-color: var(--outline) !important;
    box-shadow: var(--shadow-soft);
}

html[data-theme] .form-control::placeholder {
    color: var(--text-muted);
}

html[data-theme] .trevieta-header-card {
    background: var(--trevieta-card-bg);
    box-shadow: var(--trevieta-shadow);
    border-color: var(--trevieta-border);
}

html[data-theme] .trevieta-logo-text,
html[data-theme] .trevieta-nav-link,
html[data-theme] .trevieta-secondary-action,
html[data-theme] .trevieta-user-link,
html[data-theme] .trevieta-cart-link {
    color: var(--trevieta-text) !important;
}

html[data-theme] .trevieta-nav-link::after {
    background: var(--trevieta-text);
}

html[data-theme] .trevieta-user-menu .dropdown-menu {
    border-color: var(--outline) !important;
    background: var(--surface-2) !important;
}

html[data-theme] .footer-enhanced {
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface) 100%);
    color: var(--text-strong);
}

html[data-theme] .footer-enhanced .text-muted,
html[data-theme] .footer-enhanced a {
    color: var(--text-muted) !important;
}

html[data-theme] .footer-enhanced h5,
html[data-theme] .footer-enhanced h6 {
    color: var(--text-strong);
}

/* Theme Toggle Control */
.theme-toggle {
    position: relative;
    width: 56px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--outline);
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.theme-toggle:hover {
    transform: translateY(-2px);
}

.theme-toggle-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: opacity 0.2s ease, color 0.3s ease;
}

.theme-toggle-handle {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 22px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    right: 4px;
}

.theme-toggle.is-dark .theme-toggle-handle {
    right: 30px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.theme-toggle.is-dark .theme-toggle-moon {
    color: #f8fafc;
    opacity: 1;
}

.theme-toggle.is-dark .theme-toggle-sun {
    opacity: 0.35;
}

.theme-toggle:not(.is-dark) .theme-toggle-sun {
    color: #f59e0b;
    opacity: 1;
}

.theme-toggle:not(.is-dark) .theme-toggle-moon {
    opacity: 0.35;
}
