*, *::before, *::after {
  box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Montserrat', 'Lato', sans-serif;
    background-color: #fff;
    color: #333;
}


.top-banner {
    background-color: #e00000;
    color: white;
    text-align: center;
    height: 40px;
    font-weight: normal;
    overflow: hidden;       
    position: relative;     
    white-space: nowrap;    
}

#banner-text {
  position: absolute;
  left: 100%;
  top: 30%;
  transform: translateY(-80%);
}

#banner-text span {
  display: inline-block; 
}

.separator {
  margin-left: 60px;
}

.main-header {
    background-color: white;
    padding-bottom: 10px;
    font-family: sans-serif;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.cf-turnstile {
  transform: scale(0.85);
  transform-origin: 0 0;
}

/* Fila superior: menú, logo y login/carrito */
.header-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1250px; 
    margin: 0 auto;
    padding: 10px 20px;
}

.menu-left {
    position: relative; 
    display: flex;
    align-items: center;
}


.menu-left,
.user-right {
    display: flex;
    align-items: center;
}

.menu-hamburguesa {
    font-size: 20px;
    font-weight: normal;
    color: #360073e7;
    cursor: pointer;
}

.sidebar-categorias {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 270px;
    background: #fff;
    border-right: 1px solid #ccc;
    transform: translateX(-100%); 
    transition: transform 0.3s ease;
    z-index: 2000;
    padding: 60px;
    border-top-right-radius: 50px;
}

.sidebar-categorias.activo {
    transform: translateX(0); 
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar-logo {
    height: 40px;
}

.close-btn {
    font-size: 24px;
    cursor: pointer;
    color: #360073;
}

.sidebar-categorias ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-categorias ul li {
    margin: 5px 0;
    border-radius: 8px;
}

.sidebar-categorias ul li a {
    display: block;
    padding: 5px;
    color: #360073;       
    font-weight: 500;
    font-size: 18px;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
    border-radius: 8px;
}

.sidebar-categorias ul li a:hover {
  background: #e53935;  
  color: #fff;          
  border-radius: 8px;    
}

.sidebar-categorias ul li a.active {
  background: #e53935;   
  color: #fff;
  border-radius: 8px;   
}



.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 1500;
}

.overlay.activo {
    display: block;
}


.logo-center {
    display: flex;
    justify-content: center;
}

.logo-center img {
    height: 60px;
    max-width: 100%;
}

.user-right {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.user-greeting {
    font-weight: 500;
    color: #333;
}

.login-link,
.cart-icon {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #360073;
    font-weight: bold;
    transition: color 0.2s ease;
}

.login-link:hover,
.cart-icon:hover {
    color: #d60000;
}

  .user-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.user-link{
  text-decoration: none;
  color: #360073;
  font-weight: 500;
  transition: color .2s ease;
  white-space: nowrap;
  position: relative;
}

.user-link::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-2px;
  width:0;
  height:1px;
  background:#360073;
  transition: width .2s ease;
}

.user-link:hover::after{
  width:100%;
}

.user-dropdown{
  position: relative;
  display: inline-block;
}

.user-dropdown-menu{
  position: absolute;
  top: 100%;              /* 👈 pegado al saludo */
  right: 0;
  margin-top: 8px;        /* 👈 separación visual */
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;     /* 👈 usamos visibility en vez de pointer-events */
  transform: translateY(6px);
  transition: all .2s ease;
  z-index: 5000;
}

.user-dropdown-menu a{
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: #360073;
  text-decoration: none;
  transition: background .2s ease;
}

.user-dropdown-menu a:hover{
  background: #f4efff;
}

.user-dropdown:hover .user-dropdown-menu{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===============================
   LOGOUT MODAL
================================ */

.logout-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all .2s ease;
  z-index: 9999;
}

.logout-modal.active{
  opacity: 1;
  visibility: visible;
}


.logout-modal-content{
  background: #fff;
  border-radius: 16px;
  padding: 25px 30px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0,0,0,.2);
  animation: scaleIn .2s ease;
}

.logout-modal-content h3{
  margin-bottom: 8px;
  color: #360073;
}

