/* ===============================
   TOKENS — "Salsa Verde"
=================================*/

:root {
  /* Color */
  --color-hover-footer:#FF5B22;
  --color-brand: #4d7c3f;
  --color-brand-dark: #4d7c3f;
  --color-brand-rgb: 77, 124, 63;
  --color-accent: #FF5B22;
  --color-bg: #FCEDD6;
  --color-surface: #ffffff;
  --color-surface-sunken: #f1ebdd;
  --color-hight: #FF5B22;
  --color-hight-dark: #a22a02;

  /* Texto */
  --color-text-principal: #FCEDD6;
  --color-text-primary: #2b2620;
  --color-text-secondary: #5b5348;
  --color-text-tertiary: #8a8175;
  --color-text-muted: #b4ac9e;

  /* Bordes */
  --color-border-soft: rgba(43, 38, 32, 0.06);
  --color-border: rgba(43, 38, 32, 0.1);
  --color-border-strong: rgba(43, 38, 32, 0.18);

  /* Placeholder de imagen faltante */
  --color-placeholder-bg: #e4dccb;
  --color-placeholder-text: #8a8175;

  /* Sombras */
  --shadow-resting: 0 1px 3px rgba(43, 38, 32, 0.05);
  --shadow-hover: 0 12px 24px rgba(43, 38, 32, 0.1);
  --shadow-focus: 0 0 0 3px rgba(77, 124, 63, 0.25);

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Re-tema de Bootstrap (success -> verde tomatillo) */
  --bs-success: #4d7c3f;
  --bs-success-rgb: 77, 124, 63;

  /* Re-tema de las utilidades .shadow-sm / .shadow / .shadow-lg de Bootstrap,
       para que compartan la misma escala suave que el resto del sitio */
  --bs-box-shadow-sm: var(--shadow-resting);
  --bs-box-shadow: var(--shadow-hover);
  --bs-box-shadow-lg: 0 20px 40px rgba(43, 38, 32, 0.14);
}

/* ===============================
   MODO OSCURO
=================================*/

[data-bs-theme="dark"] {
  --color-brand: #6fa85c;
  --color-bg: #1c1814;
  --color-surface: #2b2620;
  --color-surface-sunken: #241f1a;

  --color-text-primary: #f1ebdd;
  --color-text-secondary: #b8ad9e;

  --color-border-soft: rgba(241, 235, 221, 0.06);
  --color-border: rgba(241, 235, 221, 0.1);
  --color-border-strong: rgba(241, 235, 221, 0.18);

  --shadow-resting: 0 1px 3px rgba(43, 38, 32, 0.24);
  --shadow-hover: 0 12px 24px rgba(43, 38, 32, 0.36);
  --bs-box-shadow-sm: var(--shadow-resting);
  --bs-box-shadow: var(--shadow-hover);
  --bs-box-shadow-lg: 0 20px 40px rgba(43, 38, 32, 0.45);

  /* Variables internas de Bootstrap: sin esto, componentes sin estilo propio
       (cards, offcanvas, modales, dropdowns) usan el gris frío por defecto de
       Bootstrap en vez de la paleta cálida del sitio. */
  --bs-body-bg: var(--color-bg);
  --bs-body-color: var(--color-text-primary);
  --bs-emphasis-color: var(--color-text-primary);
  --bs-secondary-bg: var(--color-surface);
  --bs-tertiary-bg: var(--color-surface-sunken);
  --bs-border-color: var(--color-border-strong);
  --bs-border-color-translucent: var(--color-border);
}

/* Clases utilitarias de Bootstrap (.bg-white, .bg-light) fijan un color
   siempre igual, no siguen data-bs-theme. Se corrigen puntualmente donde
   el sitio las usa (navbar, buscador del hero, barra de acciones del
   negocio en menu.html, secciones alternas, footer de las tarjetas de
   producto). */
[data-bs-theme="dark"] .navbar.bg-white,
[data-bs-theme="dark"] .input-group-text.bg-white,
[data-bs-theme="dark"] .card-footer.bg-white,
[data-bs-theme="dark"] #accionesNegocio .bg-white {
  background-color: var(--color-surface) !important;
}

