:root {
  --store-bg: #f3f5f9;
  --store-surface: #ffffff;
  --store-text: #111827;
  --store-muted: #4b5563;
  --store-primary: #0f4c81;
  --store-primary-dark: #0b3a63;
  --store-accent: #ea580c;
  --store-border: #d6dde8;
  --store-danger: #d73f3f;
  --store-success: #1f7a4a;
  --store-info: #0f4c81;
  --store-subtle: #eef2f7;
  --store-subtle-2: #e7edf6;
  --store-shadow: 0 8px 26px rgba(17, 24, 39, 0.08);
}

body {
  font-family: "Montserrat", "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(circle at top right, #eaf2fb 0%, var(--store-bg) 35%, var(--store-bg) 100%);
  color: var(--store-text);
}

a {
  color: var(--store-primary);
  text-decoration: none;
}

a:visited {
  color: var(--store-primary-dark);
}

a:hover {
  color: var(--store-primary-dark);
}

.store-shell {
  width: 100%;
  max-width: none;
  margin: 0;
}

#info {
  scroll-margin-top: 150px;
}

.store-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(244, 248, 253, 0.97) 0%, rgba(238, 244, 251, 0.97) 100%);
  border-bottom: 1px solid var(--store-border);
}

.store-header.has-custom-bg {
  background-color: #eef4fb;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.22) 100%),
    var(--store-header-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.store-header .logo {
  max-height: 52px;
  width: auto;
}

.logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf2f8;
  border: 1px solid #d6deea;
  border-radius: 14px;
  padding: 0.28rem 0.62rem;
}

.logo-pill img {
  display: block;
}

.logo-pill.logo-payment img {
  filter: drop-shadow(0 1px 0 rgba(15, 76, 129, 0.18)) drop-shadow(0 2px 6px rgba(17, 24, 39, 0.14));
}

.store-btn {
  border-radius: 10px;
  border: 1px solid var(--store-border);
  background: #fff;
  color: var(--store-text);
  font-weight: 600;
  padding: 0.5rem 0.8rem;
}

.store-btn:hover {
  border-color: var(--store-primary);
  background: var(--store-subtle);
  color: var(--store-primary-dark);
}

.cart-counter {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--store-danger);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.search-panel {
  display: none;
  padding: 0.9rem;
  border-bottom: 1px solid var(--store-border);
  background: linear-gradient(180deg, #f7fafe 0%, #eef4fb 100%);
}

.store-search-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 760px;
  margin: 0 auto;
}

.store-search-input {
  flex: 1;
  min-width: 220px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--store-border);
  background: #fff;
  color: var(--store-text);
  padding: 0.55rem 0.8rem;
  font-size: 0.98rem;
  box-sizing: border-box;
}

.store-search-input:focus {
  outline: none;
  border-color: var(--store-primary);
  box-shadow: 0 0 0 0.2rem rgba(15, 76, 129, 0.15);
}

.store-search-submit {
  border: 0;
  border-radius: 10px;
  height: 44px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(120deg, var(--store-primary) 0%, #1e5f98 100%);
  box-sizing: border-box;
}

.store-search-submit:hover {
  opacity: 0.92;
}

.store-search-submit:focus-visible {
  outline: 2px solid rgba(15, 76, 129, 0.35);
  outline-offset: 2px;
}

.home-hero {
  background: linear-gradient(120deg, #0f4c81 0%, #1764a7 55%, #2b7fc8 100%);
  border-radius: 12px;
  color: #fff;
  padding: 2rem;
  box-shadow: var(--store-shadow);
}

.home-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.home-hero p {
  color: #e8f2ff;
  margin-bottom: 1.25rem;
}

.quick-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.quick-point {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
}

.top-categories {
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: 10px;
  padding: 0.8rem;
  box-shadow: var(--store-shadow);
}

.top-categories .nav-link {
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--store-border);
  color: var(--store-text);
  font-weight: 600;
  font-size: 0.9rem;
}

.top-categories .nav-link:hover {
  border-color: var(--store-primary);
  background: var(--store-subtle);
  color: var(--store-primary);
}

.sidebar-card {
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: 10px;
  box-shadow: var(--store-shadow);
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 126px);
  overflow: auto;
}

