/* =====================
   RESET
===================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =====================
   VARIABLES
===================== */
:root {
  --color-bg: #ffffff;
  --color-text: #000000;
}

/* =====================
   BASE
===================== */
html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-family:'Montserrat', sans-serif;
  font-family:'Inter', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

/* =====================
   MEDIA DEFAULT
===================== */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* =====================
   FORM RESET
===================== */
input,
button,
textarea,
select {
  font: inherit;
}

/* =====================
   LINKS & BUTTONS
===================== */
a {
  text-decoration: none;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* ====================================================================================
   DESARROLLO DE LA PÁGINA WEB
==================================================================================== */
.actions a,
.secondary-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-btn i {
  font-size: 16px;
}

/* ================================
   HEADER
================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.container {
  width: 95%;
  max-width: 1300px;
  margin: 0 auto;
}

/* ================================
   TOPBAR
================================ */

.topbar {
  background: #e30613;
  padding: 6px 0;
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo-desktop img {
  height: 50px;
  height: 60px;
}

.logo-mobile{
  display: none;
}

.search {
  flex: 1;
  display: flex;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  max-width: 600px;
}

.search input {
  flex: 1;
  padding: 12px 18px;
  border: none;
  outline: none;
}

.search-btn {
  padding: 0 20px;
  background: #e30613;
  color: white;
  font-size: 18px;
}

.actions {
  display: flex;
  gap: 25px;
}

.actions a {
  color: white;
  font-weight: 500;
  font-size: 14px;
}

/* ================================
   SUBBAR
================================ */

.subbar {
  background: #f2f2f2;
  background: #fff;
  background: #ffffff;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.subbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.categories-btn {
  font-weight: 600;
}

.secondary-nav {
  display: flex;
  gap: 25px;
}

.secondary-nav a {
  color: #333;
  font-size: 14px;
}

.secondary-nav a.sucursales{
  color:#e30613;
  font-weight:600;
}

/* ================================
   MOBILE
================================ */

.mobile-menu-btn {
  display: none;
  font-size: 22px;
  color: white;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: white;
  padding: 80px 20px;
  transition: 0.3s ease;
  z-index: 2000;
}

.mobile-drawer.active {
  left: 0;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 1500;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ================================
   RESPONSIVE
================================ */
/*Media querie para dispositivos moviles*/
/* Estilos específicos para pantallas pequeñas */
@media (max-width: 768px) {
  body {
    font-size: 0.875rem;
  }

  .logo-desktop{
    display: none;
  }
  
  .logo-mobile{
    display: flex;
  }

  .logo-mobile img {
    height: 50px;
    height: 50px;
  }
  
}

@media (max-width: 1024px) {

  .actions {
    display: none;
  }

  .secondary-nav {
    display: none;
  }

  .subbar {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .search {
    max-width: 100%;
  }

}

/*-------------------------------------------- Panel de categorias --------------------------------------------*/
/* ===============================
   PANEL CATEGORÍAS
=================================*/

.categories-panel{
  position:fixed;
  top:120px;
  left:0;
  width:100%;
  background:#fff;
  border-top:1px solid #eee;
  box-shadow:0 15px 40px rgba(0,0,0,.12);
  opacity:0;
  visibility:hidden;
  transform:translateY(10px);
  transition:.25s ease;
  z-index:999;
}

.categories-panel.show{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

/* wrapper */

.categories-wrapper{
  display:grid;
  grid-template-columns:260px 1fr;
  min-height:380px;
}

/* sidebar */

.categories-sidebar{
  border-right:1px solid #eee;
  padding:20px 0;
  background:#fafafa;
}

.cat-item{
  width:100%;
  padding:14px 24px;
  display:flex;
  justify-content:space-between;
  font-weight:500;
  color:#333;
  transition:.2s;
}

.cat-item:hover,
.cat-item.active{
  background:#eee;
}

/* content */

.categories-content{
  padding:30px 40px;
  display:grid;
}

.cat-content{
  display:none;
  grid-template-columns:repeat(3,1fr);
  gap:40px;
}

.cat-content.active{
  display:grid;
}

.col h4{
  margin-bottom:12px;
  font-size:15px;
}

.col a{
  display:block;
  color:#555;
  padding:4px 0;
  font-size:14px;
}

.col a:hover{
  color:#e30613;
}

/* ===============================
   MOBILE
=================================*/

@media(max-width:1024px){

  .categories-panel{
    top:0;
    height:100vh;
    overflow:auto;
  }

  .categories-wrapper{
    grid-template-columns:1fr;
  }

  .categories-sidebar{
    border-right:none;
  }

  .cat-content{
    grid-template-columns:1fr;
    gap:20px;
    padding-top:10px;
  }

}

/*-------------------------------------------- Main --------------------------------------------*/
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f3f4f6;
}

/* 🔥 MÁS ANCHO */
.container-carrito {
  width: 95%;
  max-width: 1400px;
  margin: auto;
  padding: 30px 0;
}

h1 {
  margin-bottom: 25px;
  font-size: 28px;
}

/* GRID */
.carrito-grid {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 30px;
  align-items: start;
}

/* PRODUCTOS */
.productos {
  background: white;
  border-radius: 12px;
  overflow: hidden;
}

/* ITEM */
.producto {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 20px;
  padding: 20px;
  align-items: center;
  border-bottom: 1px solid #eee;
  transition: 0.2s;
}

.producto:hover {
  background: #fafafa;
}

.producto img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  background: #eee;
}

/* INFO */
.info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nombre {
  font-weight: 600;
  font-size: 17px;
}

/* CONTADOR */
.cantidad-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contador {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.contador button {
  background: #f1f1f1;
  border: none;
  width: 35px;
  height: 35px;
  cursor: pointer;
  font-size: 18px;
}

.contador span {
  width: 40px;
  text-align: center;
  line-height: 35px;
  background: white;
  font-weight: 500;
}

/* ELIMINAR */
.btn-eliminar {
  background: none;
  border: none;
  color: #777;
  font-size: 13px;
  cursor: pointer;
}

.btn-eliminar:hover {
  color: #e30613;
}

/* PRECIO */
.precio {
  font-weight: bold;
  font-size: 18px;
}

/* RESUMEN */
.resumen {
  background: white;
  padding: 25px;
  border-radius: 12px;
  height: fit-content;

  /* 🔥 ESTILO ECOMMERCE REAL */
  position: sticky;
  top: 20px;
}

.resumen h2 {
  margin-bottom: 20px;
}

.linea, .total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.total {
  font-weight: bold;
  font-size: 20px;
  margin-top: 15px;
}

/* BOTÓN */
.btn-pagar {
  width: 100%;
  padding: 16px;
  background: #e30613;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  font-size: 15px;
}

.btn-pagar:hover {
  background: #c00510;
}

.resumen > div i{
  color: #c00510;
}

/* CARRITO VACÍO */
.carrito-vacio {
  padding: 60px;
  text-align: center;
}

/* 📱 TABLET */
@media (max-width: 900px) {
  .carrito-grid {
    grid-template-columns: 1fr;
  }

  .resumen {
    position: static;
  }
}

/* 📱 MOBILE */
@media (max-width: 600px) {
  .container-carrito {
    width: 95%;
  }

  .producto {
    grid-template-columns: 1fr;
  }

  .producto img {
    width: 100%;
    height: 160px;
  }

  .precio {
    margin-top: 10px;
  }
}