[data-bs-theme="dark"] .bg-light {
  background-color: var(--color-surface-sunken) !important;
}

[data-bs-theme="dark"] .badge.bg-light.text-dark {
  color: var(--color-text-primary) !important;
}

/* Colores convencionales para el ícono del toggle: sol ámbar, luna azulado */
#themeToggle .bi-sun-fill {
  color: #f5b942;
}

#themeToggle .bi-moon-stars-fill {
  color: #8b93a6;
}



.btn-main {
  --bs-btn-bg: var(--color-hight);
  --bs-btn-border-color: var(--color-hight);
  --bs-btn-hover-bg: var(--color-brand-dark);
  --bs-btn-hover-border-color: var(--color-brand-dark);
  --bs-btn-active-bg: var(--color-brand-dark);
  --bs-btn-active-border-color: var(--color-brand-dark);
  --bs-btn-disabled-bg: var(--color-hight);
  --bs-btn-disabled-border-color: var(--color-hight);
 padding: 5% 0;
  border-radius: 30px;
}



.btn-success {
  --bs-btn-bg: var(--color-hight);
  --bs-btn-border-color: var(--color-hight);
  --bs-btn-hover-bg: var(--color-brand-dark);
  --bs-btn-hover-border-color: var(--color-brand-dark);
  --bs-btn-active-bg: var(--color-brand-dark);
  --bs-btn-active-border-color: var(--color-brand-dark);
  --bs-btn-disabled-bg: var(--color-hight);
  --bs-btn-disabled-border-color: var(--color-hight);
 padding: 5% 0;
  border-radius: 30px;
}


.btn-active{
  background-color:#b9b9b9;
  border: 2px solid #282828;
  color: #fff;

}



.btn-outline-success {
  --bs-btn-color: var(--color-brand);
  --bs-btn-border-color: var(--color-brand);
  --bs-btn-hover-bg: var(--color-brand);
  --bs-btn-hover-border-color: var(--color-brand);
  --bs-btn-active-bg: var(--color-brand-dark);
  --bs-btn-active-border-color: var(--color-brand-dark);
}




.pagination {
  --bs-pagination-color: var(--color-text-primary);
  --bs-pagination-hover-color: var(--color-brand);
  --bs-pagination-hover-bg: var(--color-surface-sunken);
  --bs-pagination-hover-border-color: var(--color-border);
  --bs-pagination-focus-color: var(--color-brand);
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: var(--color-brand);
  --bs-pagination-active-border-color: var(--color-brand);
}

.bg-mensages{
  background-color: #FF5B22;
}

.icon-highlight{
  color: #c7c7c7!important;
}

.colortxt{
  color: var(--color-text-principal)!important;
}

/* ===============================
   GENERAL
=================================*/

body {
  background: var(--color-bg);
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: var(--color-text-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.text-muted {
  color: var(--color-text-secondary) !important;
}

.form-control {
  background-color: var(--color-surface-sunken);
  border: 1px solid transparent;
}

.form-control:focus {
  background-color: var(--color-surface);
  border-color: var(--color-brand);
  box-shadow: var(--shadow-focus);
}

.hero {
  padding: 0;
}

.hero-bg {
  background: url("../assets/images/hero.webp") center center/cover no-repeat;
  min-height: 85vh;
}



.hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(43, 30, 20, 0.55),
    rgba(43, 30, 20, 0.75)
  );
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
}

section {
  margin-bottom: 25px;
}

.card {
  border: none;
  border-radius: 16px;
}

.business-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

/* ===============================
   HEADER
=================================*/

#headerNegocio {
  background: var(--color-surface);
  margin-bottom: 20px;
}

#headerNegocio .container-fluid > img:first-child {
  height: 260px;
  object-fit: cover;
}

#headerNegocio h1 {
  font-size: 2rem;
  font-weight: 700;
}

#headerNegocio p {
  color: var(--color-text-secondary);
}

#headerNegocio .rounded-circle {
  width: 120px;
  height: 120px;
  aspect-ratio: 1/1;
  border: 5px solid var(--color-surface);
  margin-top: -70px;
  background: var(--color-surface);
  object-fit: cover;
  position: relative;
  top: -60px;
}

