@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700;800&display=swap');

:root {
    --color-primary: #e63946; 
    --color-accent: #f4a261;  
    --color-dark: #222222;
    --color-light: #ffffff;
    --color-gray: #f8f9fa;
    --color-border: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Urbanist', sans-serif;
}

/* ================= TOP BAR ================= */
.top-bar {
    background-color: var(--color-primary);
    color: var(--color-light);
    padding: 5px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.top-bar-contacto a {
    color: var(--color-light);
    text-decoration: none;
}

.top-bar-frases {
    text-align: center;
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    height: 20px;
    font-size: 14px;
}

.frase-item {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.frase-item.active {
    opacity: 1;
}

.top-bar-redes {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

.top-bar-redes a {
    color: var(--color-light);
    text-decoration: none;
    font-size: 14px;
}

/* ================= MAIN HEADER (PC) ================= */
.main-header {
    background-color: var(--color-light);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
}

.header-nav {
    display: flex;
    gap: 25px;
    list-style: none;
    align-items: center;
}

.header-nav a {
    text-decoration: none;
    color: var(--color-dark);
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s;
}

.header-nav a:hover, .header-nav a.active {
    color: var(--color-primary);
}

/* Dropdown para Servicios en PC con animación fluida */
.header-nav .dropdown {
    position: relative;
}

.header-nav .dropdown > a {
    display: flex;
    align-items: center;
}

.header-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 320px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-radius: 12px;
    list-style: none;
    padding: 8px 0;
    border: 1px solid var(--color-border);
    z-index: 100;
    
    /* Propiedades para la animación suave */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.header-nav .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-nav .dropdown-menu li {
    border-bottom: 1px solid #f1f5f9;
}

.header-nav .dropdown-menu li:last-child {
    border-bottom: none;
}

.header-nav .dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-dark);
    transition: background 0.2s, color 0.2s;
}

.header-nav .dropdown-menu li a:hover {
    background: #fff2ec;
    color: var(--color-primary);
}

.header-nav .dropdown-menu li a:hover .dropdown-icon {
    background: var(--color-primary);
    color: #ffffff;
}

.dropdown-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.header-logo img {
    height: 38px;
    object-fit: contain;
}

.header-acciones {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    padding: 4px;
}

/* Iconos ajustados exactamente a 18px en PC con separación de 10px */
.header-icon-size {
    width: 18px !important;
    height: 18px !important;
    object-fit: contain;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background-color: var(--color-primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-agendar {
    background-color: var(--color-primary);
    color: var(--color-light);
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-agendar:hover {
    background-color: #c52a36;
}

.menu-hamburguesa {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* ================= BUSCADOR MODAL CON BLUR ================= */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.search-close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.search-container-box {
    width: 600px;
    max-width: 90%;
    position: relative;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 30px;
    padding: 10px 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--color-border);
}

.search-input-wrapper input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 6px;
    font-family: 'Urbanist', sans-serif;
    color: var(--color-dark);
}

.search-results-dropdown {
    position: absolute;
    top: 65px;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    max-height: 450px;
    overflow-y: auto;
    display: none;
    border: 1px solid var(--color-border);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-dark);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--color-gray);
}

.search-result-item img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 8px;
    margin-right: 15px;
    background: #f1f1f1;
}

.search-result-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 2px;
}

.search-result-info p {
    font-size: 12px;
    color: #666;
}

.search-footer-all {
    padding: 15px;
    text-align: center;
    background: #fff;
}

.search-footer-all a {
    background-color: var(--color-primary);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    display: inline-block;
}

/* ================= CARRITO LATERAL (DRAWER) ================= */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 100%;
    height: 100%;
    background: white;
    z-index: 1001;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.cart-drawer.active {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.cart-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.cart-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    text-align: left;
    color: #666;
}

.cart-body img {
    max-width: 100%;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 10px;
}

.btn-cart-action {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn-ver-carrito {
    background-color: #43aa8b;
    color: white;
    border: none;
}

.btn-ir-pagar {
    background-color: var(--color-accent);
    color: white;
    border: none;
}

/* ================= MENÚ MÓVIL LATERAL ================= */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    left: auto;
    width: 300px;
    max-width: 85%;
    height: 100%;
    background: white;
    z-index: 1005;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-drawer.active {
    right: 0 !important;
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-dark);
    letter-spacing: 0.5px;
}

.mobile-menu-body {
    flex-grow: 1;
    overflow-y: auto;
}

.mobile-menu-links {
    list-style: none;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

.mobile-menu-links > li {
    border-bottom: 1px solid #f1f5f9;
}

.mobile-menu-links a {
    text-decoration: none;
    color: var(--color-dark);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    transition: color 0.2s;
}

.mobile-menu-links a:hover {
    color: var(--color-primary);
}

.menu-icon-wrap {
    color: var(--color-primary);
    display: flex;
    align-items: center;
}

/* Submenú / Acordeón desplegable de Servicios */
.mobile-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    background-color: #fafbfc;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding: 0 20px;
}

.mobile-dropdown-item.open .mobile-submenu {
    max-height: 400px;
    padding: 10px 20px 15px 20px;
}

.mobile-dropdown-item .arrow-icon {
    transition: transform 0.3s ease;
    color: #888;
}

.mobile-dropdown-item.open .arrow-icon {
    transform: rotate(90deg);
    color: var(--color-primary);
}

.mobile-submenu li {
    border-bottom: 1px solid #edf2f7;
}

.mobile-submenu li:last-child {
    border-bottom: none;
}

.mobile-submenu a {
    padding: 10px 0 10px 32px;
    font-size: 13.5px;
    font-weight: 500;
    color: #555;
    justify-content: flex-start;
}

.mobile-submenu a:hover {
    color: var(--color-primary);
}

.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

/* ================= RESPONSIVE DESIGN (MÓVIL) ================= */
@media (max-width: 992px) {
    .header-nav, .header-acciones .btn-agendar {
        display: none !important;
    }
    .menu-hamburguesa {
        display: block !important;
    }
    .top-bar-frases {
        display: none !important;
    }
    .top-bar {
        justify-content: center !important;
        text-align: center !important;
    }
    .top-bar-redes {
        display: none !important;
    }

    /* Versión móvil: Logo a la izquierda, Iconos y Menú a la derecha */
    .main-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 15px !important;
    }

    .header-logo {
        order: 1 !important;
        display: flex !important;
        justify-content: flex-start !important;
    }

    .header-logo img {
        height: 19px !important; /* Reducido a la mitad de tamaño respecto a PC (38px / 2) */
        object-fit: contain;
    }

    .header-acciones {
        order: 2 !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    /* Iconos ajustados exactamente a 16px en móvil */
    .header-icon-size {
        width: 16px !important;
        height: 16px !important;
    }

    .menu-hamburguesa svg {
        width: 20px !important;
        height: 20px !important;
    }
}