:root {
  --primary-green: #198754;
  --dark-green: #146c43;
  --light-bg: #f8f9fa;
  --text-muted: #6c757d;
  --border-radius: 1rem;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
  font-family: 'Segoe UI', Roboto, sans-serif;
  background-color: var(--light-bg);
  padding-top: 160px;
  /* Ajustado para el nuevo header */
}

/* Header Estilizado */
#site-header {
  border-bottom: 2px solid #eee;
}

.header-info p {
  font-size: 0.85rem;
  color: var(--dark-green);
  margin: 0;
}

/* Categorías con Scroll Horizontal */
.category-nav {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  gap: 10px;
  padding: 10px 0;
  scrollbar-width: none;
  /* Firefox */
}

.category-nav::-webkit-scrollbar {
  display: none;
}

/* Chrome/Safari */

.category-btn {
  background: white;
  border: 1px solid #ddd;
  border-radius: 2rem;
  padding: 8px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-btn.active {
  background: var(--primary-green);
  color: white;
  border-color: var(--primary-green);
}

/* Tarjetas de Producto */
.product-card {
  border: none;
  border-radius: var(--border-radius);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  background: white;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.product-card img {
  height: 180px;
  object-fit: contain;
  padding: 15px;
  background: #fff;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  /* Line clamping: máximo 2 líneas */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.5rem;
}

.price-tag {
  color: var(--primary-green);
  font-size: 1.25rem;
  font-weight: 700;
}

/* Badges */
.oferta-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #dc3545;
  color: white;
  padding: 4px 12px;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: bold;
  z-index: 10;
}

/* Botón flotante */
#floatingCart {
  background-color: var(--primary-green);
  box-shadow: 0 4px 15px rgba(25, 135, 84, 0.4);
}

.product-identity {
  min-height: 1.2rem;
  margin: 0;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.35;
}

.product-modal-identity {
  margin: -4px 0 10px;
  color: #64748b;
  font-size: .9rem;
  font-weight: 700;
}