#headerNegocio .badge {
  font-size: 0.9rem;
  padding: 8px 14px;
}

.btn-volver {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;

  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(43, 38, 32, 0.55);
  color: #fff;
  border-radius: 50%;

  box-shadow: var(--shadow-resting);
  transition: 0.2s;
}

.btn-volver:hover {
  background: rgba(43, 38, 32, 0.75);
  color: #fff;
}


.mainlogo{
  width: 220px;
}

.imgfooter{
  width: 150px;
}

/* ===============================
   MENU SUPERIOR
=================================*/

#accionesNegocio {
  background: var(--color-surface);
  box-shadow: var(--shadow-resting);
}

#accionesNegocio input {
  border-radius: 30px;
  height: 50px;
}

#accionesNegocio span {
  font-size: 0.9rem;
}

/* ===============================
   CATEGORIAS
=================================*/

#listaCategorias {
  scrollbar-width: none;
}

#listaCategorias::-webkit-scrollbar {
  display: none;
}

.categoria-btn {
  border-radius: 30px;
  white-space: nowrap;
  padding: 10px 22px;
}

/* ===============================
   CATEGORIAS POPULARES (home)
=================================*/

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;

  vertical-align: middle;
}

.category-carousel {
  position: relative;

  display: flex;

  align-items: center;

  gap: 8px;
}

#categoriasContainer {
  display: flex;

  flex: 1 1 0%;

  flex-wrap: nowrap;

  overflow-x: auto;

  scroll-snap-type: x mandatory;

  scroll-behavior: smooth;

  gap: 13px;

  padding: 6px 2px;

  scrollbar-width: none;
}

#categoriasContainer::-webkit-scrollbar {
  display: none;
}

#categoriasContainer .category-card {
  width: 130px;

  flex: 0 0 auto;

  scroll-snap-align: start;
}

.category-carousel-btn {
  flex: 0 0 auto;

  width: 40px;

  height: 40px;

  border: none;

  border-radius: 50%;

  display: flex;

  align-items: center;

  justify-content: center;

  background: var(--color-surface);

  color: var(--color-text-primary);

  box-shadow: var(--shadow-resting);

  transition: 0.2s;
}

.category-carousel-btn:hover {
  background: var(--color-brand);

  color: #fff;
}

.category-carousel-btn:disabled {
  opacity: 0.35;

  cursor: default;

  background: var(--color-surface);

  color: var(--color-text-primary);
}

.category-card {
  cursor: pointer;

  text-align: center;

  padding: 16px 10px;

  border-radius: 16px;

  box-shadow: var(--shadow-resting);

  transition:
    transform 0.25s,
    box-shadow 0.25s;
}

.category-card:hover {
  transform: translateY(-5px);

  box-shadow: var(--shadow-hover);
}

.category-card:active {
  transform: scale(0.95);
}

.category-icon {
  width: 80px;

  height: 80px;

  margin: 0 auto;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 50%;

  background: var(--cat-bg, #e9ecef);

  color: var(--cat-fg, #495057);

  font-size: 2rem;

  transition: 0.25s;
}

/* Colores pastel rotativos por categoría (inspirados en el diseño de referencia),
   con una variante más saturada para el hover ("relleno") */

.category-icon-1 {
  --cat-bg: #ffe4d6;
  --cat-fg: #b35900;
  --cat-bg-hover: #ff8c47;
}
.category-icon-2 {
  --cat-bg: #fff6c9;
  --cat-fg: #8a6d00;
  --cat-bg-hover: #e6b800;
}
.category-icon-3 {
  --cat-bg: #d9f0ff;
  --cat-fg: #006189;
  --cat-bg-hover: #00a3e0;
}
.category-icon-4 {
  --cat-bg: #e7e3df;
  --cat-fg: #6b5a48;
  --cat-bg-hover: #8a7860;
}
.category-icon-5 {
  --cat-bg: #ffe0ec;
  --cat-fg: #a13462;
  --cat-bg-hover: #e0508a;
}
.category-icon-6 {
  --cat-bg: #e3f5e1;
  --cat-fg: #2f7a3d;
  --cat-bg-hover: #4caf62;
}

.category-card:not(.active):hover .category-icon {
  background: var(--cat-bg-hover, #ced4da);

  color: #fff;
}

.category-card.active .category-icon {
  background: var(--color-brand) !important;

  color: #fff !important;

  box-shadow: 0 5px 15px rgba(var(--color-brand-rgb), 0.35);
}

.category-card h5 {
  transition: 0.25s;
}

.category-card.active h5 {
  color: var(--color-brand);

  font-weight: 700;
}

/* ===============================
   PRODUCTOS
=================================*/

#productos .card {
  transition: 0.25s;
}

#productos .card:hover {
  transform: translateY(-5px);

  box-shadow: var(--shadow-hover);
}

#productos img {
  height: 220px;

  object-fit: cover;
}

