/*
 * Tema de la tienda (Raíces Store).
 * Se carga después de Bootstrap y de base.min.css: redefine variables de Bootstrap
 * y da el estilo "elevado" (tarjetas con sombra suave, bordes redondeados, botones pill).
 */

/* ---------- Fuentes ---------- */
@font-face {
  font-family: 'Proxima Nova';
  src: url('../fonts/Proxima_Nova/ProximaNova-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova';
  src: url('../fonts/Proxima_Nova/ProximaNova-Semibold.otf') format('opentype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova';
  src: url('../fonts/Proxima_Nova/ProximaNova-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Alma Mono';
  src: url('../fonts/Alma_Mono/webfontkit/almamono-regular-webfont.woff2') format('woff2'),
       url('../fonts/Alma_Mono/webfontkit/almamono-regular-webfont.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Alma Mono';
  src: url('../fonts/Alma_Mono/webfontkit/almamono-bold-webfont.woff2') format('woff2'),
       url('../fonts/Alma_Mono/webfontkit/almamono-bold-webfont.woff') format('woff');
  font-weight: 700;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --rs-ink: #141414;
  --rs-ink-soft: #2b2b2b;
  --rs-muted: #6f6f6b;
  --rs-bg: #f6f5f2;
  --rs-surface: #ffffff;
  --rs-surface-2: #efede8;
  --rs-border: #e6e3dc;
  --rs-danger: #d6353f;

  --rs-radius-sm: 10px;
  --rs-radius: 16px;
  --rs-radius-lg: 24px;

  --rs-shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 6px 20px rgba(20, 20, 20, .06);
  --rs-shadow-hover: 0 2px 4px rgba(20, 20, 20, .05), 0 16px 36px rgba(20, 20, 20, .12);

  --rs-font: 'Proxima Nova', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --rs-font-mono: 'Alma Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Bootstrap */
  --bs-body-font-family: var(--rs-font);
  --bs-body-color: var(--rs-ink);
  --bs-body-bg: var(--rs-bg);
  --bs-secondary-color: var(--rs-muted);
  --bs-border-color: var(--rs-border);
  --bs-border-radius: var(--rs-radius-sm);
  --bs-border-radius-lg: var(--rs-radius);
  --bs-link-color: var(--rs-ink);
  --bs-link-color-rgb: 20, 20, 20;
  --bs-link-hover-color: var(--rs-ink-soft);
  --bs-link-hover-color-rgb: 43, 43, 43;
}

body {
  background: var(--rs-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; letter-spacing: -.02em; }
.text-muted { color: var(--rs-muted) !important; }

/* Etiqueta pequeña en mayúsculas sobre los títulos */
.eyebrow {
  font-family: var(--rs-font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rs-muted);
}
.section-title { font-size: clamp(1.5rem, 2.5vw, 2rem); margin-bottom: 0; }
.section { margin-bottom: 4.5rem; }

/* ---------- Botones ---------- */
.btn { border-radius: 999px; font-weight: 600; padding-inline: 1.25rem; }
.btn-sm { padding-inline: .9rem; }
.btn-dark, .btn-primary {
  --bs-btn-bg: var(--rs-ink);
  --bs-btn-border-color: var(--rs-ink);
  --bs-btn-hover-bg: var(--rs-ink-soft);
  --bs-btn-hover-border-color: var(--rs-ink-soft);
  --bs-btn-active-bg: #000;
  --bs-btn-active-border-color: #000;
  --bs-btn-disabled-bg: #8a8a86;
  --bs-btn-disabled-border-color: #8a8a86;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
}
.btn-outline-dark {
  --bs-btn-color: var(--rs-ink);
  --bs-btn-border-color: var(--rs-ink);
  --bs-btn-hover-bg: var(--rs-ink);
  --bs-btn-hover-border-color: var(--rs-ink);
}
.btn-icon {
  width: 42px; height: 42px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: transparent; border: 0; color: var(--rs-ink);
  position: relative;
  transition: background .2s ease;
}
.btn-icon:hover, .btn-icon:focus-visible { background: var(--rs-surface-2); }
.btn-icon .badge {
  position: absolute; top: 2px; right: 0;
  background: var(--rs-danger); font-size: .65rem; min-width: 18px;
}
.btn-dark:hover { transform: none; box-shadow: none; }

/* ---------- Formularios ---------- */
.form-control, .form-select {
  border-radius: var(--rs-radius-sm);
  border-color: var(--rs-border);
  background-color: var(--rs-surface);
}
.form-control:focus, .form-select:focus {
  border-color: var(--rs-ink);
  box-shadow: 0 0 0 3px rgba(20, 20, 20, .08);
}
.input-group > .btn { border-radius: var(--rs-radius-sm); }

/* ---------- Tarjetas "raised" ---------- */
.card {
  border: 0;
  border-radius: var(--rs-radius);
  background: var(--rs-surface);
  box-shadow: var(--rs-shadow);
}
.card-raised { transition: transform .25s ease, box-shadow .25s ease; }
.card-raised:hover { transform: translateY(-4px); box-shadow: var(--rs-shadow-hover); }

/* ---------- Barra de anuncio + navbar ---------- */
.announcement-bar {
  background: var(--rs-ink);
  color: rgba(255, 255, 255, .85);
  font-family: var(--rs-font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  padding: .45rem 1rem;
}
.site-navbar {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--rs-border);
  padding-block: .6rem;
}
.site-navbar .navbar-brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 700; letter-spacing: -.02em; color: var(--rs-ink);
}
.site-navbar .navbar-brand img { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }
.site-navbar .nav-link {
  color: var(--rs-muted);
  font-weight: 600;
  padding-inline: .9rem !important;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease;
}
.site-navbar .nav-link:hover, .site-navbar .nav-link.active { color: var(--rs-ink); background: var(--rs-surface-2); }
.site-navbar .navbar-toggler { border: 0; box-shadow: none; padding: .4rem; }
.nav-search { position: relative; }
.nav-search .form-control {
  border-radius: 999px;
  padding-left: 2.4rem;
  background: var(--rs-surface-2);
  border-color: transparent;
  min-width: 240px;
}
.nav-search .form-control:focus { background: var(--rs-surface); }
.nav-search .fa-magnifying-glass {
  position: absolute; left: .95rem; top: 50%; transform: translateY(-50%);
  color: var(--rs-muted); font-size: .9rem; pointer-events: none;
}
.dropdown-menu {
  border: 0;
  border-radius: var(--rs-radius);
  box-shadow: var(--rs-shadow-hover);
  padding: .5rem;
}
.dropdown-item { border-radius: var(--rs-radius-sm); padding: .5rem .75rem; font-weight: 500; }
.dropdown-item:active { background: var(--rs-ink); }

@media (max-width: 991.98px) {
  .site-navbar .navbar-collapse { padding-block: .75rem; }
  .nav-search .form-control { min-width: 0; }
}

/* ---------- Alertas ---------- */
.alert { border: 0; border-radius: var(--rs-radius); box-shadow: var(--rs-shadow); }

/* ---------- Hero ---------- */
.hero { margin-top: 1.5rem; }
.hero .carousel, .hero-fallback {
  border-radius: var(--rs-radius-lg);
  overflow: hidden;
  box-shadow: var(--rs-shadow);
}
.hero .carousel-item { position: relative; }
.hero .carousel-item img { width: 100%; height: auto; display: block; }
.hero .carousel-item::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .15) 55%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}
.hero .hero-caption {
  position: absolute; z-index: 2;
  left: clamp(1.25rem, 5vw, 4rem); bottom: clamp(1.25rem, 6vw, 4rem);
  max-width: min(520px, 80%);
  color: #fff;
}
.hero .hero-caption h1 { font-size: clamp(1.6rem, 4vw, 3.25rem); line-height: 1.05; margin-bottom: .75rem; }
.hero .hero-caption p { font-size: clamp(.95rem, 1.4vw, 1.15rem); opacity: .9; margin-bottom: 1.25rem; }
.hero .carousel-indicators { margin-bottom: 1.25rem; }
.hero .carousel-indicators [data-bs-target] { width: 8px; height: 8px; border-radius: 50%; border: 0; }
.hero-fallback {
  background: var(--rs-ink);
  color: #fff;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4rem);
}
.hero-fallback h1 { font-size: clamp(2rem, 5vw, 3.75rem); line-height: 1.02; max-width: 14ch; }
.hero-fallback .eyebrow { color: rgba(255, 255, 255, .65); }

/* ---------- Beneficios ---------- */
.benefit {
  flex-direction: row;
  display: flex; align-items: center; gap: .9rem;
  height: 100%;
  padding: 1rem 1.15rem;
}
.benefit-icon {
  flex: 0 0 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--rs-surface-2);
}
.benefit h6 { margin: 0; font-size: .95rem; }
.benefit p { margin: 0; font-size: .85rem; color: var(--rs-muted); }

/* ---------- Categorías ---------- */
.category-tile {
  position: relative; display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--rs-radius);
  overflow: hidden;
  background: var(--rs-surface-2);
  box-shadow: var(--rs-shadow);
  color: #fff;
}
.category-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.category-tile::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, 0) 55%);
}
.category-tile .category-name {
  position: absolute; z-index: 1; left: 1rem; right: 1rem; bottom: 1rem;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 1.1rem;
}
.category-tile:hover img { transform: scale(1.06); }
.category-tile.no-image { display: flex; align-items: flex-end; color: var(--rs-ink); }
.category-tile.no-image::after { display: none; }

