/* ========== FUENTES ========== */

@font-face {
  font-family: 'Alte Haas Grotesk';
  src: url('font/AlteHaasGroteskBold.woff2') format('woff2'),
       url('font/AlteHaasGroteskBold.woff') format('woff'),
       url('font/AlteHaasGroteskBold.ttf') format('truetype'),
       url('font/AlteHaasGroteskBold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'AstonScript';
  src: url('font/AstonScript.woff2') format('woff2'),
       url('font/AstonScript.woff') format('woff'),
       url('font/AstonScript.ttf') format('truetype'),
       url('font/AstonScript.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ========== VARIABLES ========== */

:root {
  --font-logo: 'AstonScript', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;

  --bg: #fdf8f3;
  --field: #f0ebe4;
  --text: #2c2c2c;
  --text-soft: #444;
  --green: #2e7d32;
  --green-dark: #1e4d2b;
  --accent: #e65100;
  --line: rgba(30, 77, 43, 0.1);
}


/* ========== RESET Y BASE ========== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

input,
button {
  font-family: inherit;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}


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

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Fila superior */

.header-top .header-container {
  height: 68px;
  display: grid;
  grid-template-columns: 1fr minmax(0, 460px) 1fr;
  align-items: center;
  gap: 24px;
}

/* Logo */

.logo {
  text-decoration: none;
  justify-self: start;
}

.logo-text {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--green-dark);
}

/* Buscador */

.search-form {
  display: flex;
  align-items: center;
  background: var(--field);
  border-radius: 50px;
  padding: 5px 5px 5px 18px;
}

.search-form:focus-within {
  background: white;
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 14px;
  padding: 8px 10px;
  outline: none;
  color: var(--text);
}

.search-form input::placeholder {
  color: #999;
}

.search-form button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.search-form button:hover {
  background: var(--green-dark);
}

/* Botones de la derecha */

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-text {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  transition: 0.2s;
}

.btn-text:hover {
  color: var(--green);
  background: rgba(46, 125, 50, 0.08);
}

.btn-register {
  background: var(--green);
  color: white;
  padding: 8px 16px;
}

.btn-register:hover {
  background: var(--green-dark);
  color: white;
}

/* Carrito */

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.cart-btn:hover {
  color: var(--green);
  background: rgba(46, 125, 50, 0.08);
}

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Navegación */

.header-bottom {
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.header-bottom .header-container {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav {
  display: flex;
  gap: 40px;
}

.nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  padding: 6px 0;
  transition: 0.2s;
}

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

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: 0.25s;
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

.nav a.active {
  color: var(--green);
}


/* ========== INICIO / BANNER ========== */

.hero {
  width: 100%;
  margin: 0;
  padding: 0;
}

.hero img {
  width: 100%;
  height: auto;
  display: block;
}


/* ========== PRODUCTOS Y CATEGORÍAS ========== */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 96px;
}

/* Tarjetas de categorías */

.category-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
}

.category-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.category-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  background: var(--field);
  overflow: hidden;
  flex-shrink: 0;
}

.category-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.category-card:hover .category-img img {
  transform: scale(1.05);
}

.category-card h3 {
  margin-top: 14px;
  min-height: 34px;
  font-family: var(--font-logo);
  font-size: 26px;
  font-weight: 400;
  color: var(--green-dark);
  transition: color 0.2s;
}

.category-card:hover h3 {
  color: var(--green);
}

.category-title {
  font-family: var(--font-logo);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 400;
  color: var(--green-dark);
  padding-bottom: 14px;
  margin-bottom: 28px;
}

/* Grilla de productos */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card h3 {
  font-size: 15px;
  font-weight: 500;
  margin-top: 12px;
}

.product-card p {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 2px;
}

.product-img {
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--field);
}


/* ========== CARRITO ========== */

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

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

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100%;
  height: 100%;
  background: var(--bg);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: 0.35s;
  z-index: 1200;
  display: flex;
  flex-direction: column;
}