#productos h5 {
  font-weight: 600;
}

#productos h4 {
  font-weight: bold;
}

.badget-nuevo {
  width: auto;
  height: 1.5rem;
  border-radius: 0px 22px 22px 0px;
  padding: 0px 10px;
  text-align: center;
  background-color: #fbe203;
  color: #000000;
  font-weight: bold;
  line-height: 24px;
  position: relative;
  left: -8px;
}

/* ===============================
   CARRITO
=================================*/

#carrito {
  background: var(--color-surface);

  padding: 20px;

  border-radius: 15px;

  box-shadow: var(--shadow-resting);
}

#carrito strong {
  font-size: 1rem;
}

#carrito button {
  border-radius: 50px;
  width: 32px;
}




/* ===============================
   FORMULARIO
=================================*/

.card-header {
  background: var(--color-brand);

  color: white;

  border-radius: 15px 15px 0 0 !important;
}

.form-control {
  border-radius: 12px;
}

textarea {
  resize: none;
}

#btnUbicacion {
  border-radius: 30px;
}

#mapaDireccion {
  height: 200px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.theme-toggle-float {
  position: fixed;

  left: 20px;

  bottom: 20px;

  z-index: 1030;

  width: 48px;

  height: 48px;

  padding: 0;

  border-radius: 50%;

  font-size: 1.2rem;

  display: flex;

  align-items: center;

  justify-content: center;

  background-color: var(--color-surface);

  border: 1px solid var(--color-border);

  transition: filter 0.2s;
}

.theme-toggle-float:hover,
.theme-toggle-float:focus {
  filter: brightness(0.95);
}

#btnCarrito {
  position: fixed;

  right: 20px;

  bottom: 20px;

  z-index: 1030;

  width: 60px;

  height: 60px;

  padding: 0;

  border-radius: 50%;

  font-size: 1.6rem;

  display: flex;

  align-items: center;

  justify-content: center;

  background-color: var(--color-accent);

  border: none;

  color: #fff;

  transition: filter 0.2s;
}

#btnCarrito:hover,
#btnCarrito:focus {
  background-color: var(--color-accent);

  color: #fff;

  filter: brightness(0.9);
}

#cantidadCarrito {
  position: absolute;

  top: -4px;

  right: -4px;

  min-width: 22px;

  height: 22px;

  padding: 0 5px;

  border-radius: 11px;

  background: #06a109;

  color: #fff;

  font-size: 0.75rem;

  font-weight: bold;

  line-height: 22px;

  text-align: center;
}
/* ===============================
   btn whasApp
=================================*/

#offcanvasCarrito .offcanvas-body {
    overflow-y: auto;
}

#offcanvasCarrito .carrito-footer {
    flex-shrink: 0;
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}



/* ===============================
   FOOTER
=================================*/

.footer {
  background: #221D1D;
  color: #FFFFFF;
  border-top: 1px solid rgba(250, 246, 238, 0.07);
}

.footer-brand-text {
  color: #ffffff;
  max-width: 300px;
  line-height: 1.7;
  font-size: 0.92rem;
}

