:root { --brand: #111827; --accent: #e11d48; }
body {
  background: #f7f7f8;
  overflow-x: hidden;   /* previene scroll horizontal por desborde de elementos */
}
.navbar-brand { letter-spacing:.5px; }
.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.75);
}
.navbar-dark .navbar-nav .nav-link.active,
.navbar-dark .navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 1);
}
.navbar-dark .form-control {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}
.navbar-dark .form-control::placeholder {
  color: rgba(255, 255, 255, 0.7);
}
.navbar-dark .btn-outline-action {
  color: white;
  border-color: white;
  white-space: nowrap;
}
.navbar-dark .btn-outline-action:hover {
  color: var(--brand);
  background-color: white;
}

/* Barra de búsqueda + carrito en móvil: ocupa ancho completo */
@media (max-width: 991.98px) {
  .navbar-right-tools {
    width: 100%;
  }
}

.card .price { color: var(--accent); font-weight:700; }

/* ── Grid de Productos ────────────────────────────────────────
   Breakpoints:
   xl ≥1200px → 4 columnas fijas
   lg  992-1199px → auto (3-4 col, minmax 260px)
   md  768-991px  → 3 columnas
   sm  500-767px  → 2 columnas
   xs  <500px     → 1 columna
───────────────────────────────────────────────────────────── */
#promocionesGrid,
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* xl+: exactamente 4 columnas en desktops grandes */
@media (min-width: 1200px) {
  #promocionesGrid,
  #grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* md: 3 columnas en tablet landscape */
@media (min-width: 768px) and (max-width: 991.98px) {
  #promocionesGrid,
  #grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

/* ── Móvil: siempre 2 columnas en ≤767px ───────────────────── */
@media (max-width: 767.98px) {
  #promocionesGrid,
  #grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* min-width: 0 es CRÍTICO en CSS Grid: sin esto los ítems no se
     encogen debajo de su contenido mínimo y desbordan el viewport */
  #promocionesGrid > *,
  #grid > * {
    min-width: 0;
    overflow: hidden;
  }
}

/* Product-specific card styles for tienda.php */
.product-item-card {
  width: 100%;
  overflow: hidden;          /* evita que contenido interno desborde la card */
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.product-item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 1rem 3rem rgba(0,0,0,.175)!important;
}

/* El <a> que envuelve la imagen DEBE ser block para no romper el grid */
.product-item-card > a {
  display: block;
  overflow: hidden;
  line-height: 0;   /* elimina espacio extra debajo de la imagen */
}

.product-item-card .card-img-top {
  display: block;
  width: 100%;
  max-width: 100%;           /* seguro: nunca más ancho que su contenedor */
  height: 190px;
  object-fit: cover;
}

/* Tablet portrait (768-991px): 3 col → imagen un poco más corta */
@media (min-width: 768px) and (max-width: 991.98px) {
  .product-item-card .card-img-top {
    height: 160px;
  }
}

/* ── Móvil: 2 columnas (≤767px) — diseñado desde cero ──────────
   Cubre todos los iPhones modernos (SE, 12 mini, 14, 16 Pro Max)
   Prioridad: legibilidad, botones tocables (≥44px), texto ≥0.85rem
─────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .product-item-card .card-img-top {
    height: 140px;
    object-fit: cover;
  }
  .product-item-card .card-body {
    padding: 0.6rem 0.65rem;
  }
  .product-item-card .card-title {
    font-size: 0.88rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    /* limitar a 2 líneas para consistencia */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .product-item-card .card-text {
    font-size: 0.77rem;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .product-item-card .price {
    font-size: 1rem !important;
    display: block;
    margin-bottom: 0.4rem;
  }
  .product-item-card .btn-gradient {
    display: block;
    width: 100%;
    min-height: 42px;        /* Apple HIG mínimo táctil */
    font-size: 0.82rem;
    padding: 8px 6px;
    text-align: center;
  }
}

/* Micro-ajuste para iPhone SE / Mini (≤375px) */
@media (max-width: 375px) {
  .product-item-card .card-img-top {
    height: 115px;
  }
  .product-item-card .card-title {
    font-size: 0.82rem;
  }
  .product-item-card .btn-gradient {
    min-height: 40px;
    font-size: 0.78rem;
  }
}

/* Transición suave en todas las cards */
.card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
/* El hover elevado solo aplica a las tarjetas de producto y testimonios */
.product-item-card:hover,
.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 1rem 3rem rgba(0,0,0,.175) !important;
}

.badge-filter {
  cursor:pointer;
  padding: 8px 12px;
  font-size: 1.1em;
}
.testimonial-card {
  border-radius: 10px;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 1rem 3rem rgba(0,0,0,.175)!important;
}
.testimonial-card .blockquote-footer {
  color: var(--brand);
  font-weight: bold;
}