.cart-panel.active {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}

.cart-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--green-dark);
}

.cart-close {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #999;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.cart-close:hover {
  background: rgba(46, 125, 50, 0.08);
  color: #333;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.cart-empty {
  text-align: center;
  padding: 80px 20px;
  color: #888;
}

.cart-empty p {
  font-size: 16px;
  margin-bottom: 6px;
  color: #555;
}

.cart-footer {
  padding: 24px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.cart-footer[hidden] {
  display: none;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 16px;
}

.btn-checkout {
  width: 100%;
  background: var(--green);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-checkout:hover {
  background: var(--green-dark);
}


/* ========== FOOTER ========== */

.footer {
  background: var(--green-dark);
  color: #fdf8f3;
  margin-top: 40px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 32px 52px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
  gap: 48px;
}

/* Marca */

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 18px;
  color: #fdf8f3;
  font-family: var(--font-logo);
  font-size: 32px;
  font-weight: 700;
  text-decoration: none;
}

.footer-brand p {
  max-width: 280px;
  color: rgba(253, 248, 243, 0.75);
  font-size: 14px;
  line-height: 1.8;
}

.footer-grupolimp {
  display: inline-block;
  margin-top: 20px;
  color: #f4b17f;
  font-size: 13px;
  text-decoration: none;
}

/* Columnas */

.footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
}

.footer-column h3 {
  margin-bottom: 8px;
  color: #f4b17f;
  font-family: var(--font-logo);
  letter-spacing: 1px;
  font-size: 19px;
  font-weight: 500;
}