.footer-heading {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.footer-link {
  font-size: 0.98rem;
  color: #ffffff;
  text-decoration: none;
  display: inline-block;
  padding: 0.25rem 0;
  transition:
    color 0.2s,
    padding-left 0.2s;
}

.footer-link:hover {
  color: var(--color-hover-footer);
  padding-left: 6px;
}

.footer-contact-item {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
  padding: 0.25rem 0;
}

.footer-contact-item:hover {
  color: var(--color-hover-footer);
}

.footer-contact-item .bi {
  color: var(--color-accent);
  width: 1.5rem;
}

.footer-bottom {
  background: #1c1814;
  font-size: 0.82rem;
  color: #b8ad9e;
}

[data-bs-theme="dark"] .footer,
[data-bs-theme="dark"] .footer-bottom {
  background: var(--color-surface);
}

/* ===============================
   LEGAL PAGES
=================================*/

.hover-card {
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.hover-card:hover {
  box-shadow: var(--shadow-hover) !important;
  transform: translateY(-2px);
}

/* ===============================
   COOKIE CONSENT
=================================*/

#cookie-consent-banner {
  font-family: Poppins, sans-serif;
}

@media (max-width: 576px) {
  #cookie-consent-banner {
    flex-direction: column;
    text-align: center;
  }
  #cookie-consent-banner > div:last-child {
    width: 100%;
    justify-content: center;
  }
}

/* ===============================
   RESPONSIVE
=================================*/

@media (max-width: 768px) {
  .category-carousel-btn {
    display: none !important;
  }

  #headerNegocio h1 {
    font-size: 1.5rem;
  }

  #headerNegocio .rounded-circle {
    width: 90px;

    height: 90px;

    margin-top: -45px;
  }

  #productos img {
    height: 180px;
  }
}



/* ===============================
   SKELETONS DE CARGA
   Marcadores con la forma del contenido mientras llega la API.
   Se reemplazan solos: el JS sobrescribe el innerHTML del contenedor.
=================================*/

:root {
  --skeleton-base: var(--color-placeholder-bg);
  --skeleton-shine: rgba(255, 255, 255, .55);
}

[data-bs-theme="dark"] {
  --skeleton-base: var(--color-surface-sunken);
  --skeleton-shine: rgba(255, 255, 255, .07);
}

.skeleton {
  display: block;
  background-color: var(--skeleton-base);
  background-image: linear-gradient(90deg, transparent 0, var(--skeleton-shine) 50%, transparent 100%);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-line {
  height: 14px;
}

@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}


.skeleton-categoria {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}

/* El logo principal lleva letras negras: en modo oscuro usa la variante clara */
[data-bs-theme="dark"] img.mainlogo {
  content: url("/assets/logos/ricomenu_main_logo_dark.svg");
}

/* ===============================
   BARRA DE ACCIONES: dirección y teléfono
   Cada dato es un ítem propio (ícono + texto) para que al partirse la
   dirección el ícono no quede separado de su texto.
=================================*/

#accionesNegocio .acciones-info-item {
  display: inline-flex;
  align-items: flex-start;
  gap: .4rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

#accionesNegocio .acciones-info-item:hover,
#accionesNegocio .acciones-info-item:focus-visible {
  text-decoration: underline;
}

#accionesNegocio .acciones-info-item .material-symbols-outlined {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

#accionesNegocio .acciones-info-telefono {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ===============================
   TRANSICIÓN AL CAMBIAR DE LISTADO
=================================*/

@keyframes aparecer-tarjeta {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.fade-cards > [class*="col-"] {
  animation: aparecer-tarjeta .3s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .fade-cards > [class*="col-"] {
    animation: none;
  }
}

/* ===============================
   CATEGORÍA ACTIVA MÁS EVIDENTE
   Además del ícono en verde, la tarjeta completa lleva un aro y un tinte,
   y no se levanta al pasar el cursor (evita el "rebote" tras elegirla).
=================================*/

.category-card.active {
  background: rgba(var(--color-brand-rgb), 0.08);
  box-shadow: 0 0 0 2px var(--color-brand);
}

.category-card.active:hover {
  transform: none;
  box-shadow: 0 0 0 2px var(--color-brand);
}

.category-card:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}