.store-intro { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:20px; margin:24px 0 12px; padding:26px; background:#eaf4ed; border:1px solid #cfe4d5; border-radius:16px; color:#174d32; }
.store-intro h1 { font-size:clamp(1.4rem,3vw,2rem); font-weight:700; margin:8px 0; max-width:650px; }
.store-intro p { margin:0; }
.store-eyebrow { font-size:.78rem; letter-spacing:.06em; text-transform:uppercase; }
.store-assurance { font-size:.86rem; line-height:1.7; }
.catalog-freshness { color:#476052; font-size:.85rem; margin:12px 0 22px; }
.checkout-identity { background:#f2f7f3; border:1px solid #cfe4d5; border-radius:12px; padding:16px; margin-bottom:20px; display:grid; gap:10px; }
.checkout-identity legend { float:none; width:auto; font-size:1rem; font-weight:700; margin:0; }
.checkout-identity > label { display:flex; align-items:center; gap:10px; min-height:44px; cursor:pointer; }
#clientIdentityFields:not([hidden]) { display:grid; gap:8px; }
.checkout-identity small { color:#475b50; line-height:1.5; }
.product-add { min-width:44px; min-height:44px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline:3px solid #1b6f4a; outline-offset:3px; }

main { min-height: 55vh; }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.catalog-title { margin: 0; color: #1f2937; font-size: 1.35rem; font-weight: 700; }
.catalog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.brand-select { width: min(260px, 42vw); min-height: 42px; border-color: #d1d5db; font-size: .9rem; }
.share-current-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; font-weight: 700; white-space: nowrap; }
.product-image-button { width: 100%; border: 0; background: #fff; cursor: pointer; }
.product-share-button { position: absolute; top: 10px; right: 10px; z-index: 11; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #d1d5db; border-radius: 50%; background: rgba(255,255,255,.96); color: #166534; box-shadow: 0 3px 10px rgba(15,23,42,.12); }
.product-share-button:hover, .product-share-button:focus-visible { border-color: #198754; background: #ecfdf5; color: #14532d; }
.product-add { width: 36px; height: 36px; border-radius: 50%; flex: 0 0 36px; }
.product-modal-image { max-height: 280px; object-fit: contain; }
.product-modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.product-modal-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; color: #64748b; font-size: .82rem; }
.product-modal-meta button { border: 0; padding: 0; background: transparent; color: #166534; font-weight: 700; text-align: left; }
.product-modal-meta button:hover, .product-modal-meta button:focus-visible { text-decoration: underline; }
.product-modal-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 18px; }
.product-modal-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; font-weight: 700; }
.share-modal-content { border-radius: 8px; }
.share-modal-subtitle { margin: 3px 0 0; color: #64748b; font-size: .82rem; }
.share-kind-selector { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); overflow: hidden; border: 1px solid #d1d5db; border-radius: 7px; }
.share-kind-selector button { min-height: 42px; border: 0; border-right: 1px solid #d1d5db; background: #fff; color: #475569; font-size: .84rem; font-weight: 700; }
.share-kind-selector button:last-child { border-right: 0; }
.share-kind-selector button.active { background: #166534; color: #fff; }
.share-kind-selector button[hidden] { display: none; }
.share-url-group input { min-width: 0; background: #f8fafc; font-size: .82rem; }
.share-url-group .btn { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.share-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 16px; }
.share-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; font-weight: 700; }
.image-fallback { opacity: .4; padding: 26px !important; }
#cart-panel { max-width: 100vw; }
#cart-panel .form-label { margin: 7px 0 4px; color: #334155; font-size: .75rem; font-weight: 700; }
.location-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; }
.location-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; font-weight: 700; }
.location-button[disabled] { cursor: wait; }
.location-clear { min-height: 38px; color: #64748b; font-weight: 700; text-decoration: none; }
.location-clear:hover, .location-clear:focus-visible { color: #334155; text-decoration: underline; }
.location-status { min-height: 1.25rem; margin: 5px 0 8px; color: #64748b; font-size: .76rem; line-height: 1.35; }
.location-status[data-state="loading"] { color: #1d4ed8; }
.location-status[data-state="success"] { color: #166534; }
.location-status[data-state="warning"] { color: #92400e; }
.location-status[data-state="error"] { color: #991b1b; }
.checkout-destination-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.checkout-destination-grid label { min-width: 0; }
.checkout-destination-grid .form-label { display: block; }
.checkout-shipping-extra { margin: 12px 0 4px; padding: 12px; border: 1px solid #fed7aa; border-radius: 8px; background: #fff7ed; }
.checkout-shipping-extra[hidden] { display: none; }
.checkout-shipping-extra > p { margin: 0 0 4px; color: #9a3412; font-size: .8rem; font-weight: 800; }
.checkout-shipping-extra .form-label small { color: #64748b; font-size: .7rem; }
.cart-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e5e7eb; }
.cart-line-detail { min-width: 0; }
.cart-line-detail small { display: block; }
.cart-line-detail .cart-product-identity { color: #64748b; font-weight: 700; }
.cart-line p { margin: 0; font-size: .86rem; font-weight: 700; }
.cart-line small { color: #64748b; }
.cart-line-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.cart-stepper { display: grid; grid-template-columns: 30px minmax(58px, 72px) 30px; align-items: center; text-align: center; }
.cart-stepper button { width: 30px; height: 30px; border: 1px solid #d1d5db; border-radius: 50%; background: #fff; color: #166534; }
.cart-quantity-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px; margin: 0; }
.cart-quantity-input { width: 100%; min-width: 0; height: 32px; padding: 3px 2px; border: 1px solid #bbd8c1; border-radius: 6px; background: #fff; color: #14532d; font-size: .82rem; font-weight: 800; text-align: center; }
.cart-quantity-input:focus { outline: 2px solid rgba(22, 101, 52, .22); border-color: #166534; }
.cart-quantity-editor small { color: #64748b; font-size: .68rem; white-space: nowrap; }
.cart-remove { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #fecaca; border-radius: 7px; background: #fff; color: #b91c1c; }
.cart-remove:hover, .cart-remove:focus-visible { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.cart-empty { padding: 28px 10px; color: #64748b; text-align: center; }
.store-loading, .store-empty { display: grid; place-items: center; gap: 8px; min-height: 230px; color: #64748b; text-align: center; }
.store-empty i { font-size: 28px; }
.store-empty strong { color: #1f2937; font-size: 18px; }
.store-notice { position: fixed; left: 50%; bottom: 24px; z-index: 3000; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); padding: 13px 16px; border-radius: 8px; background: #1f2937; color: #fff; box-shadow: 0 14px 35px rgba(15,23,42,.3); font-weight: 700; text-align: center; }
.store-notice.error { background: #991b1b; }
.store-notice.warning { background: #92400e; }
.order-success-modal { border-radius: 8px; }
.order-success-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: #dcfce7; color: #166534; font-size: 34px; }

@media (max-width: 767px) {
  body { padding-top: 205px; }
  #cart-panel { width: 100% !important; padding: 20px !important; }
  .checkout-destination-grid { grid-template-columns: 1fr; gap: 2px; }
  .header-logo img { height: 55px !important; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .catalog-actions { justify-content: stretch; }
  .brand-select { width: 100%; min-width: 0; }
  .share-current-button { flex: 0 0 44px; width: 44px; padding: 0; }
  .share-current-button span { display: none; }
  .product-card img { height: 145px; padding: 10px; }
  .product-share-button { top: 7px; right: 7px; width: 34px; height: 34px; }
  .product-modal-actions { grid-template-columns: 1fr; }
  .share-kind-selector button { padding: 6px 4px; font-size: .76rem; }
  .share-actions { grid-template-columns: 1fr; }
}
.store-account-actions { display: grid; gap: 8px; flex-shrink: 0; }
.header-logo { display: grid; justify-items: start; gap: 2px; }
.store-brand-label { color: #64748b; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.store-account-modal { border-radius: 18px; }
#storeAccountModal { z-index: 2200; }
body:has(#storeAccountModal.show) .modal-backdrop { z-index: 2100; }
#storeAccountModal .form-control { min-height: 44px; }
#accountMessage { color: #854d0e; }
#accountMessage[data-kind="error"] { color: #b42318; }
#accountMessage[data-kind="success"] { color: #166534; }
#storeProfileForm .checkout-destination-grid { margin-bottom: 10px; }
#storeAccountStatus { font-size: .92rem; margin-bottom: 0; }
.checkout-identity { display: grid; gap: 10px; }
.checkout-registered-data { padding: 10px 12px; border: 1px solid #bbd8c1; border-radius: 8px; background: #f0fdf4; }
.checkout-registered-data strong { display: block; color: #14532d; font-size: .84rem; }
.checkout-registered-data dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 8px; margin: 7px 0 0; font-size: .78rem; }
.checkout-registered-data dt { color: #64748b; font-weight: 700; }
.checkout-registered-data dd { min-width: 0; margin: 0; color: #1f2937; font-weight: 700; overflow-wrap: anywhere; }
.checkout-registered-data p { margin: 7px 0 0; color: #64748b; font-size: .72rem; }
.account-locked { background: #f1f5f9 !important; color: #475569; cursor: not-allowed; }
