:root {
    /* The Default MIOLORA Dark Theme (Standard) */
    --miolora-bg: #130A0A; /* Ink */
    --miolora-text: #F7F1EA; /* Cream */
    --miolora-surface: rgba(247, 241, 234, 0.04);
    --miolora-burgundy: #4A0E0E;
    --miolora-gold: #C09868;
    --miolora-gold-rgb: 192, 152, 104;
    --miolora-ivory: #FFFDF9;
    --miolora-border: rgba(192, 152, 104, 0.28);
}

html:not([data-miolora-theme]),
html[data-miolora-theme="dark"],
body:not([data-miolora-theme]),
body[data-miolora-theme="dark"] {
    --miolora-bg: #130A0A;
    --miolora-text: #F7F1EA;
    --miolora-surface: rgba(247, 241, 234, 0.04);
    --miolora-border: rgba(192, 152, 104, 0.28);
}

/* The "Light Atelier" Atmosphere Override */
html[data-miolora-theme="light"],
body[data-miolora-theme="light"] {
    --miolora-bg: #F7F1EA; /* Cream Silk background */
    --miolora-text: #4A0E0E; /* Burgundy text */
    --miolora-surface: #ffffff;
    --miolora-border: rgba(192, 152, 104, 0.2);
    --miolora-ivory: #4A0E0E;

    /* Swap Core WP Variables */
    --wp--preset--color--ink: #F7F1EA;
    --wp--preset--color--ivory: #4A0E0E;
    --wp--preset--color--cream: #4A0E0E;
}

