/* Apariencia > Estilo > Menús. Cada regla solo actúa si el usuario editó ese color.
   Las ventanas originales conservan sus estilos si el campo nunca se tocó. */

/* BÚSQUEDA */
html.appearance-current-style[data-style-fields~="search_panel_bg"] #searchModal,
html.appearance-current-style[data-style-fields~="search_panel_bg"] #searchModal .modal-header,
html.appearance-current-style[data-style-fields~="search_panel_bg"] #searchModal .mobile-search-result {
    background-color: var(--style-search-panel-bg) !important;
}
html.appearance-current-style[data-style-fields~="search_panel_text"] #searchModal,
html.appearance-current-style[data-style-fields~="search_panel_text"] #searchModal :is(.modal-title,.mobile-search-result,.mobile-search-product-copy,strong) {
    color: var(--style-search-panel-text) !important;
}
html.appearance-current-style[data-style-fields~="search_panel_surface"] #searchModal :is(#searchInput,.mobile-search-message,.mobile-search-result,.search-result-item) {
    background-color: var(--style-search-panel-surface) !important;
}
html.appearance-current-style[data-style-fields~="search_panel_border"] #searchModal :is(#searchInput,.mobile-search-result,.search-result-item) {
    border-color: var(--style-search-panel-border) !important;
}
html.appearance-current-style[data-style-fields~="search_panel_button_bg"] #searchModal :is(.close-btn,.search-row .btn-primary) {
    background-color: var(--style-search-panel-button-bg) !important;
}
html.appearance-current-style[data-style-fields~="search_panel_button_text"] #searchModal :is(.close-btn,.close-btn i,.search-row .btn-primary) {
    color: var(--style-search-panel-button-text) !important;
}
/* Inputs y sus iconos deben conservar el mismo contraste que el texto del panel. */
html.appearance-current-style[data-style-fields~="search_panel_text"] #searchModal #searchInput {
    color: var(--style-search-panel-text) !important;
}

/* MENÚ MÓVIL */
html.appearance-current-style[data-style-fields~="mobile_menu_bg"] #mobileMenu,
html.appearance-current-style[data-style-fields~="mobile_menu_bg"] #mobileMenu .mobile-menu-links > :is(a,.mobile-menu-products-toggle):not(.mobile-menu-secondary) {
    background-color: var(--style-mobile-menu-bg) !important;
}
html.appearance-current-style[data-style-fields~="mobile_menu_text"] #mobileMenu,
html.appearance-current-style[data-style-fields~="mobile_menu_text"] #mobileMenu .mobile-menu-links > :is(a,.mobile-menu-products-toggle),
html.appearance-current-style[data-style-fields~="mobile_menu_text"] #mobileMenu .mobile-products-submenu button {
    color: var(--style-mobile-menu-text) !important;
}
html.appearance-current-style[data-style-fields~="mobile_menu_surface"] #mobileMenu :is(.drawer-header,.mobile-products-submenu),
html.appearance-current-style[data-style-fields~="mobile_menu_surface"] #mobileMenu .mobile-menu-links > .mobile-menu-secondary {
    background-color: var(--style-mobile-menu-surface) !important;
}
html.appearance-current-style[data-style-fields~="mobile_menu_border"] #mobileMenu :is(.mobile-menu-links > a,.mobile-menu-products-toggle,.mobile-products-submenu,.mobile-products-submenu button) {
    border-color: var(--style-mobile-menu-border) !important;
}
html.appearance-current-style[data-style-fields~="mobile_menu_button_bg"] #mobileMenu .close-btn {
    background-color: var(--style-mobile-menu-button-bg) !important;
}
html.appearance-current-style[data-style-fields~="mobile_menu_button_text"] #mobileMenu .close-btn,
html.appearance-current-style[data-style-fields~="mobile_menu_button_text"] #mobileMenu .close-btn i {
    color: var(--style-mobile-menu-button-text) !important;
}

/* CARRITO */
html.appearance-current-style[data-style-fields~="cart_panel_bg"] #cartDrawer,
html.appearance-current-style[data-style-fields~="cart_panel_bg"] #cartDrawer :is(.drawer-header,.cart-footer) {
    background-color: var(--style-cart-panel-bg) !important;
}
html.appearance-current-style[data-style-fields~="cart_panel_text"] #cartDrawer,
html.appearance-current-style[data-style-fields~="cart_panel_text"] #cartDrawer :is(.drawer-title,.cart-item-title,.cart-item-price,.cart-price-row,.cart-total,.cart-coupon-label,.cart-item-subtotal,.empty-cart,.remove-item,.cart-coupon-input,.cart-item-qty) {
    color: var(--style-cart-panel-text) !important;
}
html.appearance-current-style[data-style-fields~="cart_panel_surface"] #cartDrawer :is(.cart-coupon,.empty-cart,.cart-coupon-input,.cart-item-controls,.qty-btn) {
    background-color: var(--style-cart-panel-surface) !important;
}
html.appearance-current-style[data-style-fields~="cart_panel_border"] #cartDrawer :is(.cart-footer,.cart-item,.cart-coupon,.cart-coupon-input,.cart-item-controls,.cart-item-qty) {
    border-color: var(--style-cart-panel-border) !important;
}
html.appearance-current-style[data-style-fields~="cart_panel_button_bg"] #cartDrawer #checkoutBtn:not(:disabled) {
    background-color: var(--style-cart-panel-button-bg) !important;
}
html.appearance-current-style[data-style-fields~="cart_panel_button_text"] #cartDrawer #checkoutBtn:not(:disabled) {
    color: var(--style-cart-panel-button-text) !important;
}

/* DESPLEGABLE DE PRODUCTOS: no cambia la barra de navegación principal. */
html.appearance-current-style[data-style-fields~="products_menu_bg"] #desktopProductsSubmenu {
    background-color: var(--style-products-menu-bg) !important;
}
html.appearance-current-style[data-style-fields~="products_menu_text"] #desktopProductsSubmenu button {
    color: var(--style-products-menu-text) !important;
}
html.appearance-current-style[data-style-fields~="products_menu_surface"] #desktopProductsSubmenu button:hover,
html.appearance-current-style[data-style-fields~="products_menu_surface"] #desktopProductsSubmenu button:focus-visible {
    background-color: var(--style-products-menu-surface) !important;
}
html.appearance-current-style[data-style-fields~="products_menu_border"] #desktopProductsSubmenu {
    border-color: var(--style-products-menu-border) !important;
}
html.appearance-current-style[data-style-fields~="products_menu_hover_text"] #desktopProductsSubmenu button:hover,
html.appearance-current-style[data-style-fields~="products_menu_hover_text"] #desktopProductsSubmenu button:focus-visible {
    color: var(--style-products-menu-hover-text) !important;
}
