/* =============================================================
   BASE.CSS — Structural styles for egarian-store.
   Colors, fonts and radii are defined by theme files.
   All visual tokens are consumed via CSS custom properties.
   ============================================================= */

/* Base layout */
body {
  background: var(--color-bg);
  font-family: var(--font-body);
}

.footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 40px 0;
}

.footer a {
  color: var(--color-footer-link);
}

/* Navigation */
.navbar-brand {
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
}

.navbar-brand-logo-wrap {
  width: 64px;
  height: 56px;
  border-radius: var(--radius-card);
  background: var(--color-surface);
  padding: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.navbar-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.navbar-brand-text {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  display: block;
  line-height: 1.1;
  font-family: var(--font-brand);
}

.navbar-actions {
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-filter-toggle {
  font-size: 0.95rem;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .btn-filter-toggle {
    padding: 0.3rem 0.65rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .navbar-actions {
    width: 100%;
    margin-top: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .navbar-brand {
    gap: 0.5rem;
  }

  .navbar-brand-logo-wrap {
    width: 56px;
    height: 50px;
    padding: 0.25rem;
  }

  .navbar-brand-text {
    font-size: 1.05rem;
    letter-spacing: 0.05em;
  }
}

.nav-link {
  font-weight: 500;
}

.dropdown-mega {
  position: static;
}

.dropdown-menu-mega {
  left: 0;
  right: 0;
  padding: 1.5rem 2rem;
  border-radius: 0;
  border-top: none;
}

/* Checkout */
.summary-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 0.75rem;
  background: var(--color-surface);
}

.summary-item img {
  box-shadow: var(--shadow-card);
}

/* Catalog page */
.catalog-page a {
  text-decoration: none;
}

.catalog-page section {
  scroll-margin-top: 120px;
}

.catalog-page .hero {
  background: var(--color-surface);
  padding: 80px 0;
}

.catalog-main,
.detail-main {
  padding-top: 4.5rem;
}

@media (max-width: 767.98px) {
  .catalog-main,
  .detail-main {
    padding-top: 6.25rem;
  }
}

.catalog-page .hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
}

.catalog-page .hero-banner {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-surface);
  aspect-ratio: 16 / 6.5;
  width: 100%;
  max-height: 360px;
  box-shadow: 0 1rem 2.5rem rgba(var(--color-primary-rgb), 0.08);
}

.catalog-page .hero-banner img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: left center;
}

@media (max-width: 768px) {
  .catalog-page .hero-banner {
    aspect-ratio: 16 / 8;
    max-height: 340px;
  }
}

@media (max-width: 480px) {
  .catalog-page .hero-banner {
    aspect-ratio: 16 / 9.5;
    max-height: 320px;
  }
}

.catalog-page .product-card {
  border-radius: var(--radius-card);
  overflow: hidden;
}

.catalog-page .product-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: var(--color-surface);
  padding: 0.25rem;
}

/* Tablet — 3 columnas, imagen moderada para que la card entre en viewport */
@media (min-width: 768px) and (max-width: 991.98px) {
  .catalog-page .product-card img {
    height: 180px;
  }
}

/* Desktop */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .catalog-page .product-card img {
    height: 220px;
  }
}

/* Desktop xl+ */
@media (min-width: 1200px) {
  .catalog-page .product-card img {
    height: 260px;
  }
}

@media (max-width: 767.98px) {
  #productList.row {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
  }

  #productList > [class*="col-"] {
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
  }

  .catalog-page .product-card img {
    height: 150px;
  }

  .catalog-page .product-card .card-body {
    padding: 0.5rem;
  }

  .catalog-page .product-card .card-title {
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .catalog-page .product-card .price {
    font-size: 0.88rem;
    margin-bottom: 0.25rem !important;
  }

  .catalog-page .product-card .quantity-wrapper {
    margin-bottom: 0.4rem !important;
  }

  .catalog-page .product-card .btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.4rem;
  }

  .catalog-page .product-card .variant-groups .btn {
    font-size: 0.7rem;
    padding: 0.15rem 0.25rem;
    min-width: 1.8rem;
  }
}

.catalog-page .product-card .price {
  font-weight: 700;
  text-align: right;
}

.catalog-page .variant-groups .btn {
  margin: 0.05rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.8rem;
  line-height: 1.1;
  min-width: 2.1rem;
}

.catalog-page .variant-groups .btn.active {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.catalog-page .variant-color-label,
.detail-variant-groups .variant-color-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.catalog-page .variant-color-swatch,
.detail-variant-groups .variant-color-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 0.2rem;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background-color: var(--variant-color, transparent);
  flex-shrink: 0;
}