/* ---------- Tarjeta de producto ---------- */
.product-card {
  border-radius: var(--rs-radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--rs-shadow-hover); }
.product-card .image-placeholder { background: var(--rs-surface-2); aspect-ratio: 1 / 1; }
.product-card .product-image { height: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 0; }
.product-card .product-badge {
  position: absolute; top: .75rem; left: .75rem; z-index: 2;
  font-family: var(--rs-font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--rs-ink); color: #fff;
  padding: .35rem .6rem; border-radius: 999px;
}
.product-card .product-category {
  font-family: var(--rs-font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--rs-muted);
}
.product-card .card-title { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.product-card .card-title a { color: var(--rs-ink); }
.product-card .product-price, .order-card .product-price, .card .product-price { font-family: var(--rs-font-mono); font-weight: 700; font-size: 1.05rem; }
.product-card .product-actions .btn { width: 42px; height: 42px; padding: 0; background: rgba(255, 255, 255, .92); color: var(--rs-ink); border: 0; box-shadow: var(--rs-shadow); }

/* ---------- Banda promocional ---------- */
.promo-band {
  border-radius: var(--rs-radius-lg);
  background: radial-gradient(120% 140% at 100% 0%, #3a3a36 0%, var(--rs-ink) 60%);
  color: #fff;
  padding: clamp(2rem, 5vw, 3.5rem);
  box-shadow: var(--rs-shadow);
}
.promo-band .eyebrow { color: rgba(255, 255, 255, .6); }

/* ---------- Paginación ---------- */
.pagination { --bs-pagination-border-width: 0; gap: .25rem; }
.pagination .page-link { border-radius: 50% !important; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--rs-ink); background: transparent; }
.pagination .page-item.active .page-link { background: var(--rs-ink); color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--rs-ink);
  color: rgba(255, 255, 255, .7);
  padding-top: 4rem;
  margin-top: 4rem;
}
.site-footer h6 {
  color: #fff;
  font-family: var(--rs-font-mono);
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.site-footer .footer-brand { color: #fff; font-weight: 700; font-size: 1.25rem; }
.site-footer .footer-link { color: rgba(255, 255, 255, .7); }
.site-footer .footer-link:hover { color: #fff; }
.site-footer li { margin-bottom: .5rem; }
.site-footer .social-icon { width: 40px; height: 40px; background: rgba(255, 255, 255, .08); }
.site-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin-top: 3rem; padding-block: 1.5rem;
  font-size: .85rem;
}
.site-footer .payment-icons i { font-size: 1.5rem; margin-left: .5rem; opacity: .8; }

/* ---------- Carrito lateral ---------- */
.cart-backdrop {
  position: fixed; inset: 0; z-index: 1055;
  background: rgba(20, 20, 20, .45);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.cart-backdrop.show { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1060;
  width: min(420px, 100%);
  display: flex; flex-direction: column;
  background: var(--rs-surface);
  box-shadow: -16px 0 48px rgba(0, 0, 0, .16);
  transform: translateX(100%);
  visibility: hidden; /* sin esto la sombra se asoma por el borde con el carrito cerrado */
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .35s;
}
.cart-drawer.show { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.cart-drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--rs-border);
}
.cart-drawer-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding-inline: .4rem; margin-left: .35rem;
  border-radius: 999px; background: var(--rs-ink); color: #fff;
  font-size: .75rem; vertical-align: middle;
}
.cart-shipping { padding: .9rem 1.25rem; background: var(--rs-bg); border-bottom: 1px solid var(--rs-border); }
.cart-shipping-bar { height: 6px; border-radius: 999px; background: var(--rs-surface-2); overflow: hidden; }
.cart-shipping-bar span { display: block; height: 100%; background: var(--rs-ink); border-radius: inherit; transition: width .4s ease; }
.cart-drawer-body { flex: 1; overflow-y: auto; padding: .5rem 1.25rem; }
.cart-line { display: flex; gap: 1rem; padding-block: 1rem; border-bottom: 1px solid var(--rs-border); }
.cart-line:last-of-type { border-bottom: 0; }
.cart-line-image {
  flex: 0 0 84px; height: 84px;
  border-radius: var(--rs-radius-sm); overflow: hidden; background: var(--rs-surface-2);
}
.cart-line-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name { font-size: .95rem; font-weight: 600; margin: 0; line-height: 1.3; }
.cart-line-price { font-family: var(--rs-font-mono); font-weight: 700; white-space: nowrap; }
.cart-line-meta { font-size: .8rem; color: var(--rs-muted); margin: .2rem 0 .6rem; }
.cart-line-remove {
  border: 0; background: none; padding: 0;
  font-size: .8rem; color: var(--rs-muted); text-decoration: underline; text-underline-offset: 3px;
}
.cart-line-remove:hover { color: var(--rs-danger); }
.qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--rs-border); border-radius: 999px;
}
.qty-stepper button {
  width: 32px; height: 32px; border: 0; background: none; border-radius: 50%;
  font-size: .7rem; color: var(--rs-ink);
}
.qty-stepper button:hover:not(:disabled) { background: var(--rs-surface-2); }
.qty-stepper button:disabled { opacity: .3; }
.qty-stepper span { min-width: 28px; text-align: center; font-weight: 600; font-size: .9rem; }
.cart-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4rem 1rem; }
.cart-empty .benefit-icon { width: 64px; height: 64px; font-size: 1.4rem; }
.cart-drawer-footer { padding: 1.1rem 1.25rem 1.25rem; border-top: 1px solid var(--rs-border); background: var(--rs-surface); }
.cart-total { font-family: var(--rs-font-mono); font-size: 1.25rem; }