.sidebar-mobile-toggle {
  justify-content: center;
}

#mobileCategoriesCanvas .offcanvas-header {
  border-bottom: 1px solid var(--store-border);
  background: #f8fbff;
}

#mobileCategoriesCanvas .offcanvas-body {
  padding: 0.8rem;
}

#mobileCategoriesCanvas .sidebar-card {
  position: static;
  top: auto;
  max-height: none;
  overflow: visible;
  box-shadow: none;
  border-radius: 10px;
}

.sidebar-title {
  font-weight: 800;
  margin: 0;
}

.category-tree,
.category-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-tree li {
  margin: 0.15rem 0;
  position: relative;
}

.category-tree ul {
  margin-left: 0.7rem;
  padding-left: 0.55rem;
  border-left: 1px dashed #cfd8e3;
}

.category-tree a {
  display: block;
  border-radius: 8px;
  padding: 0.48rem 0.6rem;
  color: var(--store-text);
  border: 1px solid transparent;
}

.category-tree a:hover {
  background: var(--store-subtle);
  border-color: var(--store-border);
  color: var(--store-primary);
}

.category-tree a.is-active {
  background: var(--store-primary);
  border-color: var(--store-primary-dark);
  color: #ffffff !important;
}

.category-tree li.has-children.is-collapsed > ul {
  display: none;
}

.category-tree .depth-0 > a {
  background: #f5f9ff;
  border-color: #d7e4f6;
  font-weight: 700;
  font-size: 0.97rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.category-tree .depth-0 > a.is-active,
.category-tree .depth-1 > a.is-active,
.category-tree .depth-2 > a.is-active,
.category-tree .depth-3 > a.is-active {
  background: var(--store-primary) !important;
  border-color: var(--store-primary-dark) !important;
  color: #ffffff !important;
}

.category-tree .depth-0 > a::before {
  content: "";
}

.category-tree .depth-1 > a,
.category-tree .depth-2 > a,
.category-tree .depth-3 > a {
  position: relative;
  font-weight: 560;
  font-size: 0.92rem;
  text-transform: none;
  letter-spacing: 0;
}

.category-tree .depth-1 > a { margin-left: 0.2rem; padding-left: 1.1rem; }
.category-tree .depth-2 > a { margin-left: 0.4rem; padding-left: 1.2rem; }
.category-tree .depth-3 > a { margin-left: 0.6rem; padding-left: 1.3rem; }

.category-tree .depth-1 > a::before,
.category-tree .depth-2 > a::before,
.category-tree .depth-3 > a::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 50%;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  transform: translateY(-50%);
  background: #9fb2c8;
}

.category-tree a.is-active::before {
  background: #ffffff;
}

.section-title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}

.subcat-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.7rem;
}

.subcat-card {
  background: linear-gradient(180deg, #f7fbff 0%, #eef5fd 100%);
  border: 1px dashed #b9cde6;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 76, 129, 0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.subcat-media {
  aspect-ratio: 16 / 9;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-bottom: 1px dashed #c6d7ec;
  overflow: hidden;
}

.subcat-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.subcat-body {
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
  height: 100%;
}

.subcat-kicker {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3a5f88;
}

.subcat-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  min-height: 3.1rem;
  color: #123f68;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.store-cta-subcat {
  background: linear-gradient(120deg, #2c6fa8 0%, #1a4f7c 100%);
  font-size: 0.75rem;
  padding: 0.42rem 0.5rem;
  margin-top: auto !important;
  width: 100%;
}

.product-card {
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--store-shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-media {
  aspect-ratio: 4 / 3;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--store-border);
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.product-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-grow: 1;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  min-height: 2.75rem;
}

.product-meta {
  color: var(--store-muted);
  font-size: 0.85rem;
}

.price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--store-primary);
}

.price-offer {
  color: var(--store-danger);
}

.search-hit {
  color: #b42318;
  background: #fee2e2;
  border-radius: 4px;
  padding: 0 0.12rem;
}

.search-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.search-filter-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.search-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #f7caca;
  background: #fff5f5;
  color: #7f1d1d;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.88rem;
}

