/* ==========================================================================
   Nueva tienda / home post-login
   ========================================================================== */

:root {
  --store-primary: #af3419;
  --store-primary-dark: #832713;
  --store-primary-light: #f7eae8;
  --store-gradient: linear-gradient(135deg, #c85a3f 0%, #af3419 55%, #832713 100%);
  --store-text: #2b2b2b;
  --store-text-muted: #767676;
  --store-border: #e7e7e7;
  --store-bg: #f7f7f8;
  --store-surface: #ffffff;
  --store-radius: 10px;
  --store-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --store-shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.12);
  --store-header-height: 82px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.store-body {
  background: var(--store-bg);
  color: var(--store-text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button,
select,
input {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- Header ---------- */

.store-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--store-surface);
  box-shadow: var(--store-shadow);
}

.store-mainbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  background: var(--store-surface);
}

.store-logo img {
  height: 42px;
  display: block;
}

.store-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f2f2f3;
  border: 1px solid var(--store-border);
  border-radius: 999px;
  overflow: hidden;
}

.store-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 12px 20px;
  outline: none;
}

.store-search__btn {
  flex-shrink: 0;
  width: 46px;
  height: 40px;
  margin: 3px;
  border: none;
  border-radius: 999px;
  background: var(--store-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.store-search__btn:hover {
  filter: brightness(1.08);
}

.store-search__btn svg {
  width: 19px;
  height: 19px;
}

.store-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.store-icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--store-border);
  background: var(--store-surface);
  color: var(--store-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.store-icon-btn:hover {
  border-color: var(--store-primary);
  color: var(--store-primary);
}

.store-icon-btn svg {
  width: 21px;
  height: 21px;
}

.store-icon-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--store-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-user-menu {
  position: relative;
}

.store-avatar {
  background: var(--store-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.store-avatar:hover {
  color: #fff;
  border-color: transparent;
  filter: brightness(1.08);
}

.store-user-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 230px;
  background: var(--store-surface);
  border-radius: 12px;
  box-shadow: var(--store-shadow-hover);
  padding: 16px;
  z-index: 30;
}

.store-user-popover__name {
  font-weight: 700;
}

.store-user-popover__email {
  color: var(--store-text-muted);
  font-size: 12px;
  margin: 2px 0 12px;
  word-break: break-all;
}

.store-user-popover hr {
  border: none;
  border-top: 1px solid var(--store-border);
  margin: 10px 0;
}

.store-user-popover__menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.store-user-popover__link {
  display: block;
  padding: 9px 8px;
  border-radius: 8px;
  color: var(--store-text);
  font-weight: 500;
}

.store-user-popover__link:hover {
  background: var(--store-primary-light);
  color: var(--store-primary-dark);
}

.store-user-popover__logout {
  display: block;
  text-align: center;
  padding: 9px;
  border-radius: 8px;
  background: var(--store-primary-light);
  color: var(--store-primary-dark);
  font-weight: 600;
}

.store-user-popover__logout:hover {
  background: var(--store-gradient);
  color: #fff;
}

/* ---------- Layout ---------- */

.store-layout {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 24px;
}

/* ---------- Content ---------- */

.store-content__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.store-content__head h1 {
  font-size: 22px;
  margin: 0;
}

.store-toolbar {
  display: flex;
  gap: 10px;
}

.store-toolbar select {
  border: 1px solid var(--store-border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--store-surface);
  cursor: pointer;
}

.store-resultados-info {
  color: var(--store-text-muted);
  margin: 0 0 16px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.store-estado {
  padding: 40px 20px;
  text-align: center;
  color: var(--store-text-muted);
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
}

/* ---------- Product card ---------- */

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
  box-shadow: var(--store-shadow-hover);
  transform: translateY(-3px);
}

.product-card__media {
  display: block;
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #f2f2f3;
  overflow: hidden;
}

.product-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-top: 1px solid var(--store-border);
}

.product-card__brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--store-text-muted);
}

.product-card__title {
  font-weight: 600;
  color: var(--store-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.product-card__title:hover {
  color: var(--store-primary);
}

.product-card__price {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--store-primary-dark);
}

.product-card__opciones {
  font-size: 12px;
  color: var(--store-text-muted);
}

/* ---------- Scroll infinito ---------- */

.store-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 0;
  color: var(--store-text-muted);
}

.store-loader[hidden] {
  display: none;
}