.footer-column a {
  color: rgba(253, 248, 243, 0.8);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-column a:hover,
.footer-grupolimp:hover {
  color: #f4b17f;
}

/* Contacto */

.footer-contact p {
  color: rgba(253, 248, 243, 0.75);
  font-size: 14px;
  line-height: 1.7;
}

.footer-column .footer-whatsapp {
  display: inline-block;
  margin-top: 5px;
  padding: 12px 17px;
  border: 1px solid rgba(244, 177, 127, 0.65);
  border-radius: 8px;
  color: #f4b17f;
  transition: background 0.2s ease, color 0.2s ease;
}

.footer-column .footer-whatsapp:hover {
  background: #f4b17f;
  color: var(--green-dark);
}

/* Franja inferior */

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 32px;
  border-top: 1px solid rgba(253, 248, 243, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-bottom p,
.footer-bottom a {
  color: rgba(253, 248, 243, 0.65);
  font-size: 12px;
}

.footer-bottom a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: #f4b17f;
}

.footer-credit {
  color: #f4b17f !important;
  font-size: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-credit:hover {
  opacity: 0.7;
}


/* ========== ANIMACIONES AESTHETIC ========== */

/* Animaciones de entrada */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes soft-drop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Entrada del encabezado */

.header {
  animation: soft-drop 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.logo {
  animation: fade-in 0.8s ease both;
}

.search-form {
  animation: fade-up 0.7s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.header-actions {
  animation: fade-in 0.7s 0.12s ease both;
}

/* Navegación */

.nav a {
  transition: color 0.25s ease, transform 0.25s ease;
}

.nav a:hover {
  transform: translateY(-2px);
}

/* Banner */

.hero img {
  animation: fade-in 1s 0.12s ease both;
}

/* Categorías */

.category-title {
  animation: fade-up 0.75s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.category-card {
  animation: fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.category-card:nth-child(1) {
  animation-delay: 0.12s;
}

.category-card:nth-child(2) {
  animation-delay: 0.24s;
}

.category-card:nth-child(3) {
  animation-delay: 0.36s;
}

.category-img {
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.category-card:hover .category-img {
  box-shadow: 0 14px 30px rgba(30, 77, 43, 0.12);
  transform: translateY(-4px);
}

.category-card h3 {
  transition: color 0.25s ease, transform 0.3s ease;
}

.category-card:hover h3 {
  transform: translateY(-2px);
}

/* Transiciones suaves para controles */

.search-form,
.search-form button,
.btn-text,
.cart-btn,
.btn-checkout,
.cart-close,
.footer-whatsapp {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.search-form:focus-within {
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.search-form button:hover,
.btn-checkout:hover,
.footer-whatsapp:hover {
  transform: translateY(-2px);
}

.btn-text:hover,
.cart-btn:hover,
.cart-close:hover {
  transform: translateY(-1px);
}

.cart-btn:active,
.search-form button:active,
.btn-checkout:active {
  transform: scale(0.96);
}

/* Footer */

.footer {
  animation: fade-in 1s ease both;
}

.footer-logo,
.footer-column a,
.footer-grupolimp,
.footer-credit,
.footer-bottom a {
  transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.footer-logo:hover,
.footer-column a:hover,
.footer-grupolimp:hover,
.footer-credit:hover,
.footer-bottom a:hover {
  transform: translateY(-2px);
}

/* Animaciones al aparecer en pantalla, en navegadores compatibles */

@supports (animation-timeline: view()) {
  .category-card {
    animation: fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }

  .footer {
    animation: fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-timeline: view();
    animation-range: entry 0% entry 25%;
  }
}

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

@media (max-width: 768px) {

  /* Header */

  .header-top .header-container {
    height: 60px;
    padding: 0 16px;
    grid-template-columns: 1fr auto;
  }

  .logo-text {
    font-size: 22px;
  }

  .search-form,
  .btn-text {
    display: none;
  }

  .header-bottom .header-container {
    height: 42px;
    padding: 0 16px;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .nav {
    gap: 24px;
  }

  .nav a {
    white-space: nowrap;
    font-size: 13.5px;
  }

  /* Carrito */

  .cart-panel {
    width: 100%;
  }

  /* Contenido */

  html {
    scroll-padding-top: 108px;
  }

  .page {
    padding: 16px 16px 64px;
  }

  .category-cards {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Footer */

  .footer-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 24px;
    padding: 44px 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: 400px;
  }

  .footer-bottom {
    padding: 20px 24px;
  }
}

@media (max-width: 420px) {

  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 38px 22px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 20px 22px;
  }
}


/* ========== ACCESIBILIDAD ========== */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


/* ========== PÁGINA DE CONTACTO ========== */

.contact-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0 80px;
}

.contact-intro {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 45px;
}

.contact-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  color: var(--green-dark);
  margin: 0 0 14px;
}

.contact-intro p {
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.8;
  margin: 0;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 35px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.contact-form label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 15px;
  border: 1px solid rgba(30, 77, 43, 0.18);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.contact-form input,
.contact-form select {
  min-height: 48px;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.08);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #999;
}

.contact-form .btn-checkout {
  width: 100%;
  min-height: 50px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.contact-form .btn-checkout:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.contact-form .form-message {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--green-dark);
}

.contact-info {
  padding: 15px 0;
}

.contact-info > h2 {
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--green-dark);
  margin: 0 0 30px;
}

.contact-info-item {
  padding: 0 0 25px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.contact-info-item:last-child {
  border-bottom: none;
}

.contact-info-item h3 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
}

.contact-info-item p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-soft);
  margin: 0 0 15px;
}

.contact-info-item > a:not(.footer-whatsapp) {
  color: var(--green-dark);
  font-family: var(--font-body);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-info-item > a:not(.footer-whatsapp):hover {
  color: var(--green);
}

.contact-info-item .footer-whatsapp {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 14px;
  text-decoration: none;
}

/* Animación al aparecer */

.contact-intro,
.contact-form,
.contact-info {
  animation: contact-entrance 0.7s ease both;
}

.contact-form {
  animation-delay: 0.1s;
}

.contact-info {
  animation-delay: 0.2s;
}

@keyframes contact-entrance {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */

@media (max-width: 760px) {
  .contact-content {
    padding: 10px 0 55px;
  }

  .contact-intro {
    margin-bottom: 30px;
    padding: 0 10px;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .contact-form {
    padding: 25px 20px;
  }

  .contact-info {
    padding: 10px 5px;
  }

  .contact-info > h2 {
    font-size: 25px;
  }
}

@media (max-width: 420px) {
  .contact-form {
    padding: 20px 15px;
    gap: 18px;
  }

  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-intro,
  .contact-form,
  .contact-info {
    animation: none;
  }
}


/* ========== DISEÑO DE PRODUCTOS GARDENIA ========== */

.product-grid,
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 22px;
  align-items: stretch;
}

/* Tarjeta */
.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding-bottom: 18px;
  background: #fffdf9;
  border: 1px solid rgba(30, 77, 43, 0.10);
  border-radius: 15px;
  box-shadow: 0 4px 14px rgba(30, 77, 43, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(30, 77, 43, 0.10);
}

/* Contenedor de imagen */
.product-image,
.product-img {
  width: 100%;
  height: 260px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

/* Imagen completa, sin recortes */
.product-image img,
.product-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.35s ease;
}

.product-card:hover .product-image img,
.product-card:hover .product-img img {
  transform: scale(1.035);
}

/* Información */
.product-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  padding: 16px 16px 0;
}

.product-card h3 {
  margin: 0;
  color: var(--green-dark);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Precio */
.product-card .product-price,
.product-card p {
  margin-top: 8px;
  color: var(--green-dark);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

/* Disponibilidad */
.product-stock {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 30px;
  background: #edf4e9;
  color: #35643b;
  font-size: 11px;
  font-weight: 600;
}

.product-stock.sin-stock {
  background: #f7e9e5;
  color: #a33f32;
}

/* Botón */
.product-add-btn {
  width: calc(100% - 32px);
  margin: 18px 16px 0;
  padding: 12px 10px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.product-add-btn:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-2px);
}

.product-add-btn:disabled {
  border-color: #e4ded6;
  background: #eee9e2;
  color: #8a837b;
  cursor: not-allowed;
}

/* Imagen ausente */
.product-image.image-unavailable,
.product-img.image-unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0ebe4;
}

.product-image.image-unavailable::after,
.product-img.image-unavailable::after {
  content: 'Gardenia';
  color: var(--green-dark);
  font-family: var(--font-logo);
  font-size: 28px;
}

/* Mensaje sin productos */
.no-products {
  grid-column: 1 / -1;
  padding: 40px 20px;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.7;
  text-align: center;
}

.no-products[hidden] {
  display: none;
}

/* Tablet */
@media (max-width: 900px) {
  .product-grid,
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 16px;
  }

  .product-image,
  .product-img {
    height: 230px;
  }
}

/* Celular */
@media (max-width: 600px) {
  .product-grid,
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }

  .product-card {
    border-radius: 12px;
    padding-bottom: 13px;
  }

  .product-image,
  .product-img {
    height: 180px;
    padding: 8px;
  }

  .product-info {
    padding: 12px 11px 0;
  }

  .product-card h3 {
    font-size: 13px;
  }

  .product-card .product-price,
  .product-card p {
    font-size: 15px;
  }

  .product-add-btn {
    width: calc(100% - 22px);
    margin: 14px 11px 0;
    padding: 10px 5px;
    font-size: 12px;
  }
}

/* Animaciones suaves */
@media (prefers-reduced-motion: no-preference) {
  .product-card {
    animation: gardenia-product-appear 0.5s ease both;
  }

  @keyframes gardenia-product-appear {
    from {
      opacity: 0;
      transform: translateY(10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}


/* Tarjetas que abren el detalle del producto */

.product-card-clickable {
  cursor: pointer;
}

.product-card-clickable:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}


/* Botón para finalizar la compra */
.cart-checkout-button {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px 18px;
  border: none;
  background: var(--green-dark);
  color: white;
  font: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.cart-checkout-button:hover {
  opacity: 0.85;
}

.cart-checkout-button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}


/* ========================================
   CARRITO LATERAL - GARDENIA
======================================== */

/* Panel del carrito */
#cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100vh;
  height: 100dvh;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: -8px 0 35px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 0.35s ease,
    visibility 0.35s ease;
}

/* Abrir el carrito */
#cart-panel.active {
  transform: translateX(0);
  visibility: visible;
}

/* Fondo oscuro */
#cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(25, 35, 27, 0.42);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

#cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Encabezado del carrito */
#cart-panel .cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

#cart-panel .cart-header h2,
#cart-panel .cart-header h3 {
  margin: 0;
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
}

/* Botón de cerrar */
#cart-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

#cart-close:hover {
  background: var(--green-dark);
  color: #fff;
}

/* Zona de productos */
#cart-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 24px 20px;
  overscroll-behavior: contain;
}

/* Cada producto */
#cart-body .cart-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

/* Foto sin recortar */
#cart-body .cart-item > img {
  display: block;
  width: 88px;
  height: 105px;
  padding: 5px;
  box-sizing: border-box;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

/* Información */
#cart-body .cart-item-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

#cart-body .cart-item-info p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#cart-body .cart-item-info span {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

#cart-body .cart-item-info strong {
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 700;
}