.search-filter-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff !important;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.search-filter-clear {
  color: var(--store-primary-dark);
  font-weight: 700;
}

.search-filter-add {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.search-filter-add .store-search-input {
  margin: 0;
}

.store-cta {
  border: 0;
  background: linear-gradient(120deg, var(--store-primary) 0%, #1e5f98 100%);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  letter-spacing: 0.01em;
}

.store-cta:hover {
  opacity: 0.92;
  color: #fff;
}

.store-cta,
a.store-cta,
a.store-cta:link,
a.store-cta:visited,
a.store-cta:hover,
a.store-cta:focus {
  color: #ffffff !important;
}

.product-body .store-cta {
  margin-top: auto !important;
}

.product-detail {
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: 10px;
  box-shadow: var(--store-shadow);
  padding: 1.25rem;
}

.product-detail h1 {
  font-size: clamp(1.4rem, 2vw, 2rem);
  font-weight: 900;
}

.info-page-content {
  line-height: 1.72;
}

.info-page-content h1,
.info-page-content h2,
.info-page-content h3 {
  color: var(--store-primary-dark);
  margin: 0 0 0.8rem 0;
}

.info-page-content h1 {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--store-border);
}

.info-page-content p:last-child {
  margin-bottom: 0;
}

.info-page-content ul,
.info-page-content ol {
  margin-bottom: 1rem;
  padding-left: 1.2rem;
}

.info-page-content a {
  color: var(--store-primary);
  font-weight: 600;
}

.info-page-content a:hover {
  color: var(--store-primary-dark);
}

.product-image-main {
  border: 1px solid var(--store-border);
  border-radius: 10px;
  background: #fff;
  padding: 1rem;
}

.thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.thumb-strip img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid var(--store-border);
  border-radius: 8px;
}

.spec-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.spec-list li {
  border-bottom: 1px dashed var(--store-border);
  padding: 0.42rem 0;
  font-size: 0.95rem;
}

.footer-wrap {
  margin-top: 2.2rem;
  background: #111827;
  color: #cbd5e1;
  border-radius: 10px 10px 0 0;
  padding: 1.5rem;
}

.footer-wrap h2 {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 700;
}

.footer-wrap a {
  color: #cbd5e1;
}

.footer-wrap a:hover {
  color: #fff;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  margin-top: 0.25rem;
}

.footer-logo img {
  display: block;
  height: 42px;
  width: auto;
}