/* Botón y selects compactos dentro de las tarjetas: el texto no debe partirse en dos líneas */
.product-card .card-body .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
@media (max-width: 575.98px) {
  .product-card .card-body { padding: .75rem !important; }
  .product-card .card-title { font-size: .9rem; }
  .product-card .card-body .btn { font-size: .8rem; padding-inline: .5rem; }
  .product-card .card-body .btn .fa-cart-plus { display: none; }
  .product-card .form-select { font-size: .8rem; padding-right: 1.75rem; }
}

/* ---------- Detalle de producto ---------- */
.breadcrumb a { color: var(--rs-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--rs-ink); }
.product-gallery { border-radius: var(--rs-radius-lg); }
.product-gallery .carousel-item img { border-radius: var(--rs-radius); }
.product-title { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.1; }
.product-detail-price { font-family: var(--rs-font-mono); font-weight: 700; font-size: 1.6rem; }

/* ---------- Iniciar sesión / Crear cuenta ---------- */
.auth-page { padding-block: clamp(1.5rem, 5vw, 3.5rem); }
.auth-card { max-width: 440px; padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: var(--rs-radius-lg); }
.auth-card-wide { max-width: 720px; }
.auth-logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.auth-field { margin-bottom: 1rem; }
.auth-field .form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.auth-field .form-control, .auth-field .form-select { padding-block: .65rem; }
.auth-field.field-invalid .form-control, .auth-field.field-invalid .form-select { border-color: var(--rs-danger); }
.auth-section { border-top: 1px solid var(--rs-border); padding-top: 1.25rem; margin-bottom: 1.25rem; }
.auth-section:first-of-type { border-top: 0; padding-top: 0; }
.auth-section legend { float: none; margin-bottom: .75rem; }
.auth-section .auth-field { margin-bottom: 0; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 3rem; }
.password-toggle {
  position: absolute; top: 50%; right: .5rem; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: none; border-radius: 50%;
  color: var(--rs-muted);
}
.password-toggle:hover { color: var(--rs-ink); background: var(--rs-surface-2); }