.catalog-page .category-card img {
  height: 210px;
  object-fit: cover;
}

/* Product detail */
.detail-gallery {
  display: flex;
  gap: 1rem;
}

.detail-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 420px;
  overflow-y: auto;
}

.detail-thumb-btn {
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  padding: 0;
  background: transparent;
  flex: 0 0 auto;
}

.detail-thumb-btn.active {
  border-color: var(--color-primary);
}

.detail-thumb-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-card);
}

.detail-variant-groups .btn {
  margin: 0.05rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.82rem;
  line-height: 1.2;
  min-width: 2.4rem;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.detail-variant-groups .btn.active {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb, 13,110,253), 0.25);
}

.detail-variant-groups .btn.out-of-stock {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

@media (max-width: 767.98px) {
  .detail-gallery {
    flex-direction: column;
  }

  /* Imagen principal primero, miniaturas debajo */
  .detail-gallery > .flex-grow-1 {
    order: -1;
  }

  .detail-thumbs {
    flex-direction: row;
    max-height: none;
    overflow-y: visible;
    overflow-x: auto;
    width: 100%;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
  }

  .detail-thumb-img {
    width: 60px;
    height: 60px;
  }

  .detail-info-col h2 {
    font-size: 1.35rem;
  }

  .detail-info-col h3 {
    font-size: 1.1rem;
  }
}

.badge-spec {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

/* Shared cart widgets */
.cart-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1080;
  max-width: 320px;
  width: calc(100% - 40px);
  padding: 0;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 360px;
  max-width: 90%;
  height: 100%;
  background: var(--color-surface);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  z-index: 1200;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  right: 0;
}

#cartDrawerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1190;
  display: none;
}

#cartDrawerOverlay.show {
  display: block;
}

.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
}

.cart-mini-item {
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.cart-mini-item:last-child {
  border-bottom: none;
}

.cart-mini-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-card);
  object-fit: cover;
}

.filter-active-count {
  font-size: 0.65rem;
  min-width: 1.25rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
}

.filter-drawer {
  position: fixed;
  top: 0;
  left: -420px;
  right: auto;
  width: 360px;
  max-width: 90%;
  height: 100%;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
  transition: left 0.3s ease;
  z-index: 1185;
  display: flex;
  flex-direction: column;
}

.filter-drawer.open {
  left: 0;
}

.filter-drawer-header {
  padding: 1.25rem 1.25rem 0.5rem;
  border-bottom: 1px solid var(--color-border-light);
}

.filter-drawer-body {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
}

.filter-drawer-search {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 0.1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, var(--color-surface) 80%, transparent);
  border-bottom: 1px solid var(--color-border-light);
}

.filter-search-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 0.55rem 1.2rem rgba(0, 0, 0, 0.05);
}

.filter-search-group .form-control {
  border: none;
  box-shadow: none;
  padding-left: 0.75rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  font-size: 0.9rem;
}

.filter-search-group .form-control:focus {
  box-shadow: none;
}

.filter-search-button {
  border-radius: 0;
  padding-inline: 0.65rem;
  padding-block: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.filter-drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

.filter-action-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  background: var(--color-surface);
  box-shadow: 0 -0.2rem 0.85rem rgba(0, 0, 0, 0.08);
}

.filter-action-bar .btn {
  border-radius: 999px;
  padding: 0.45rem 0.55rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.filter-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1180;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.filter-drawer-overlay.show {
  opacity: 1;
  visibility: visible;
}

.filter-category-group {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-light);
}

.filter-category-group:last-child {
  border-bottom: none;
}

.filter-subcategory-list {
  margin: 0.25rem 0 0.25rem 1.5rem;
}

.filter-subcategory-list .form-check {
  margin-bottom: 0.25rem;
}

.filter-subcategory-list .form-check-label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

body.filter-drawer-open {
  overflow: hidden;
}

