/* ===== ESTILOS GENERALES DEL HEADER ===== */
.site-header, .mobile-header {
    width: 100%;
    font-family: 'Arial', sans-serif;
}

/* ===== HEADER DE ESCRITORIO ===== */
/* Sección superior del header */
.header-top {
    background-color: #000;
    padding: 15px 20px;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo */
.site-branding {
    max-width: 150px;
}

.site-branding img {
    width: 100%;
    height: auto;
}

/* Barra de búsqueda */
.search-container {
    flex-grow: 1;
    max-width: 600px;
    margin: 0 20px;
}

.woocommerce-product-search {
    display: flex;
    position: relative;
    height: 40px;
    border-radius: 30px;
    overflow: hidden;
}

.search-field {
    flex-grow: 1;
    padding: 8px 15px;
    border: none;
    font-size: 16px;
    outline: none;
    width: 100%;
}

.search-button {
    background-color: #333;
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 16px;
    min-width: 100px;
}

/* Iconos del header */
.header-icons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 120px;
}

.account-icon, .cart-icon-container {
    margin-left: 25px;
    position: relative;
}

.account-icon img {
    width: 30px;
    height: 30px;
    filter: invert(1) !important;
    -webkit-filter: invert(1) !important;
    opacity: 0.9;
}

/* Icono de carrito en blanco */
.cart-icon-trigger img {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1) !important;
    -webkit-filter: brightness(0) invert(1) !important;
}

/* Carrito */
.cart-icon-trigger {
    display: inline-block;
    position: relative;
}

/* Mini-carrito */
.mini-cart-content {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    width: 300px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px;
    color: #333;
}

.mini-cart-content.active {
    display: block;
}

.mini-cart-products {
    max-height: 300px;
    overflow-y: auto;
}

.mini-cart-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.mini-cart-item-image {
    width: 60px;
    margin-right: 10px;
}

.mini-cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.mini-cart-item-details p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.mini-cart-total {
    margin: 15px 0;
    font-weight: bold;
    text-align: right;
}

.mini-cart-buttons {
    display: flex;
    justify-content: space-between;
}

.mini-cart-buttons .button {
    padding: 8px 15px;
    text-align: center;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    font-weight: bold;
}

.view-cart-button {
    background-color: #f0f0f0;
    color: #333;
}

.checkout-button {
    background-color: #4CAF50;
    color: white;
}

.empty-cart-message {
    text-align: center;
    padding: 20px 0;
    color: #666;
}

/* Sección inferior del header */
.header-bottom {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.header-bottom-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* Botón de categorías */
.categories-dropdown {
    position: relative;
}

.categories-toggle {
    display: flex;
    align-items: center;
    background-color: #000;
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
}

/* Estilos para el icono de barras */
.bars-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    filter: brightness(0) invert(1) !important;
    -webkit-filter: brightness(0) invert(1) !important;
    display: inline-block;
    vertical-align: middle;
}

.categories-toggle img {
    filter: brightness(0) invert(1) !important;
    -webkit-filter: brightness(0) invert(1) !important;
}

.categories-label {
    text-transform: uppercase;
}

/* Popup de categorías */
.categories-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.categories-popup.active {
    display: block;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.category-item > a:hover {
    background-color: #f9f9f9;
}

/* Estilo para el icono desplegable */
.dropdown-toggle {
    width: 16px;
    height: 16px;
    position: relative;
}

.dropdown-toggle:before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
}

/* Subcategorías */
.subcategories {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #f9f9f9;
}

.category-item.active .subcategories {
    display: block;
}

.subcategories li {
    border-top: 1px solid #f0f0f0;
}

.subcategories a {
    display: block;
    padding: 10px 15px 10px 30px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
}

.subcategories a:hover {
    background-color: #f0f0f0;
}

/* Menú principal de navegación */
.main-navigation {
    margin-left: 15px;
}

.main-menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-menu .menu-item {
    position: relative;
}

.main-menu .menu-item a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    transition: color 0.2s;
}

.main-menu .menu-item a:hover {
    color: #4CAF50;
}

/* ===== HEADER MÓVIL ===== */
.mobile-header {
    background-color: #000;
    width: 100%;
    position: relative;
    z-index: 1000;
}

/* Barra superior del header móvil */
.mobile-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    height: 90px;
}

/* Logo móvil */
.mobile-logo {
    max-width: 130px;
}

.mobile-logo img {
    max-width: 50%;
    height: 50px !important;
    display: block;
}

/* Botón de menú */
.mobile-menu-toggle {
    padding: 5px;
    cursor: pointer;
}

.mobile-menu-toggle img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1) !important;
    -webkit-filter: brightness(0) invert(1) !important;
}

/* Overlay negro */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 998;
    display: none;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Contenedor del menú desplegable */
.mobile-menu-container {
    position: fixed;
    top: 0;
    right: -80%;
    width: 80%;
    height: 100%;
    background-color: #fff;
    z-index: 999;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.mobile-menu-container.active {
    right: 0;
}

/* Cabecera del menú */
.mobile-menu-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.mobile-menu-close {
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

/* Categorías móviles */
.mobile-categories {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.mobile-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-category-item {
    position: relative;
}

.mobile-category-item a {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid #f5f5f5;
}

.mobile-dropdown-toggle {
    width: 20px;
    text-align: center;
}

/* Subcategorías móviles */
.mobile-subcategories {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #f9f9f9;
}

.mobile-category-item.active .mobile-subcategories {
    display: block;
}

.mobile-subcategories li a {
    padding-left: 30px;
    font-size: 14px;
}

/* Iconos de usuario y carrito */
.mobile-user-actions {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.mobile-account-link, 
.mobile-cart-link {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: #333;
    text-decoration: none;
}

.mobile-account-link img, 
.mobile-cart-link img {
    width: 24px;
    height: 24px;
    margin-right: 15px;
}

/* Iconos de redes sociales */
.mobile-social-icons {
    padding: 15px;
}

.mobile-social-icons a {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: #333;
    text-decoration: none;
}

.social-icon {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

/* ===== CONTROLES DE VISIBILIDAD RESPONSIVE ===== */
/* En pantallas grandes, mostrar solo header de escritorio */
@media (min-width: 769px) {
    .mobile-header {
        display: none !important;
    }
    
    .desktop-header {
        display: block !important;
    }
}

/* En pantallas pequeñas, mostrar solo header móvil */
@media (max-width: 768px) {
    .desktop-header,
    .site-header:not(.mobile-header) {
        display: none !important;
    }
    
    .mobile-header {
        display: block !important;
    }
    
    /* Ajustes adicionales para móvil */
    .site-content {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* Ajustes adicionales responsive para header de escritorio */
@media (max-width: 992px) and (min-width: 769px) {
    .header-main {
        padding: 0 15px;
    }
    
    .search-container {
        max-width: 400px;
        margin: 0 10px;
    }
    
    .account-icon, .cart-icon-container {
        margin-left: 15px;
    }
    
    .header-bottom-content {
        padding: 0 15px;
    }
}