.store-loader__spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--store-border);
  border-top-color: var(--store-primary);
  animation: store-spin 0.7s linear infinite;
}

@keyframes store-spin {
  to {
    transform: rotate(360deg);
  }
}

.store-fin-resultados {
  text-align: center;
  padding: 24px 0;
  color: var(--store-text-muted);
  font-size: 13px;
}

.store-fin-resultados[hidden] {
  display: none;
}

/* ---------- Footer ---------- */

.store-footer {
  margin-top: 40px;
  padding: 24px;
  text-align: center;
  color: var(--store-text-muted);
  font-size: 12px;
}

/* ---------- Product detail page ---------- */

.store-breadcrumb {
  max-width: 1400px;
  margin: 20px auto 0;
  padding: 0 24px;
  color: var(--store-text-muted);
  font-size: 13px;
}

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

.product-detail {
  max-width: 1400px;
  margin: 16px auto 40px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(0, 1fr);
  align-items: start;
  gap: 36px;
}

.product-detail__media {
  /* Acompaña el scroll cuando la lista de opciones es más alta que la imagen */
  position: sticky;
  top: 90px;
  width: 100%;
  padding-top: 100%;
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  overflow: hidden;
}

.product-detail__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-detail__info {
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  padding: 28px;
}

.product-detail__brand {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--store-text-muted);
  font-size: 12px;
}

.product-detail__title {
  font-size: 24px;
  margin: 6px 0 14px;
}

.product-detail__price {
  font-size: 30px;
  font-weight: 700;
  color: var(--store-primary-dark);
  margin-bottom: 18px;
}

.product-detail__texto {
  color: var(--store-text);
  line-height: 1.6;
  margin-bottom: 22px;
  white-space: pre-line;
}

.product-detail__cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--store-gradient);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 600;
  cursor: not-allowed;
  opacity: 0.9;
}

.product-detail__cart-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--store-text-muted);
}

.product-detail__back {
  display: inline-block;
  margin-top: 18px;
  color: var(--store-primary);
  font-weight: 600;
}

/* ---------- Botones genéricos ---------- */

.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 6px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.store-btn--primary {
  background: var(--store-gradient);
  color: #fff;
}

.store-btn--primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.store-btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.store-btn--outline {
  background: var(--store-surface);
  color: var(--store-text);
  border: 1px solid var(--store-border);
}

.store-btn--outline:hover {
  border-color: var(--store-primary);
  color: var(--store-primary);
}

.store-btn--sm {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ---------- Botón "Agregar" en la grilla ---------- */

.product-card__add-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--store-gradient);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.product-card__add-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.product-card__add-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.product-card__add-btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- Selector de cantidad (detalle de producto) ---------- */

.product-detail__cart-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.product-detail__qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--store-border);
  border-radius: 6px;
  overflow: hidden;
}

.product-detail__qty-btn {
  width: 38px;
  border: none;
  background: var(--store-bg);
  color: var(--store-text);
  font-size: 16px;
  cursor: pointer;
}

.product-detail__qty-btn:hover {
  background: var(--store-primary-light);
  color: var(--store-primary-dark);
}

.product-detail__qty input {
  width: 46px;
  border: none;
  border-left: 1px solid var(--store-border);
  border-right: 1px solid var(--store-border);
  text-align: center;
  padding: 10px 0;
  outline: none;
  -moz-appearance: textfield;
}

.product-detail__qty input::-webkit-outer-spin-button,
.product-detail__qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.product-detail__cart-btn {
  cursor: pointer;
  opacity: 1;
}

.product-detail__cart-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

a.product-card__add-btn {
  text-decoration: none;
}

/* ---------- Selector de opciones (detalle de producto) ---------- */

.product-variants {
  border: 1px solid var(--store-border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 14px;
}

.product-variants__title {
  font-size: 16px;
  margin: 0 0 12px;
}

.product-variants__row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 6px;
}

.product-variants__row:last-child {
  margin-bottom: 0;
}

.product-variants__name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--store-bg);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
  overflow-wrap: anywhere;
}

.product-variants__row .product-detail__qty {
  flex-shrink: 0;
}

.product-variants__row .product-detail__qty input {
  width: 64px;
}

.product-variants__error {
  color: #c0392b;
  font-size: 13px;
  margin: 0 0 10px;
}

.product-detail__cart-row--end {
  justify-content: flex-end;
}

/* ---------- Carrito: drawer lateral ---------- */

