/* ==============================
   VARIABLES BASE
============================== */
:root {
  --primary-color: #D96523;
  --secondary-color: #D96523;
  --accent-color: #D95323;
  --text-color: #0D0D0D;
  --background-color: #F2D4AE;
  --gray-light: #f4f4f4;
  --gray-dark: #555;

  --max-width: 1200px;
  --transition: all 0.3s ease-in-out;
  --font-primary: 'Poppins', sans-serif;
}

/* ==============================
   RESETEO GENERAL
============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html{
    scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.6;
}

img {
  width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ==============================
   HEADER
============================== */
.header {
  background: var(--gray-light);
  padding: 1rem 0 3rem;
  position: relative;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    flex-direction: row-reverse;
    align-content: center;
    justify-content: center;
    align-items: center;
}

.logo img {
  width: 40px;
  margin-left: 8px;
}

/* ======== NAV ======== */
.nav-list {
  display: flex;
  gap: 2rem;
}

.nav-list a {
  color: var(--text-color);
  font-weight: 500;
  transition: var(--transition);
}

.nav-list a:hover {
  color: var(--primary-color);
}

/* ======== MENU MÓVIL ======== */
.menu-toggle {
  display: none;
}

.menu-icon {
  display: none;
  width: 40px;
  cursor: pointer;
}

/* ======== CARRITO ======== */
.cart-container {
  position: relative;
}

.cart-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.cart-btn img {
  width: 40px;
  transition: transform 0.2s;
}

.cart-btn:hover img {
  transform: scale(1.1);
}

.cart-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 50px;
  background: var(--background-color);
  border: 1px solid #ddd;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  width: auto;
  z-index: 1000;
}

.cart-container:hover .cart-dropdown {
  display: block;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.cart-table th,
.cart-table td {
  border-bottom: 1px solid #eee;
  padding: 0.5rem;
}

.btn-vaciar {
  display: block;
  background: var(--secondary-color);
  color: #fff;
  border: none;
  padding: 0.7rem;
  width: 100%;
  cursor: pointer;
  transition: var(--transition);
}

.btn-vaciar:hover {
  background: var(--primary-color);
}

/* ==============================
   HERO SECTION
============================== */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 2rem;
  gap: 2rem;
}

.hero-text {
  flex: 1;
  min-width: 280px;
}

.hero-text span {
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 1.1rem;
}

.hero-text h1 {
  font-size: 2.5rem;
  color: var(--text-color);
  margin: 1rem 0;
}

.hero-text p {
  color: var(--gray-dark);
  margin-bottom: 1.5rem;
}

.buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--secondary-color);
}

.btn-secondary {
  background: var(--accent-color);
  color: #333;
}

.btn-secondary:hover {
  background: var(--gray-dark);
}

/* ==============================
   OFERTAS
============================== */
/* ==============================
   CARRUSEL DE OFERTAS
============================== */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  background: var(--gray-light);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.offer-item {
  min-width: 100%;
  position: relative;
  text-align: center;
}

.offer-item img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

.offer-text {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 1rem;
  position: absolute;
  bottom: 0;
  width: 100%;
  border-radius: 0 0 16px 16px;
}

.offer-text h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.offer-text a {
  color: var(--accent-color);
  font-weight: bold;
  text-decoration: underline;
  transition: color 0.3s;
}

.offer-text a:hover {
  color: var(--primary-color);
}

/* ======== Botones Flecha ======== */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
  transition: background 0.3s;
}

.carousel-btn:hover {
  background: var(--secondary-color);
}

.carousel-btn.prev {
  left: 10px;
}

.carousel-btn.next {
  right: 10px;
}

/* ======== Indicadores (puntos) ======== */
.carousel-indicators {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 8px;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: #ccc;
  cursor: pointer;
  transition: background 0.3s;
}

.carousel-indicators button.active {
  background: var(--primary-color);
}

/* ======== Responsive ======== */
@media (max-width: 768px) {
  .offer-item img {
    height: 260px;
  }

  .offer-text h3 {
    font-size: 1.1rem;
  }

  .carousel-btn {
    font-size: 1.5rem;
    padding: 0.4rem 0.8rem;
  }
}


/* ==============================
   PRODUCTOS
============================== */
.products {
  padding: 3rem 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--gray-light);
  border-radius: 12px;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: var(--transition);
}

.product-card img {
  border-radius: 12px;
  width: 100%;
  object-fit: cover;
}

.product-card:hover {
  transform: scale(1.03);
}

.product-card h3 {
  margin: 0.5rem 0;
}

.price {
  color: var(--secondary-color);
  font-weight: 700;
  font-size: 1.1rem;
}

.btn-agregar {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-agregar:hover {
  background: var(--secondary-color);
}
.categoria-section {
    margin-bottom: 2rem;
}

.categoria-titulo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    border-left: 5px solid #27ae60;
    padding-left: 10px;
}

.btn-comprar {
    background-color: #27ae60;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    margin-top: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
}

.btn-comprar:hover {
    background-color: #2ecc71;
}


/* ==============================
   FOOTER
============================== */
.footer {
  background: var(--secondary-color);
  color: #fff;
  padding: 2rem 0;
  text-align: center;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: #fff;
  font-weight: 500;
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--accent-color);
}

/* ==============================
   RESPONSIVE DESIGN
============================== */

/* TABLET */
@media (max-width: 992px) {
  .header-container {
    flex-wrap: wrap;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    background: var(--background-color);
    position: absolute;
    top: 70px;
    right: 10px;
    border: 1px solid #ddd;
    padding: 1rem;
  }

  .menu-icon {
    display: block;
  }

  .menu-toggle:checked ~ .nav .nav-list {
    display: flex;
  }

  .hero {
    flex-direction: column;
    text-align: center;
  }

  .buttons {
    justify-content: center;
  }
}

/* MÓVIL */
@media (max-width: 600px) {
  .logo {
    font-size: 1.5rem;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .offer-item, .product-card {
    padding: 0.8rem;
  }

  .cart-dropdown {
    width: 90vw;
  }
}



/* ============================= */
/* PANEL LATERAL DEL CARRITO */
/* ============================= */
.cart-panel {
  position: fixed;
  top: 0;
  right: -420px; /* fuera de la pantalla */
  width: 400px;
  height: 100%;
  background: #fff;
  box-shadow: -3px 0 10px rgba(0,0,0,0.25);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.4s ease;
}

.cart-panel.open {
  right: 0; /* se desliza dentro de la vista */
}

.cart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #27ae60;
  color: white;
  padding: 1rem;
}

.cart-panel-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
}

.cart-panel-footer {
  padding: 1rem;
  border-top: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th,
.cart-table td {
  text-align: center;
  padding: 6px;
}

.cart-table img {
  width: 40px;
  border-radius: 5px;
}

.btn-vaciar,
.btn-comprar {
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.btn-vaciar {
  background: #e74c3c;
  color: #fff;
}

.btn-vaciar:hover {
  background: #c0392b;
}

.btn-comprar {
  background: #27ae60;
  color: white;
}

.btn-comprar:hover {
  background: #2ecc71;
}

.cerrar-carrito {
  background: transparent;
  color: white;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 900;
  display: none;
  transition: opacity 0.3s ease;
}

.overlay.visible {
  display: block;
}