/* Atmosphere-Aware Hero Section (Editorial Light) */
.miolora-hero-section {
    background-color: var(--miolora-burgundy);
    color: #ffffff;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

html[data-miolora-theme="dark"] .miolora-hero-section,
body[data-miolora-theme="dark"] .miolora-hero-section {
    background-color: #3A0412;
}

.miolora-hero-brand {
    margin-bottom: 1.15rem;
}

.miolora-hero-brand .miolora-logo-link {
    display: inline-flex;
    max-width: min(360px, 72vw);
}

.miolora-hero-brand .miolora-logo-stack {
    align-items: flex-start;
    text-align: left;
}

.miolora-hero-brand .miolora-logo-atelier {
    letter-spacing: 0.34em;
}

.miolora-hero-stack {
    display: grid;
    justify-items: center;
    gap: 1.35rem;
}

.miolora-hero-section .miolora-hero-image {
    width: min(920px, 100%);
    margin: 0 auto;
}

.miolora-hero-section .miolora-hero-image img {
    display: block;
    width: 100%;
    height: auto;
}

.miolora-hero-copy-wrap {
    max-width: min(760px, 100%);
    text-align: center;
}

.miolora-hero-kicker {
    margin: 0 0 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.34em;
    font-size: 0.74rem;
    color: var(--miolora-gold);
}

html[data-miolora-theme="light"] .miolora-hero-section,
body[data-miolora-theme="light"] .miolora-hero-section {
    background-color: #F7F1EA;
    color: var(--miolora-burgundy);
    border-bottom: 1px solid rgba(192, 152, 104, 0.15);
}

/* Light Mode Hero Typography */
html[data-miolora-theme="light"] .miolora-hero-title,
body[data-miolora-theme="light"] .miolora-hero-title {
    color: var(--miolora-burgundy) !important;
    font-weight: 400;
}

html[data-miolora-theme="light"] .miolora-kicker,
body[data-miolora-theme="light"] .miolora-kicker {
    color: var(--miolora-gold) !important;
}

html[data-miolora-theme="light"] .miolora-hero-copy,
body[data-miolora-theme="light"] .miolora-hero-copy {
    color: var(--miolora-burgundy) !important;
    opacity: 0.85;
}

/* Light Mode Button Language */
html[data-miolora-theme="light"] .miolora-hero-button .wp-block-button__link {
    background: var(--miolora-burgundy) !important;
    color: #ffffff !important;
    border: none !important;
}

html[data-miolora-theme="light"] .miolora-hero-button .wp-block-button__link:hover {
    background: var(--miolora-gold) !important;
    color: var(--miolora-burgundy) !important;
}

/* Atmosphere-Aware Footer (Clean Paper) */
.miolora-site-footer {
    background-color: #0A0505;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-miolora-theme="light"] .miolora-site-footer,
body[data-miolora-theme="light"] .miolora-site-footer {
    background-color: #ffffff;
    border-top: 1px solid rgba(192, 152, 104, 0.1);
}

html[data-miolora-theme="light"] .miolora-site-footer h4,
body[data-miolora-theme="light"] .miolora-site-footer .tagline {
    color: var(--miolora-burgundy) !important;
}

html[data-miolora-theme="light"] .miolora-site-footer a {
    color: var(--miolora-burgundy) !important;
    opacity: 0.7;
}

html[data-miolora-theme="light"] .miolora-site-footer a:hover {
    opacity: 1;
    color: var(--miolora-gold) !important;
}

html[data-miolora-theme-ready="true"] body,
body[data-miolora-theme] {
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Ensure the body and elements respect the atmosphere */
body {
    background-color: var(--miolora-bg);
    color: var(--miolora-text);
}

.miolora-atmosphere-btn {
    cursor: pointer;
    background: none;
    border: 1px solid var(--miolora-gold);
    color: var(--miolora-gold);
    padding: 5px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 999px;
    transition: all 0.3s ease;
}

.miolora-atmosphere-btn:hover {
    background: var(--miolora-gold);
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-atmosphere-btn,
body[data-miolora-theme="light"] .miolora-atmosphere-btn {
    border-color: var(--miolora-burgundy);
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-atmosphere-btn:hover,
body[data-miolora-theme="light"] .miolora-atmosphere-btn:hover {
    background: var(--miolora-burgundy);
    color: #ffffff;
}

/* Logo Switching Logic */
html[data-miolora-theme="light"] .miolora-logo-asset-primary,
body[data-miolora-theme="light"] .miolora-logo-asset-primary {
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-logo-asset-primary svg,
html[data-miolora-theme="light"] .miolora-logo-asset-primary svg *,
body[data-miolora-theme="light"] .miolora-logo-asset-primary svg,
body[data-miolora-theme="light"] .miolora-logo-asset-primary svg * {
    fill: var(--miolora-burgundy);
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-logo-asset-sticky,
body[data-miolora-theme="light"] .miolora-logo-asset-sticky {
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-logo-asset-sticky svg,
html[data-miolora-theme="light"] .miolora-logo-asset-sticky svg *,
body[data-miolora-theme="light"] .miolora-logo-asset-sticky svg,
body[data-miolora-theme="light"] .miolora-logo-asset-sticky svg * {
    fill: var(--miolora-burgundy);
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="dark"] .miolora-logo-asset-sticky,
body[data-miolora-theme="dark"] .miolora-logo-asset-sticky {
    color: var(--miolora-ivory);
}

html[data-miolora-theme="dark"] .miolora-logo-asset-sticky svg,
html[data-miolora-theme="dark"] .miolora-logo-asset-sticky svg *,
body[data-miolora-theme="dark"] .miolora-logo-asset-sticky svg,
body[data-miolora-theme="dark"] .miolora-logo-asset-sticky svg * {
    fill: var(--miolora-gold);
    color: var(--miolora-gold);
}

html[data-miolora-theme="light"] .miolora-logo-asset-mobile,
body[data-miolora-theme="light"] .miolora-logo-asset-mobile {
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-logo-asset-mobile svg,
html[data-miolora-theme="light"] .miolora-logo-asset-mobile svg *,
body[data-miolora-theme="light"] .miolora-logo-asset-mobile svg,
body[data-miolora-theme="light"] .miolora-logo-asset-mobile svg * {
    fill: var(--miolora-burgundy);
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="dark"] .miolora-logo-asset-mobile,
body[data-miolora-theme="dark"] .miolora-logo-asset-mobile {
    color: var(--miolora-gold);
}

html[data-miolora-theme="dark"] .miolora-logo-asset-mobile svg,
html[data-miolora-theme="dark"] .miolora-logo-asset-mobile svg *,
body[data-miolora-theme="dark"] .miolora-logo-asset-mobile svg,
body[data-miolora-theme="dark"] .miolora-logo-asset-mobile svg * {
    fill: var(--miolora-gold);
    color: var(--miolora-gold);
}

/* Navigation Links in Light Mode */
html[data-miolora-theme="light"] .miolora-nav-main a,
body[data-miolora-theme="light"] .miolora-nav-main a {
    color: var(--miolora-burgundy) !important;
}
html[data-miolora-theme="light"] .miolora-nav-main a:hover,
body[data-miolora-theme="light"] .miolora-nav-main a:hover {
    color: var(--miolora-gold) !important;
}

/* Mobile Off-Canvas Menu Background in Light Mode (scoped to overlay only) */
html[data-miolora-theme="light"] .miolora-nav-main,
body[data-miolora-theme="light"] .miolora-nav-main {
    background: transparent;
}

html[data-miolora-theme="light"] body.miolora-viewport-mobile .header-center,
html[data-miolora-theme="light"].miolora-viewport-mobile .header-center,
body[data-miolora-theme="light"].miolora-viewport-mobile .header-center {
    background: #F7F1EA;
}

/* Panels and Cards in Light Mode */
html[data-miolora-theme="light"] .miolora-product-panel,
html[data-miolora-theme="light"] .miolora-product-card,
html[data-miolora-theme="light"] .miolora-luxury-survey,
html[data-miolora-theme="light"] .miolora-option,
body[data-miolora-theme="light"] .miolora-product-panel,
body[data-miolora-theme="light"] .miolora-product-card,
body[data-miolora-theme="light"] .miolora-luxury-survey,
body[data-miolora-theme="light"] .miolora-option {
    background: var(--miolora-surface) !important;
    border-color: var(--miolora-border) !important;
    color: var(--miolora-burgundy) !important;
}

html[data-miolora-theme="light"] .miolora-product-card:hover,
body[data-miolora-theme="light"] .miolora-product-card:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

html[data-miolora-theme="light"] .miolora-luxury-survey,
body[data-miolora-theme="light"] .miolora-luxury-survey {
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}

html[data-miolora-theme="light"] .miolora-survey-screen p,
html[data-miolora-theme="light"] .miolora-result-explanation,
body[data-miolora-theme="light"] .miolora-survey-screen p,
body[data-miolora-theme="light"] .miolora-result-explanation {
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-option.selected,
body[data-miolora-theme="light"] .miolora-option.selected {
    background: rgba(192, 152, 104, 0.1) !important;
    border-color: var(--miolora-gold) !important;
}

/* Form Inputs in Light Mode */
html[data-miolora-theme="light"] input[type="text"],
html[data-miolora-theme="light"] input[type="email"],
html[data-miolora-theme="light"] input[type="tel"],
html[data-miolora-theme="light"] input[type="password"],
html[data-miolora-theme="light"] input[type="number"],
html[data-miolora-theme="light"] textarea,
html[data-miolora-theme="light"] select,
body[data-miolora-theme="light"] input[type="text"],
body[data-miolora-theme="light"] input[type="email"],
body[data-miolora-theme="light"] input[type="tel"],
body[data-miolora-theme="light"] input[type="password"],
body[data-miolora-theme="light"] input[type="number"],
body[data-miolora-theme="light"] textarea,
body[data-miolora-theme="light"] select {
    background: #ffffff !important;
    color: var(--miolora-burgundy) !important;
    border-color: rgba(74, 14, 14, 0.15) !important;
}

html[data-miolora-theme="light"] input[type="checkbox"],
html[data-miolora-theme="light"] input[type="radio"],
body[data-miolora-theme="light"] input[type="checkbox"],
body[data-miolora-theme="light"] input[type="radio"] {
    border-color: var(--miolora-burgundy) !important;
}

html[data-miolora-theme="light"] input[type="checkbox"]:checked,
html[data-miolora-theme="light"] input[type="radio"]:checked,
body[data-miolora-theme="light"] input[type="checkbox"]:checked,
body[data-miolora-theme="light"] input[type="radio"]:checked {
    background: rgba(74, 14, 14, 0.05) !important;
}

html[data-miolora-theme="light"] input[type="checkbox"]:checked::after,
body[data-miolora-theme="light"] input[type="checkbox"]:checked::after {
    color: var(--miolora-burgundy) !important;
}

html[data-miolora-theme="light"] input[type="radio"]:checked::after,
body[data-miolora-theme="light"] input[type="radio"]:checked::after {
    background: var(--miolora-burgundy) !important;
}

html[data-miolora-theme="light"] input:focus,
body[data-miolora-theme="light"] input:focus,
html[data-miolora-theme="light"] textarea:focus,
body[data-miolora-theme="light"] textarea:focus,
html[data-miolora-theme="light"] select:focus,
body[data-miolora-theme="light"] select:focus {
    border-color: var(--miolora-burgundy) !important;
}

/* Light Mode WooCommerce Specifics */
html[data-miolora-theme="light"] .woocommerce #respond input#submit, 
html[data-miolora-theme="light"] .woocommerce a.button, 
html[data-miolora-theme="light"] .woocommerce button.button, 
html[data-miolora-theme="light"] .woocommerce input.button,
body[data-miolora-theme="light"] .woocommerce #respond input#submit, 
body[data-miolora-theme="light"] .woocommerce a.button, 
body[data-miolora-theme="light"] .woocommerce button.button, 
body[data-miolora-theme="light"] .woocommerce input.button {
    background: var(--miolora-burgundy) !important;
    color: #ffffff !important;
    border-color: var(--miolora-burgundy) !important;
}

html[data-miolora-theme="light"] .woocommerce #respond input#submit:hover, 
html[data-miolora-theme="light"] .woocommerce a.button:hover, 
html[data-miolora-theme="light"] .woocommerce button.button:hover, 
html[data-miolora-theme="light"] .woocommerce input.button:hover,
body[data-miolora-theme="light"] .woocommerce #respond input#submit:hover, 
body[data-miolora-theme="light"] .woocommerce a.button:hover, 
body[data-miolora-theme="light"] .woocommerce button.button:hover, 
body[data-miolora-theme="light"] .woocommerce input.button:hover {
    background: var(--miolora-gold) !important;
    color: var(--miolora-burgundy) !important;
}

/* Mini Cart in Light Mode */
html[data-miolora-theme="light"] .widget_shopping_cart_content,
body[data-miolora-theme="light"] .widget_shopping_cart_content {
    background: #ffffff !important;
    color: var(--miolora-burgundy) !important;
}

/* Hamburger Icon in Light Mode */
html[data-miolora-theme="light"] .miolora-hamburger-line,
body[data-miolora-theme="light"] .miolora-hamburger-line {
    background-color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .dashicons-cart,
html[data-miolora-theme="light"] .miolora-lang-toggle,
body[data-miolora-theme="light"] .dashicons-cart,
body[data-miolora-theme="light"] .miolora-lang-toggle {
    color: var(--miolora-burgundy) !important;
}

/* WooCommerce Text in Light Mode */
html[data-miolora-theme="light"] .woocommerce ul.products li.product .woocommerce-loop-product__title,
html[data-miolora-theme="light"] .kicker,
body[data-miolora-theme="light"] .woocommerce ul.products li.product .woocommerce-loop-product__title,
body[data-miolora-theme="light"] .kicker {
    color: var(--miolora-burgundy) !important;
}

/* Light Mode Structural Parity + Item Definition */
html[data-miolora-theme="light"] .miolora-site-header,
body[data-miolora-theme="light"] .miolora-site-header {
    background: rgba(247, 241, 234, 0.94) !important;
    border-bottom: 1px solid rgba(74, 14, 14, 0.14) !important;
    box-shadow: 0 10px 26px rgba(74, 14, 14, 0.06);
}

/* Light mode desktop nav groups */
html[data-miolora-theme="light"] .miolora-dh-nav-group,
body[data-miolora-theme="light"] .miolora-dh-nav-group {
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(74, 14, 14, 0.1);
    border-radius: 14px;
    padding: 0.65rem 0.95rem 0.75rem;
}

html[data-miolora-theme="light"] .miolora-dh-nav-item,
body[data-miolora-theme="light"] .miolora-dh-nav-item {
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-dh-nav-item:hover,
body[data-miolora-theme="light"] .miolora-dh-nav-item:hover {
    color: var(--miolora-brand-gold);
}

html[data-miolora-theme="light"] .miolora-dh-lang-toggle,
body[data-miolora-theme="light"] .miolora-dh-lang-toggle {
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-dh-logo-atelier,
body[data-miolora-theme="light"] .miolora-dh-logo-atelier {
    color: var(--miolora-burgundy);
}

/* Light mode logo container */
html[data-miolora-theme="light"] .miolora-dh-logo-link,
body[data-miolora-theme="light"] .miolora-dh-logo-link {
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(74, 14, 14, 0.1);
    border-radius: 14px;
    padding: 0.65rem 0.95rem 0.75rem;
}

html[data-miolora-theme="light"] .miolora-mh-nav-label,
body[data-miolora-theme="light"] .miolora-mh-nav-label {
    color: var(--miolora-brand-gold);
}

html[data-miolora-theme="light"] .miolora-mh-boutique-menu a,
html[data-miolora-theme="light"] .miolora-mh-utility-menu a,
body[data-miolora-theme="light"] .miolora-mh-boutique-menu a,
body[data-miolora-theme="light"] .miolora-mh-utility-menu a {
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] .miolora-hero,
html[data-miolora-theme="light"] .miolora-hero-section,
body[data-miolora-theme="light"] .miolora-hero,
body[data-miolora-theme="light"] .miolora-hero-section {
    background-color: #F7F1EA;
}

html[data-miolora-theme="light"] .miolora-hero-section .wp-block-columns,
body[data-miolora-theme="light"] .miolora-hero-section .wp-block-columns {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(74, 14, 14, 0.1);
    border-radius: 28px;
    padding: clamp(1rem, 2vw, 1.5rem);
}

html[data-miolora-theme="light"] .miolora-hero-brand,
body[data-miolora-theme="light"] .miolora-hero-brand {
    margin-bottom: 1rem;
}

html[data-miolora-theme="light"] .miolora-featured-card,
html[data-miolora-theme="light"] .miolora-shop-card,
html[data-miolora-theme="light"] .miolora-product-card,
html[data-miolora-theme="light"] .footer-col,
body[data-miolora-theme="light"] .miolora-featured-card,
body[data-miolora-theme="light"] .miolora-shop-card,
body[data-miolora-theme="light"] .miolora-product-card,
body[data-miolora-theme="light"] .footer-col {
    background: rgba(255, 255, 255, 0.62) !important;
    border-color: rgba(74, 14, 14, 0.14) !important;
    box-shadow: 0 10px 28px rgba(74, 14, 14, 0.05);
}

html[data-miolora-theme="light"] .miolora-mobile-bottom-nav,
body[data-miolora-theme="light"] .miolora-mobile-bottom-nav {
    background: #F7F1EA;
    border-top: 1px solid rgba(74, 14, 14, 0.2);
    box-shadow: 0 -8px 22px rgba(74, 14, 14, 0.08);
}

html[data-miolora-theme="light"] .mobile-nav-item,
body[data-miolora-theme="light"] .mobile-nav-item {
    color: var(--miolora-burgundy);
}

html[data-miolora-theme="light"] #miolora-cart-drawer,
body[data-miolora-theme="light"] #miolora-cart-drawer {
    background: #fffdfa;
    box-shadow: -16px 0 46px rgba(74, 14, 14, 0.14);
}

/* PDP parity in Light mode */
html[data-miolora-theme="light"] .miolora-product-gallery-panel,
html[data-miolora-theme="light"] .miolora-dossier-column,
html[data-miolora-theme="light"] .miolora-reviews-shell,
html[data-miolora-theme="light"] .miolora-product-ritual,
html[data-miolora-theme="light"] .miolora-product-faq,
html[data-miolora-theme="light"] .single-product .miolora-product-main-shell .woocommerce-product-gallery,
html[data-miolora-theme="light"] .single-product .miolora-product-main-shell .summary,
body[data-miolora-theme="light"] .miolora-product-gallery-panel,
body[data-miolora-theme="light"] .miolora-dossier-column,
body[data-miolora-theme="light"] .miolora-reviews-shell,
body[data-miolora-theme="light"] .miolora-product-ritual,
body[data-miolora-theme="light"] .miolora-product-faq,
body[data-miolora-theme="light"] .single-product .miolora-product-main-shell .woocommerce-product-gallery,
body[data-miolora-theme="light"] .single-product .miolora-product-main-shell .summary {
    background: rgba(255, 255, 255, 0.72) !important;
    border-color: rgba(74, 14, 14, 0.14) !important;
    color: var(--miolora-burgundy) !important;
}

html[data-miolora-theme="light"] .miolora-product-main-image-wrap,
body[data-miolora-theme="light"] .miolora-product-main-image-wrap {
    background: #fffdfa;
    border-color: rgba(74, 14, 14, 0.14);
}

html[data-miolora-theme="light"] .miolora-gallery-thumb,
body[data-miolora-theme="light"] .miolora-gallery-thumb {
    border-color: rgba(74, 14, 14, 0.2);
}

html[data-miolora-theme="light"] .miolora-product-pill,
body[data-miolora-theme="light"] .miolora-product-pill {
    color: var(--miolora-burgundy);
    border-color: rgba(74, 14, 14, 0.24);
    background: rgba(74, 14, 14, 0.06);
}