/* Botón quitar */
#cart-body .cart-item-remove {
  padding: 3px 0;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #8b5147;
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

#cart-body .cart-item-remove:hover {
  border-bottom-color: currentColor;
}

/* Carrito vacío */
#cart-body .cart-empty {
  margin: 30px 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

/* Pie y total */
#cart-footer {
  flex-shrink: 0;
  padding: 22px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.025);
}

#cart-footer[hidden] {
  display: none;
}

#cart-total {
  display: block;
  margin-bottom: 18px;
  color: var(--green-dark);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
}

/* Botón finalizar compra */
#cart-checkout-button {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--green-dark);
  background: var(--green-dark);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

#cart-checkout-button:hover {
  background: transparent;
  color: var(--green-dark);
}

/* Adaptación para celulares */
@media (max-width: 480px) {
  #cart-panel {
    width: 100%;
  }

  #cart-panel .cart-header {
    padding: 20px;
  }

  #cart-body {
    padding-right: 20px;
    padding-left: 20px;
  }

  #cart-body .cart-item {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 13px;
    padding: 17px 0;
  }

  #cart-body .cart-item > img {
    width: 76px;
    height: 92px;
  }

  #cart-footer {
    padding: 18px 20px;
  }
}


/* ========================================
   MENU HAMBURGUESA - GARDENIA
======================================== */

/* Botón hamburguesa: oculto en escritorio */
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 2px;
  background: var(--green-dark);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Admin visible en escritorio */
.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Solo celulares y tablets */
@media (max-width: 768px) {
  .header-top .header-container {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Mostrar Admin en celular */
  .header-actions .admin-link {
    display: inline-flex;
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Mostrar hamburguesa */
  .menu-toggle {
    display: flex;
    flex-shrink: 0;
  }

  /* La navegación se convierte en menú desplegable */
  .header-bottom {
    position: relative;
  }

  .header-bottom .header-container {
    height: auto;
    padding: 0;
    overflow: visible;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1100;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 20px 18px;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 20px rgba(30, 77, 43, 0.08);
  }

  .nav.menu-open {
    display: flex;
  }

  .nav a {
    display: block;
    padding: 13px 4px;
    white-space: normal;
    font-size: 14px;
    border-bottom: 1px solid var(--line);
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .nav a:hover {
    transform: none;
  }

  /* Animación de las tres líneas */
  .menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}