.redes_sociales {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.red_social {
  font-size: 1.2rem;
}

/* Utilities sin inline styles */
.is-hidden {
  display: none !important;
}

.total-strong {
  font-weight: 700;
}

.checkout-panel {
  background-color: var(--store-subtle);
}

.checkout-panel-padded {
  padding: 20px;
}

.select-lang-wide {
  width: 350px;
  max-width: 100%;
}

.icon-arrow-nav {
  font-size: 60px;
  color: var(--store-primary);
}

/* Unificacion de paleta y contraste para elementos legacy */
.btn-info,
.btn-primary {
  background-color: var(--store-info) !important;
  border-color: var(--store-info) !important;
  color: #ffffff !important;
}

.btn-info:hover,
.btn-primary:hover {
  background-color: var(--store-primary-dark) !important;
  border-color: var(--store-primary-dark) !important;
}

.btn-success {
  background-color: var(--store-success) !important;
  border-color: var(--store-success) !important;
}

.btn-success:hover {
  filter: brightness(0.94);
}

.btn-light {
  border-color: var(--store-border) !important;
  color: var(--store-text) !important;
}

.caption,
.x-cat,
.x-tit-destacados,
.x-tit-novedades,
.x-tit-resultado {
  background-color: var(--store-primary) !important;
  color: #ffffff !important;
}

.x-item-cat-vertical,
.element_categorias,
.p-articulo-nombre,
.p-articulo-pv2,
.x-articulo_pv2,
.icono-blue,
.burger-icon {
  color: var(--store-primary) !important;
}

.contorno {
  border: 1px solid var(--store-border) !important;
  box-shadow: var(--store-shadow) !important;
  border-radius: 10px !important;
  background: var(--store-surface);
}

.tab {
  border-color: var(--store-border) !important;
  background-color: var(--store-subtle) !important;
}

.tab button:hover {
  background-color: var(--store-subtle-2) !important;
}

.tab button.active {
  background-color: #dbe6f5 !important;
}

.c-obs,
.product_info_descripcion {
  border-color: var(--store-border) !important;
  background: var(--store-subtle) !important;
}

/* Breadcrumb/category title */
.x-tit-categoria {
  background: transparent !important;
  border: 0 !important;
  margin: 0;
  padding: 0;
  display: inline;
  font-size: 1rem !important;
  line-height: 1.2;
}

.x-tit-categoria a {
  color: var(--store-primary-dark);
}

.x-tit-cat-element {
  display: inline-block;
  background: var(--store-subtle) !important;
  color: var(--store-primary-dark) !important;
  border: 1px solid var(--store-border);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.92rem !important;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.2rem 0.45rem;
  margin: 0 0.3rem 0.25rem 0;
}

.x-tit-cat-current {
  background: var(--store-primary) !important;
  color: #ffffff !important;
  border-color: var(--store-primary-dark);
}

.store-breadcrumbs {
  position: sticky;
  top: 74px;
  z-index: 1030;
  background: rgba(243, 245, 249, 0.98);
  border: 1px solid var(--store-border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem 0.2rem 0.6rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.06);
}

.cart-added-modal .modal-content {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  box-shadow: 0 22px 54px rgba(15, 76, 129, 0.22);
}

.cart-added-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  background: linear-gradient(145deg, var(--store-success), #29a066);
  box-shadow: 0 10px 24px rgba(31, 122, 74, 0.33);
}

.cart-added-modal .btn-primary {
  background: var(--store-primary);
  border-color: var(--store-primary-dark);
}

.cart-added-modal .btn-primary:hover {
  background: var(--store-primary-dark);
  border-color: var(--store-primary-dark);
}

.cart-page .cart-card,
.cart-page .cart-summary {
  border: 1px solid var(--store-border) !important;
  border-radius: 12px;
}

.cart-page .cart-table thead th {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--store-muted);
  border-bottom-color: var(--store-border);
}

.cart-page .cart-table td {
  border-bottom-color: #e8edf5;
}

.cart-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--store-border);
  background: #fff;
}

.cart-summary.sticky-xl-top {
  top: 96px;
}

.auth-page {
  min-height: 62vh;
}

.auth-card {
  border: 1px solid var(--store-border) !important;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.auth-form-card .form-control {
  border-radius: 10px;
  border-color: var(--store-border);
  min-height: 46px;
}

.auth-form-card .form-control:focus {
  border-color: var(--store-primary);
  box-shadow: 0 0 0 0.2rem rgba(15, 76, 129, 0.18);
}

.auth-form-card .btn-primary {
  background: var(--store-primary);
  border-color: var(--store-primary-dark);
}

.auth-form-card .btn-primary:hover {
  background: var(--store-primary-dark);
  border-color: var(--store-primary-dark);
}

@media (max-width: 1399.98px) {
  .subcat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .subcat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #info {
    scroll-margin-top: 132px;
  }

  .sidebar-card {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .store-search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .store-search-submit {
    width: 100%;
  }

  .search-filter-add {
    flex-direction: column;
    align-items: stretch;
  }

  .home-hero {
    padding: 1.25rem;
  }

  .product-title {
    min-height: auto;
  }

  .store-breadcrumbs {
    top: 68px;
  }

  .cart-page .cart-table thead {
    display: none;
  }

  .cart-page .cart-table tr {
    display: block;
    border-bottom: 1px solid #e8edf5;
    padding: 0.65rem;
  }

  .cart-page .cart-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0;
    padding: 0.35rem 0;
  }

  .cart-page .cart-table td:first-child {
    display: block;
    padding-bottom: 0.55rem;
  }

}

@media (max-width: 767.98px) {
  .top-categories {
    display: none;
  }

  .x-tit-categoria {
    font-size: 0.92rem !important;
  }

  .x-tit-cat-element {
    font-size: 0.84rem !important;
    padding: 0.16rem 0.38rem;
    margin: 0 0.22rem 0.2rem 0;
  }

  .subcat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-media {
    min-height: 180px;
  }
}