.cart-drawer[hidden] {
  display: none;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 12, 0.45);
  animation: cart-fade-in 0.15s ease;
}

.cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: 420px;
  background: var(--store-surface);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.18);
  animation: cart-slide-in 0.2s ease;
}

@keyframes cart-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes cart-slide-in {
  from {
    transform: translateX(100%);
  }
}

.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--store-gradient);
  color: #fff;
}

.cart-drawer__head h2 {
  margin: 0;
  font-size: 18px;
}

.cart-drawer__close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
}

.cart-drawer__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--store-border);
}

.cart-drawer__item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #f2f2f3;
  flex-shrink: 0;
}

.cart-drawer__item-info {
  flex: 1;
  min-width: 0;
}

/* Marca (arriba) y Descripcion (abajo) en carrito, drawer y checkout */
.store-item-marca {
  display: block;
  font-weight: 700;
  color: var(--store-text);
}

.store-item-desc {
  font-weight: 400;
  color: #555555;
}

.cart-drawer__item-name {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.cart-drawer__item-qty {
  color: var(--store-text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.cart-drawer__item-remove {
  border: none;
  background: transparent;
  color: var(--store-text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.cart-drawer__item-remove:hover {
  color: var(--store-primary);
}

.cart-drawer__empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--store-text-muted);
  padding: 40px 0;
}

.cart-drawer__empty svg {
  width: 64px;
  height: 64px;
  color: var(--store-border);
}

.cart-drawer__footer {
  padding: 18px 24px 24px;
  border-top: 1px solid var(--store-border);
}

.cart-drawer__footer[hidden] {
  display: none;
}

.cart-drawer__subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 16px;
}

.cart-drawer__actions {
  display: flex;
  gap: 10px;
}

.cart-drawer__actions .store-btn {
  flex: 1;
}

/* Botón de cierre visible al pie del drawer (además de la X del encabezado) */
.cart-drawer__continue {
  padding: 0 24px 20px;
}

.cart-drawer__footer:not([hidden]) {
  padding-bottom: 12px;
}

.cart-drawer__footer[hidden] + .cart-drawer__continue {
  padding-top: 16px;
  border-top: 1px solid var(--store-border);
}

.cart-drawer__continue-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--store-primary);
  border-radius: 6px;
  background: var(--store-primary-light);
  color: var(--store-primary-dark);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.cart-drawer__continue-btn:hover {
  background: var(--store-primary);
  color: #fff;
}

.cart-drawer__continue-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---------- Aviso (toast) al agregar al carrito ---------- */

.store-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 14px 12px 16px;
  border-radius: var(--store-radius);
  background: #2b2b2b;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.store-toast--visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.store-toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2e9e5b;
  flex-shrink: 0;
}

.store-toast__icon svg {
  width: 14px;
  height: 14px;
}

.store-toast__msg {
  flex: 1;
  min-width: 0;
}

.store-toast__action {
  border: none;
  border-radius: 6px;
  padding: 7px 12px;
  background: var(--store-gradient);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.store-toast__action[hidden] {
  display: none;
}

/* ---------- Página completa del carrito ---------- */

.cart-page {
  max-width: 1400px;
  margin: 24px auto 40px;
  padding: 0 24px;
}

.cart-page__title {
  font-size: 22px;
  margin: 0 0 20px;
}

.cart-page__layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.cart-page__layout[hidden] {
  display: none;
}

.cart-page__table-wrap {
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  overflow-x: auto;
}

.cart-page__table {
  width: 100%;
  border-collapse: collapse;
}

.cart-page__table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--store-text-muted);
  padding: 16px;
  border-bottom: 1px solid var(--store-border);
  white-space: nowrap;
}

.cart-page__table td {
  padding: 16px;
  border-bottom: 1px solid var(--store-border);
  vertical-align: middle;
}

.cart-page__table tr:last-child td {
  border-bottom: none;
}

.cart-page__item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #f2f2f3;
  display: block;
}

.cart-page__item-total {
  font-weight: 700;
  color: var(--store-primary-dark);
  white-space: nowrap;
}

.cart-page__qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--store-border);
  border-radius: 6px;
  padding: 4px 6px;
}

.cart-page__qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  color: var(--store-text);
}

.cart-page__qty-btn:hover:not(:disabled) {
  color: var(--store-primary);
}

.cart-page__qty-value {
  min-width: 18px;
  text-align: center;
  font-weight: 600;
}