@media (max-width: 576px) {
  .filter-drawer {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .filter-drawer-body {
    padding-bottom: 5.5rem;
  }

  .filter-drawer-footer {
    position: sticky;
    bottom: 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  }

  .filter-action-bar {
    padding: 0.55rem 0.75rem;
    border-radius: 1.25rem;
    gap: 0.4rem;
  }

  .filter-action-bar .btn {
    padding: 0.5rem 0.5rem;
    font-size: 0.88rem;
  }
}

/* Error page */
body.error-page {
  background: linear-gradient(135deg, #f8f9fa, #e3e7ef);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.error-page .error-wrap {
  background: #fff;
  padding: 2.5rem 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  max-width: 420px;
  text-align: center;
}

.error-page .error-icon {
  font-size: 4rem;
  color: #dc3545;
  margin-bottom: 1rem;
}

.error-page h1 {
  font-size: 1.8rem;
  color: #343a40;
  font-weight: 700;
}

.error-page p {
  font-size: 1rem;
  color: #555;
}

.error-page .btn-home {
  margin-top: 1.5rem;
  padding: 0.6rem 1.5rem;
}

.error-page .quote {
  font-size: 0.9rem;
  color: #777;
  margin-top: 1.2rem;
  font-style: italic;
}

/* Product detail main image */
#detailMainImg {
  width: 100%;
  height: 400px;
  object-fit: contain;
  background: var(--color-surface-alt);
  padding: 0.5rem;
  border-radius: var(--radius-card);
}

/* Fashion hero */
.hero--fashion {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-fashion-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transition: transform 8s ease;
  will-change: transform;
}

.hero--fashion:hover .hero-fashion-bg {
  transform: scale(1.025);
}

.hero-fashion-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.4) 55%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

.hero-fashion-content {
  position: relative;
  z-index: 2;
  padding: 5rem 0 6rem;
}

.hero-fashion-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-fashion-title {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

.hero-fashion-desc {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.75;
  max-width: 440px;
  margin-bottom: 0;
}

.hero-fashion-cta {
  display: inline-block;
  padding: 0.9rem 2.8rem;
  text-decoration: none;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
}

/* Fashion hero — with background image */
.hero--fashion.hero--has-image .hero-fashion-eyebrow,
.hero--fashion.hero--has-image .hero-fashion-title,
.hero--fashion.hero--has-image .hero-fashion-desc {
  color: #ffffff;
}

.hero--fashion.hero--has-image .hero-fashion-cta {
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #ffffff;
  background: transparent;
}

.hero--fashion.hero--has-image .hero-fashion-cta:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  color: #ffffff;
}

/* Fashion hero — no image */
.hero--fashion.hero--no-image {
  min-height: 52vh;
  background: var(--color-surface);
}

.hero--fashion.hero--no-image .hero-fashion-eyebrow {
  color: var(--color-text-muted);
}

.hero--fashion.hero--no-image .hero-fashion-title {
  color: var(--color-text);
  font-family: var(--font-brand);
}

.hero--fashion.hero--no-image .hero-fashion-desc {
  color: var(--color-text-muted);
}

.hero--fashion.hero--no-image .hero-fashion-cta {
  border: 1px solid var(--color-text);
  color: var(--color-text);
  background: transparent;
}

.hero--fashion.hero--no-image .hero-fashion-cta:hover {
  background: var(--color-text);
  color: var(--color-surface);
}

@media (max-width: 767.98px) {
  .hero--fashion {
    min-height: 70vh;
  }

  .hero-fashion-content {
    padding: 4rem 0 5rem;
  }

  .hero--fashion.hero--no-image {
    min-height: 42vh;
  }
}

/* Ocultar selector y contador de variantes en las cards del listado */
.product-card .variant-picker-card,
.product-card .variant-count {
  display: none !important;
}

/* Centrar el grupo de cantidad en todas las cards */
.product-card .quantity-wrapper {
  max-width: 140px;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Estilos Quill para contenido renderizado en la tienda */
.static-page-body .ql-size-small,
.about-body .ql-size-small  { font-size: 0.75em; }
.static-page-body .ql-size-large,
.about-body .ql-size-large  { font-size: 1.5em; }
.static-page-body .ql-size-huge,
.about-body .ql-size-huge   { font-size: 2.5em; }
.static-page-body .ql-font-georgia,
.about-body .ql-font-georgia   { font-family: Georgia, serif; }
.static-page-body .ql-font-trebuchet,
.about-body .ql-font-trebuchet { font-family: 'Trebuchet MS', sans-serif; }
.static-page-body .ql-font-verdana,
.about-body .ql-font-verdana   { font-family: Verdana, Geneva, sans-serif; }
.static-page-body .ql-font-times,
.about-body .ql-font-times     { font-family: 'Times New Roman', Times, serif; }
.static-page-body .ql-font-courier,
.about-body .ql-font-courier   { font-family: 'Courier New', Courier, monospace; }
/* Marcadores de lista heredan tamaño del contenido */
.static-page-body li:has(.ql-size-small),
.about-body li:has(.ql-size-small)  { font-size: 0.75em; }
.static-page-body li:has(.ql-size-large),
.about-body li:has(.ql-size-large)  { font-size: 1.5em; }
.static-page-body li:has(.ql-size-huge),
.about-body li:has(.ql-size-huge)   { font-size: 2.5em; }