/* Botones de contacto del footer */
.footer-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.footer-actions .btn { flex: 1 1 auto; }
.btn-whatsapp {
  --bs-btn-bg: #25d366; --bs-btn-border-color: #25d366; --bs-btn-color: #0b3d1f;
  --bs-btn-hover-bg: #1ebe5b; --bs-btn-hover-border-color: #1ebe5b; --bs-btn-hover-color: #0b3d1f;
  --bs-btn-active-bg: #1aa851; --bs-btn-active-border-color: #1aa851; --bs-btn-active-color: #0b3d1f;
}

/* ---------- Mis pedidos ---------- */
.order-card { padding: 1.1rem 1.25rem; color: var(--rs-ink); }
.order-thumbs { display: flex; gap: .5rem; align-items: center; }
.order-thumbs .cart-line-image { flex-basis: 56px; width: 56px; height: 56px; }
.order-more { font-size: .8rem; color: var(--rs-muted); font-weight: 600; }
.order-status {
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
  padding: .25rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
}
.order-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.order-status-pending { background: #e8f0fe; color: #1a56c4; }
.order-status-paid { background: #e6f4ea; color: #1e7b3c; }
.order-status-layaway { background: #fff4e0; color: #9a5b00; }
.order-status-cancelled { background: #f1f1ef; color: #7a7a75; }