.logout-modal-content p{
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.logout-modal-actions{
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-cancel{
  background: #f4efff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: #360073;
}

.btn-confirm{
  background: #e53935;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
}

.btn-confirm:hover{
  background: #c62828;
}

@keyframes scaleIn{
  from{ transform: scale(.95); opacity: 0; }
  to{ transform: scale(1); opacity: 1; }
}

/* CONTENEDOR MENSAJES */
.message {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 260px;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(0,0,0,.15);
  z-index: 9999;
  animation: fadeInOut 4s ease forwards;
  opacity: 0;
  pointer-events: none;
}

/* ÉXITO */
.message.success {
  background: #e6f7ec;
  color: #0f5132;
  border-left: 4px solid #198754;
}

/* ERROR */
.message.error {
  background: #ffe5e5;
  color: #842029;
  border-left: 4px solid #dc3545;
}

/* ANIMACIÓN */
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

.search-item{
  padding: 8px 12px;
}

.search-item a{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #360073;
}

.search-item-name{
  font-size: 14px;
}

.search-item-cat{
  font-size: 12px;
  color: #777;
}

.search-item:hover{
  background: #f4efff;
}


.search-item.active { background:#f4efff; }
.search-item.active a { color:#360073; }

.search-results{
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  display: none;
  max-height: 300px;
  overflow-y: auto;
  z-index: 6000;
  padding: 15px 25px 15px 25px;
}


.logout-btn{
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 14px;
  color: #360073;
  cursor: pointer;
  transition: background .2s ease;
}

.logout-btn:hover{
  background: #f4efff;
}

.register-link{
  padding:6px 12px;
  background:#f4efff;        /* tono muy suave del morado */
  border-radius:20px;
  font-size:13px;
  text-decoration:none;
  color:#360073;
  transition:all .2s ease;
}

.register-link:hover{
  background:#e8ddff;
}

.header-top > .user-right {
    justify-self: end;
}

.icon-user {
    margin-right: 6px;
    width: 20px;
    height: 20px;
    fill: #360073;
}

.icon-cart {
    margin-right: 6px;
    width: 28px;
    height: 28px;
    fill: #360073;
}

.cart-icon {
    position: relative;
    margin-left: auto; /* 👈 asegura que el carrito quede al borde derecho */
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #d60000;
    color: white;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

.mini-cart {
  position: fixed;       /* fijo en pantalla */
  top: 100px;            /* baja el bloque debajo del header */
  right: 20px;
  width: 290px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
}

.mini-cart.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mini-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
}

.cart-title {
  font-weight: 400;
  font-size: 20px;
  color: #360073;
  background: white;  
  padding: 6px 3px;
  border-radius: 6px;
}

.close-cart {
  background: #360073;  
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  width: 28px;
  height: 28px;
}

.mini-cart-items {
  list-style: none;
  margin: 0;
  padding: 12px;
  max-height: calc(5 * 60px); /* altura para 5 productos aprox */
  overflow-y: auto;           /* activa scroll vertical */
}


.item-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 8px;
}

.mini-cart-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  min-height: 60px;           
}


.item-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 8px;
}

.item-price-tarj {
  color: #999;
  text-decoration: line-through;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.item-price {
  color: #e63946;
  font-weight: 600;
  font-size: 0.95rem;
}

.categoria-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu-arrow {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.menu-item.active .submenu-arrow {
    transform: rotate(90deg);
}

.submenu {
    display: none;
    padding-left: 15px;
}

.menu-item.active > .submenu {
    display: block;
}

.menu-categorias > li > .categoria-link {
  font-weight: 600;
    font-size: 16px;
}

.menu-categorias .submenu a {
    font-size: 14px;
}

.item-name {
  flex: 1;
  font-size: 14px;
  margin-right: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* máximo 2 líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remove-item {
  background: none;
  border: none;
  color: red;
  font-size: 18px;
  cursor: pointer;
}

.mini-cart-total {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  font-weight: bold;
  border-top: 1px solid #eee;
}

.mini-cart-actions {
  display: flex;
  flex-direction: column; /* botones uno sobre otro */
  padding: 12px;
  gap: 10px;
}

.btn-cart {
  background: #360073;   /* morado */
  color: #fff;
  padding: 10px;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

.btn-checkout {
  background: #e53935;   /* rojo */
  color: #fff;
  padding: 10px;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}


/* Fila inferior: solo la barra de búsqueda */
.header-bottom {
    display: flex;
    justify-content: center;
    margin-top: 0;
    font-size: 16px;
}

.search-section {
    width: 90%;
    max-width: 1250px;
    display: flex;
    border: 1px solid #666;
    border-radius: 30px;
    background: #fff;
    font-size: 16px;
    position: relative;
}

.search-section input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    font-size: 16px;
    border-radius: 30px 0 0 30px;
}

.search-section input::placeholder {
    color: #999;
    font-style: italic;
    font-size: 16px;
}

.search-button {
    padding: 10px 20px;
    background-color: white;
    border: none;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button svg {
    display: block;
    fill: #666;
}


.main-footer {
  background-color: #360073;
  color: white;
  padding: 40px 20px 20px;
  font-family: 'Lato', 'Montserrat', sans-serif;
}

.footer-grid {
  max-width: 1250px;  
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.3fr 2fr; 
  gap: 20px;
}


.footer-section h4 {
  margin-bottom: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: #ffcc00;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a,
.footer-section p a {
  color: white;
  text-decoration: none;
  font-weight: 400;
}

.footer-logo {
  height: 100px;
  margin-bottom: 5px;
}

.social-icons a img {
  height: 15px;
  margin-right: 10px;
}

.payment-logos img {
  height: 22px;
  margin-right: 10px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between; 
  align-items: center;
  margin-top: 20px;
  font-size: 14px;
  padding-top: 10px;
}

.footer-links a {
  color: #ffcc00;  
  text-decoration: none;
  margin-right: 10px;
}

.footer-links a:last-child {
  margin-right: 0; 
}

.footer-copy {
  color: #fff;
}

.footer-copy a {
  color: #ffffff;
  text-decoration: none;
  position: relative;
}

.footer-copy a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: #ffffff;
  transition: width 0.3s ease;
}

.footer-copy a:hover::after {
  width: 100%;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;              
  margin-bottom: 8px;
  line-height: 1.4;
}

.contact-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;        
}

.contact-item a {
  color: #fff;          
  text-decoration: none;   
  transition: opacity 0.3s ease;
}

.contact-item a:hover {
  opacity: 0.7;
}

.map-container {
  margin-top: 10px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
}

.map-container iframe {
  width: 100%;       
  height: 150px;    
  border: none;
}

.nota {
    font-size: 14px;        
    color: white;          
    font-style: italic;  
    display: block;        
    margin-top: 30px;  
    margin-bottom: 7px;    
}

/* Forzar estilo de enlaces en el footer */
.footer-section a {
  color: white !important; 
  text-decoration: none !important;
}

/* Opcional: hover en dorado para dar feedback */
.footer-section a:hover {
  color: #ffcc00;
}

.scroll-top-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #ffcc00;       
  color: #360073;            
  text-decoration: none;
  font-size: 22px;
  font-weight: bold;
  transition: all 0.3s ease;
  position: fixed;
  bottom: 60px;
  right: 20px;
  z-index: 999;

  /* aro externo */
  box-shadow: 0 0 0 3px #360073, 0 0 0 6px #fff;
}

html {
  scroll-behavior: smooth;
}

.scroll-top-btn:hover {
  background: #fff;
  color: #360073;
  box-shadow: 0 0 0 3px #ffcc00, 0 0 0 6px #360073;
}


@media (max-width: 768px) {
  /* Header superior */
  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
     border-top-right-radius: 25px
  }

/* En móvil: ocultar el texto, dejar solo el ícono */
  .menu-hamburguesa {
    font-size: 26px;
    color: #360073;
    width: 30px;
    overflow: hidden;
    white-space: nowrap;
  }

  /* Logo centrado */
  .logo-center {
    flex: 1;
    display: flex;
    justify-content: flex-start;
  }
  .logo-center img {
    height: 50px;
  }

  /* Login + carrito a la derecha */
  .user-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
  }


  /* ============================
   LOGIN RESPONSIVE MÓVIL (OK)
============================ */

/* ===== Invitado (NO logueado) ===== */
.user-info.is-guest .user-greeting{
  display: none; /* ocultar ¡Hola! */
}

/* Dejar solo el ícono en "Iniciar sesión" */
.user-info.is-guest .login-link{
  font-size: 0;          /* oculta el texto */
  gap: 0;
}
.user-info.is-guest .login-link .icon-user{
  margin-right: 0;
  width: 22px;
  height: 22px;
}

/* Botón crear cuenta se mantiene (puedes ajustar tamaño) */
.user-info.is-guest .register-link{
  padding: 5px 10px;
  font-size: 12px;
}

.user-dropdown-menu{
  right: -10px;
}

/* ===== Logueado ===== */
.user-info.is-auth{
  flex-direction: row;   /* que no se apile raro en móvil */
  align-items: center;
  gap: 10px;
}

/* Mostrar “Hola Gonzalo” */
.user-info.is-auth .user-greeting{
  display: inline;
  font-size: 13px;
  font-weight: 500;
}

/* Ocultar “Mi cuenta” completo (ícono + texto) */
.user-info.is-auth .login-link{
  display: none;
}

/* (por si acaso) si existiera crear cuenta, ocultarlo */
.user-info.is-auth .register-link{
  display: none;
}

.user-info.is-auth .user-greeting{
  white-space: nowrap;
}


  .sidebar-categorias {
    padding: 40px 15px 40px 25px;
  }
  /* Barra de búsqueda debajo */
  .header-bottom {
    margin-top: 10px;
    padding: 0 15px;
    font-size: 16px;
  }
  .search-section {
    width: 100%;
    border-radius: 20px;
    font-size: 16px;
  }
  .search-section input {
    font-size: 16px;
    padding: 10px;
  }

  /* ====== HEADER en móviles ====== */
  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
  }

  /* Hamburguesa sola */
  .menu-hamburguesa {
    font-size: 26px;
    color: #360073;
    width: 30px;
    overflow: hidden;
    white-space: nowrap;
  }

  /* Logo centrado */
  .logo-center {
    flex: 1;
    display: flex;
    justify-content: start;
    margin-left: 15px;
  }
  .logo-center img {
    height: 50px;
    align-items: flex-start;
  }

  .nota {      
    margin-top: 19px;   
}

  .cf-turnstile {
    transform: scale(0.75);
    transform-origin: 0 0;
  }

  .scroll-top-btn {
    display: none;
  }

  /* Login + carrito a la derecha */
  .user-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
  }

  /* Barra de búsqueda debajo */
  .header-bottom {
    margin-top: 5px;
    padding: 0 12px;
    display: flex;
    justify-content: center;
    font-size: 16px;
  }
  .search-section {
    width: 100%;
    font-size: 16px;
  }
  .search-section input {
    font-size: 16px;
    padding: 8px;
  }

/* ====== FOOTER en móviles ====== */
  .footer-grid {
    display: block; /* evita que el grid los apile */
    text-align: center;
  }

  /* Navegación y Contacto lado a lado */
  .footer-section:nth-child(2),
  .footer-section:nth-child(3) {
    display: inline-block;
    width: 48%;
    vertical-align: top;
    text-align: left;
    font-size: 13px; 
  }

    /* Resto de secciones siguen apiladas */
  .footer-section:not(:nth-child(2)):not(:nth-child(3)) {
    display: block;
    margin: 0 auto 25px;
    max-width: 100%;
  }

  /* Ajuste general de tipografía en móvil */
  .footer-section h4 {
    font-size: 14px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 12px;
  }

  .map-container p {
    font-size: 13px;   
    line-height: 1.4; 
    margin-top: 8px;  
  }

  .footer-section ul li a,
  .contact-item span,
  .nota {
    font-size: 12px;
  }
  

  .footer-logo {
    height: 80px;
    margin-bottom: 0;
  }

  .social-icons a img {
    height: 20px;
    margin: 0 6px;
  }

  .payment-logos img {
    height: 28px;
    margin: 0 6px;
  }

}


