/* --- Estilos Generales y Variables --- */
:root {
    --cys-primary-color: #ff6600; /* Naranja */
    --cys-secondary-color: #0073e6; /* Azul */
    --cys-dark-color: #333;
    --cys-light-color: #fff;
    --cys-grey-color: #f0f0f0;
}

/* --- Barra de Anuncios con Movimiento --- */
.cys-announcement-bar {
    background-color: var(--cys-secondary-color);
    color: var(--cys-light-color);
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
}
.cys-announcement-content {
    display: inline-block;
    animation: marquee 25s linear infinite;
}
.cys-announcement-bar p {
    margin: 0;
    font-size: 14px;
    display: inline-block;
    padding-right: 50px; /* Espacio para que no se pegue al repetirse */
}

@keyframes marquee {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* --- Estructura de la Cabecera Principal --- */
.cys-site-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background-color: var(--cys-light-color);
    border-bottom: 1px solid var(--cys-grey-color);
}
.cys-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    gap: 15px;
}

/* --- Lado Izquierdo (Logo y Menú) --- */
.cys-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}
.cys-site-branding img {
    max-height: 50px;
    width: auto;
    display: block;
}
.cys-hamburger-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
#cys-hamburger-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
#cys-hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--cys-dark-color);
    margin: 5px 0;
}
.cys-hamburger-text {
    font-weight: bold;
    font-size: 16px;
    color: var(--cys-dark-color);
}


/* --- Centro (Búsqueda) --- */
.cys-header-center {
    flex-grow: 1;
    position: relative;
}
.cys-product-search {
    display: flex;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 25px;
    overflow: hidden;
}
.cys-search-field {
    width: 100%;
    border: none;
    padding: 8px 15px;
    font-size: 14px;
    outline: none;
}
.cys-search-submit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 15px;
}
.cys-search-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
    background-size: contain;
}
.cys-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--cys-light-color);
    border: 1px solid var(--cys-grey-color);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}
.cys-search-results ul { list-style: none; margin: 0; padding: 0; }
.cys-search-results li a { display: block; padding: 10px 15px; text-decoration: none; color: var(--cys-dark-color); border-bottom: 1px solid var(--cys-grey-color); }
.cys-search-results li a:hover { background-color: var(--cys-grey-color); }


/* --- Lado Derecho (Perfil y Carrito) --- */
.cys-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.cys-profile-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background-color: var(--cys-primary-color);
    border-radius: 50%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>');
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
}
.cys-cart-contents { position: relative; display: inline-block; text-decoration: none; }
.cys-cart-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}
.cys-cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--cys-primary-color);
    color: var(--cys-light-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    font-weight: bold;
}


/* --- Menú Lateral y Submenús --- */
.cys-side-menu {
    position: fixed; top: 0; height: 100%; width: 320px; max-width: 80%;
    background-color: var(--cys-light-color); z-index: 1001;
    transform: translateX(-100%); transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2); display: flex; flex-direction: column;
}
.cys-side-menu.is-open { transform: translateX(0); }

.cys-side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #ff6600; /* Color oscuro para el título */
   /* color: var(--cys-light-color); */
    color: #fff;

}
.cys-side-menu-header h3 { margin: 0; font-size: 18px; text-transform: uppercase; }
#cys-close-menu-btn { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--cys-light-color); }

.cys-side-menu-nav { overflow-y: auto; flex-grow: 1; }
.cys-side-menu-nav ul { list-style: none; margin: 0; padding: 0; }
.cys-side-menu-nav li a { display: block; padding: 15px 20px; color: var(--cys-dark-color); text-decoration: none; border-bottom: 1px solid var(--cys-grey-color); font-weight: bold; position: relative; }
.cys-side-menu-nav li.has-children > a::after {
    content: '›';
    position: absolute;
    right: 20px;
    font-size: 24px;
    color: #aaa;
}
.cys-sub-menu { padding-left: 20px !important; }
.cys-sub-menu a { font-weight: normal !important; background-color: #f9f9f9; }
.cys-sub-menu a::before { content: "- "; }


/* --- Mini Carrito y Overlay --- */
.cys-mini-cart { position: fixed; top: 0; right: 0; height: 100%; width: 320px; max-width: 80%; background-color: var(--cys-light-color); z-index: 1001; transform: translateX(100%); transition: transform 0.3s ease-in-out; box-shadow: -2px 0 10px rgba(0,0,0,0.2); overflow-y: auto; }
.cys-mini-cart.is-open { transform: translateX(0); }
.cys-mini-cart-inner { padding: 15px; }
.cys-mini-cart-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--cys-grey-color); padding-bottom: 10px; }
.cys-mini-cart-header h3 { margin: 0; }
#cys-close-cart-btn { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--cys-dark-color); }
.cys-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.cys-overlay.is-visible { opacity: 1; visibility: visible; }

/* --- Estilos Responsivos para Móviles --- */
@media (max-width: 767px) {
    .cys-header-row {
        flex-wrap: wrap; /* Permite que los elementos pasen a la siguiente línea */
        gap: 0; /* Opcional: Resetea el gap para ajustar manualmente */
        row-gap: 10px; /* Añade un espacio vertical entre las filas */
    }

    .cys-header-center {
        width: 100%;       /* Ocupa todo el ancho disponible */
        order: 3;          /* Se posiciona como el último elemento en el flujo flex */
        flex-grow: 0;      /* Reseteamos el crecimiento para esta vista */
    }

    .cys-header-left {
        order: 1; /* Se mantiene como primer elemento */
    }

    .cys-header-right {
        order: 2; /* Se mantiene como segundo elemento */
    }
}