.cart-page__remove {
  border: none;
  background: transparent;
  color: var(--store-text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cart-page__remove:hover:not(:disabled) {
  color: var(--store-primary);
}

.cart-page__summary {
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  padding: 22px;
}

.cart-page__summary h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 16px;
}

.cart-page__summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--store-border);
}

.cart-page__summary-row--total {
  border-bottom: none;
  font-size: 18px;
  padding-top: 14px;
}

.cart-page__checkout-btn {
  width: 100%;
  margin-top: 8px;
}

.cart-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  color: var(--store-text-muted);
}

.cart-page__empty[hidden] {
  display: none;
}

.cart-page__empty svg {
  width: 64px;
  height: 64px;
  color: var(--store-border);
}

/* ---------- Finalizar compra ---------- */

.checkout-page {
  max-width: 1100px;
  margin: 24px auto 40px;
  padding: 0 24px;
}

.checkout-page__title {
  font-size: 22px;
  margin: 0 0 20px;
}

.checkout-page__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.checkout-page__layout[hidden] {
  display: none;
}

.checkout-page__form {
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  padding: 22px;
}

.checkout-page__form h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
}

.checkout-page__form textarea {
  width: 100%;
  border: 1px solid var(--store-border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--store-bg);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.checkout-page__form textarea:focus {
  border-color: var(--store-primary);
  background: var(--store-surface);
}

.checkout-page__error {
  color: var(--store-primary-dark);
  background: var(--store-primary-light);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 14px 0 0;
  font-size: 13px;
}

.checkout-page__error[hidden] {
  display: none;
}

.checkout-page__summary {
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  padding: 22px;
}

.checkout-page__summary h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 16px;
}

.checkout-page__items {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.checkout-page__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--store-border);
  font-size: 13px;
}

.checkout-page__item-name {
  flex: 1;
}

.checkout-page__item-qty {
  color: var(--store-text-muted);
  margin-left: 4px;
}

.checkout-page__item-total {
  font-weight: 600;
  white-space: nowrap;
}

.checkout-page__summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--store-border);
}

.checkout-page__summary-row--total {
  border-bottom: none;
  font-size: 18px;
  padding-top: 14px;
}

.checkout-page__confirm-btn {
  width: 100%;
  margin-top: 8px;
}

.checkout-page__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 60px 20px;
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
}

.checkout-page__success[hidden] {
  display: none;
}

.checkout-page__success svg {
  width: 64px;
  height: 64px;
  color: var(--store-primary);
}

.checkout-page__success h2 {
  margin: 0;
}

.checkout-page__success p {
  color: var(--store-text-muted);
  margin: 0;
}

/* ---------- Listados (Mis pedidos / Mis comprobantes / Mis presupuestos) ---------- */

.list-page {
  max-width: 1400px;
  margin: 24px auto 40px;
  padding: 0 24px;
}

.list-page__title {
  font-size: 22px;
  margin: 0 0 20px;
}

.list-page__table-wrap {
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  overflow-x: auto;
}

.list-page__table {
  width: 100%;
  border-collapse: collapse;
}

.list-page__table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--store-text-muted);
  padding: 16px;
  border-bottom: 1px solid var(--store-border);
  white-space: nowrap;
}

.list-page__table td {
  padding: 16px;
  border-bottom: 1px solid var(--store-border);
  vertical-align: middle;
}

.list-page__table tr:last-child td {
  border-bottom: none;
}

.list-page__total {
  font-weight: 700;
  color: var(--store-primary-dark);
  white-space: nowrap;
}

.list-page__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  color: var(--store-text-muted);
}

.list-page__empty[hidden] {
  display: none;
}

.list-page__empty svg {
  width: 64px;
  height: 64px;
  color: var(--store-border);
}

.status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge--completo {
  background: #e5f6ea;
  color: #1e7b3a;
}

.status-badge--pendiente {
  background: #fdf3d8;
  color: #93700c;
}

.status-badge--anulado {
  background: #fbe6e4;
  color: var(--store-primary-dark);
}

/* ---------- Modal de detalle (Ver detalle de pedido) ---------- */

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.detail-modal[hidden] {
  display: none;
}

.detail-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 12, 0.45);
  animation: cart-fade-in 0.15s ease;
}

.detail-modal__panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--store-surface);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow-hover);
  overflow: hidden;
}

.detail-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--store-gradient);
  color: #fff;
}