/* --- Custom Button Styles --- */
.btn-gradient {
  background-image: linear-gradient(45deg, var(--brand) 0%, var(--accent) 100%);
  border: none;
  color: white;
  font-weight: bold;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-gradient:hover {
  color: white !important;
}

.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(45deg, var(--accent) 0%, var(--brand) 100%);
  transition: all 0.3s ease;
  z-index: -1;
  opacity: 0;
}

.btn-gradient:hover::before {
  opacity: 1;
}

.btn-action {
  padding: 12px 25px;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.btn-outline-action {
  background: transparent;
  border: 2px solid var(--brand);
  color: var(--brand);
  padding: 10px 20px;
  border-radius: 5px;
}

.btn-outline-action:hover {
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-outline-action::before {
  background-image: linear-gradient(45deg, var(--brand) 0%, var(--accent) 100%);
}

/* Floating Cart Button */
.floating-cart-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1050;
}

.floating-cart-btn .btn-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 25px;
  border-radius: 50px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.floating-cart-btn .btn-action span {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  padding: 4px 8px;
  font-size: 0.8em;
}

/* Hero Slider */
.hero-slider-section {
  position: relative;
}

.hero-slider-container {
  display: flex;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-slide {
  flex: 0 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .hero-slide {
    width: 50%;
  }
}

@media (min-width: 992px) {
  .hero-slide {
    width: 33.333%;
  }
}

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

/* Cart Notification */
.cart-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  background-color: #28a745;
  color: white;
  border-radius: 8px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cart-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Wave Divider */
.wave-divider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

.wave-divider .shape-fill {
    fill: var(--brand);
}

/* CTA Section */
.cta-section {
    background-image: url('../fotos/Sushi-fondo.webp');
    background-size: cover;
    background-position: center;
    padding: 100px 0;
    position: relative;
    color: white;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.cta-section .container {
    position: relative;
    z-index: 2;
}

/* Improved Testimonial Card */
.testimonial-card {
  border: 0;
  background-color: #fff;
  position: relative;
  overflow: hidden;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 10px;
  font-size: 100px;
  color: var(--accent);
  opacity: 0.1;
  line-height: 1;
  z-index: 1;
}

.testimonial-card .card-body {
  position: relative;
  z-index: 2;
}

.testimonial-card .card-text {
  font-size: 1.05rem;
  font-style: italic;
  color: #555;
}

.testimonial-card .blockquote-footer {
  color: var(--accent);
  font-weight: bold;
}

/* Hero Section for Inner Pages */
.hero {
  position: relative;
  overflow: hidden;
}

.hero .hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  filter: saturate(1.05) contrast(1.05);
}

.hero .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.hero .content {
  position: relative;
  z-index: 2;
}

.text-accent {
  color: var(--accent) !important;
}

.map-responsive {
  overflow:hidden;
  padding-bottom:56.25%;
  position:relative;
  height:0;
}
.map-responsive iframe {
  left:0;
  top:0;
  height:100%;
  width:100%;
  position:absolute;
}

/* Presentation Section */
.presentation-section {
  background-color: #1d1d1d;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  transition: opacity 0.6s ease-out, height 0.6s ease-out;
  overflow: hidden;
}

.presentation-section.hidden {
  opacity: 0;
  min-height: 0;
  height: 0;
  padding: 0;
}

.presentation-logo {
  max-width: 450px;
}

/* Fade-in animation for hidden sections */
.fade-in-section {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.fade-in-section.show {
  opacity: 1;
}

/* Override Bootstrap's d-none when show class is present */
.fade-in-section.show.d-none {
  display: block !important;
}

/* ── Carrito de Compras ────────────────────────────────────────
   cart.php — tarjetas responsivas generadas por cart.js
──────────────────────────────────────────────────────────────*/

/* Panel resumen: sticky en desktop */
.cart-summary-card {
  position: sticky;
  top: 80px;
}

.cart-item-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: box-shadow .15s ease;
}

.cart-item-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* Imagen del producto */
.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid #eee;
}

/* Placeholder cuando no hay imagen */
.cart-item-img--placeholder {
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 1.8rem;
}

.cart-item-name {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.3;
  word-break: break-word;
}

.cart-item-unit-price {
  font-size: .8rem;
  color: #6c757d;
}

.cart-item-subtotal {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  white-space: nowrap;
}

.cart-qty-btn {
  width: 32px;
  padding: 0;
  line-height: 1.6;
}

.cart-qty-display {
  min-width: 40px;
  text-align: center;
}

/* Carrito en móvil pequeño (<500px) */
@media (max-width: 499.98px) {
  .cart-item-card {
    padding: 10px 12px;
  }
  .cart-item-img {
    width: 60px;
    height: 60px;
  }
  .cart-item-name {
    font-size: .85rem;
  }
  .cart-item-subtotal {
    font-size: .9rem;
  }
}