.detail-modal__head h2 {
  margin: 0;
  font-size: 16px;
}

.detail-modal__close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.detail-modal__body {
  padding: 8px 22px 22px;
  overflow-y: auto;
}

.detail-modal__table {
  width: 100%;
  border-collapse: collapse;
}

.detail-modal__table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--store-text-muted);
  padding: 12px 8px;
  border-bottom: 1px solid var(--store-border);
  white-space: nowrap;
}

.detail-modal__table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--store-border);
}

.detail-modal__table tr:last-child td {
  border-bottom: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .product-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  /* En una sola columna la imagen deja de quedar fija al hacer scroll */
  .product-detail__media {
    position: relative;
    top: auto;
    width: 100%;
    max-width: 460px;
    padding-top: 0;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }

  .cart-page__layout {
    grid-template-columns: 1fr;
  }

  .checkout-page__layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .store-mainbar {
    flex-wrap: wrap;
  }

  .store-search {
    order: 3;
    width: 100%;
  }

  .store-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .cart-drawer__panel {
    max-width: 100%;
  }

  .store-breadcrumb,
  .product-detail {
    padding: 0 16px;
  }

  .product-detail__info {
    padding: 18px;
  }

  .product-detail__title {
    font-size: 20px;
    overflow-wrap: anywhere;
  }

  .product-detail__price {
    font-size: 24px;
  }

  .product-variants {
    padding: 12px;
  }

  .store-toast {
    bottom: 16px;
  }

  .cart-page__table thead {
    display: none;
  }

  .cart-page__table,
  .cart-page__table tbody,
  .cart-page__table tr,
  .cart-page__table td {
    display: block;
    width: 100%;
  }

  .cart-page__table tr {
    padding: 14px 16px;
  }

  .cart-page__table td {
    border-bottom: none;
    padding: 6px 0;
    text-align: left;
  }

  .cart-page__table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--store-text-muted);
    margin-bottom: 4px;
  }

  .list-page__table thead {
    display: none;
  }

  .list-page__table,
  .list-page__table tbody,
  .list-page__table tr,
  .list-page__table td {
    display: block;
    width: 100%;
  }

  .list-page__table tr {
    padding: 14px 16px;
  }

  .list-page__table td {
    border-bottom: none;
    padding: 6px 0;
    text-align: left;
  }

  .list-page__table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--store-text-muted);
    margin-bottom: 4px;
  }
}

/* ---------- Login ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--store-bg);
  background-image: radial-gradient(circle at 12% 15%, var(--store-primary-light) 0%, transparent 45%),
    radial-gradient(circle at 88% 85%, var(--store-primary-light) 0%, transparent 45%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--store-surface);
  border-radius: 18px;
  box-shadow: var(--store-shadow-hover);
  padding: 40px 36px;
  text-align: center;
}

.login-card__logo img {
  height: 52px;
  margin-bottom: 20px;
}

.login-card__title {
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--store-text);
}

.login-card__subtitle {
  color: var(--store-text-muted);
  margin: 0 0 26px;
}

.login-alert {
  background: var(--store-primary-light);
  color: var(--store-primary-dark);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 13px;
  text-align: left;
}

.login-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--store-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  border: 1px solid var(--store-border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--store-bg);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.login-field input:focus {
  border-color: var(--store-primary);
  background: var(--store-surface);
}

.login-password {
  position: relative;
}

.login-password input {
  padding-right: 46px;
}

.login-password__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--store-text-muted);
  cursor: pointer;
  border-radius: 6px;
}

.login-password__toggle:hover,
.login-password__toggle:focus-visible {
  color: var(--store-primary);
}

.login-submit {
  margin-top: 4px;
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  background: var(--store-gradient);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.login-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.login-footer {
  margin-top: 26px;
  text-align: center;
  color: var(--store-text-muted);
  font-size: 12px;
}

/* Opciones del detalle de producto: descripción en una fila completa y la
   cantidad debajo, en celulares y en pantallas de 901px a 1080px (donde la
   columna de opciones queda angosta al lado de la imagen). */
@media (max-width: 640px), (min-width: 901px) and (max-width: 1080px) {
  .product-variants__row {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--store-border);
  }

  .product-variants__row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }

  .product-variants__row .product-detail__qty {
    align-self: stretch;
  }

  .product-variants__row .product-detail__qty-btn {
    width: 48px;
    align-self: stretch;
  }

  .product-variants__row .product-detail__qty input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
}
