/* ============================================================
   AHCD — Tienda page styles
   ============================================================ */

/* ── Shop layout ──────────────────────────────────────────────── */

.shop-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-32);
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 1100px) {
  .shop-layout {
    grid-template-columns: 200px 1fr;
    align-items: start;
  }
}

/* ── Category sidebar ─────────────────────────────────────────── */

.shop-sidebar {
  background-color: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
}

/* Toggle mobile */
.shop-sidebar__toggle {
  display: none;
}

@media (max-width: 1099px) {
  .shop-sidebar__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-blue);
    cursor: pointer;
  }
  .shop-sidebar__toggle-icon {
    transition: transform .25s ease;
    flex-shrink: 0;
  }
  .shop-sidebar--open .shop-sidebar__toggle-icon {
    transform: rotate(180deg);
  }
  .shop-sidebar__title {
    display: none;
  }
  .shop-cat-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, opacity .25s ease, margin-top .25s ease;
    opacity: 0;
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .shop-sidebar--open .shop-cat-list {
    max-height: 400px;
    opacity: 1;
    margin-top: var(--space-12);
  }
}

.shop-sidebar__title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-blue);
  margin: 0 0 var(--space-12);
}

.shop-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-8);
}

@media (min-width: 1100px) {
  .shop-cat-list {
    flex-direction: column;
    gap: var(--space-4);
  }
}

.shop-cat-list__btn {
  background: none;
  border: 1.5px solid var(--c-line);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-12);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  text-align: left;
  min-height: var(--touch-min);
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
  width: auto;
}

@media (min-width: 1100px) {
  .shop-cat-list__btn {
    width: 100%;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-8) var(--space-12);
  }
}



.shop-cat-list__btn--active {
  background-color: var(--c-blue);
  border-color: var(--c-blue);
  color: var(--c-white);
  font-weight: 700;
}

/* ── Product grid ─────────────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-24);
}

@media (min-width: 580px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Product card ─────────────────────────────────────────────── */

.product-card {
  background-color: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}

.product-card:hover {
  box-shadow: 0 8px 28px rgba(30, 58, 95, 0.13);
  transform: translateY(-3px);
}

.product-card__image {
  aspect-ratio: 4/3;
  background: #ececec;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Sutil patrón de puntos sobre el gradiente */
.product-card__image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: none;
  background-size: 20px 20px;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__badge {
  position: absolute;
  top: var(--space-12);
  right: var(--space-12);
  z-index: 1;
}

.product-card__icon {
  width: 52px;
  height: 52px;
  color: rgba(255, 255, 255, 0.55);
  position: relative;
  z-index: 1;
}

.product-card__icon svg {
  width: 100%;
  height: 100%;
}

.product-card__body {
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  flex: 1;
}

.product-card__cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-blue-2);
}

.product-card__name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--c-blue);
  margin: 0;
  line-height: 1.3;
}

.product-card__desc {
  font-size: var(--text-sm);
  color: var(--c-text);
  opacity: 0.65;
  margin: 0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__footer {
  padding: var(--space-12) var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  border-top: 1px solid var(--c-line);
}

.product-card__price {
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--c-blue);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.product-card__buy-btn {
  flex-shrink: 0;
}

/* ── Product empty state ───────────────────────────────────────── */

.product-grid__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-64) var(--space-24);
  color: var(--c-text);
  opacity: 0.5;
}

/* ── Info compra ──────────────────────────────────────────────── */

.ti-info {
  background-color: var(--c-blue);
  padding: var(--space-64) 0;
}

.ti-info__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-24);
}

.ti-info__title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.45);
  margin: 0 0 var(--space-48);
}

.ti-info__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.12);
}

@media (min-width: 768px) {
  .ti-info__grid {
    grid-template-columns: repeat(3, 1fr);
    border-top: none;
    border-left: 1px solid rgba(255,255,255,0.12);
  }
}

.ti-info__item {
  padding: var(--space-32) var(--space-24);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

@media (min-width: 768px) {
  .ti-info__item {
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.12);
    padding: var(--space-32);
  }
}

.ti-info__num {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.3);
  font-family: var(--font-family-ui);
}

.ti-info__name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-white);
  margin: 0;
  font-family: var(--font-family-head);
}

.ti-info__text {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.7);
  line-height: 1.65;
  margin: 0;
}

/* ── Botón carrito en product-card ───────────────────────────── */

.product-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

/* Qty counter */
.product-card__qty {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--c-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 36px;
  flex-shrink: 0;
}

.product-card__qty-btn {
  width: 32px;
  height: 100%;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 300;
  color: var(--c-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}

.product-card__qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.product-card__qty-val {
  min-width: 28px;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--c-blue);
  border-inline: 1.5px solid var(--c-line);
  line-height: 36px;
}

.product-card__cart-btn {
  flex: 1;
  justify-content: center;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.product-card__cart-btn--added {
  background-color: #e8f5e9 !important;
  border-color: #4caf50 !important;
  color: #388e3c !important;
}

.product-card__cart-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Carrito FAB ──────────────────────────────────────────────── */

.cart-fab {
  position: fixed;
  bottom: var(--space-32);
  right: var(--space-32);
  z-index: calc(var(--z-header) + 10);
  background-color: var(--c-blue);
  color: var(--c-white);
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: background-color var(--transition), transform var(--transition);
  font-family: var(--font-family-ui);
  font-size: var(--text-xs);
  font-weight: 700;
}


.cart-fab__badge {
  background-color: var(--c-red);
  color: #fff;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-fab:not(.cart-fab--has-items) .cart-fab__badge {
  display: none;
}

/* ── Overlay del carrito ─────────────────────────────────────── */

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background-color: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
  display: flex;
  justify-content: flex-end;
}

.cart-overlay--open {
  opacity: 1;
  pointer-events: all;
}

/* ── Drawer ──────────────────────────────────────────────────── */

.cart-drawer {
  background: var(--c-white);
  width: min(420px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow: hidden;
}

.cart-overlay--open .cart-drawer {
  transform: translateX(0);
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-24);
  border-bottom: 1px solid var(--c-line);
  flex-shrink: 0;
}

.cart-drawer__title {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-blue);
  margin: 0;
  font-family: var(--font-family-head);
}

.cart-drawer__close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--c-text);
  cursor: pointer;
  padding: var(--space-4);
  line-height: 1;
  opacity: 0.6;
  transition: opacity var(--transition);
}

/* Items */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-16);
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.cart-item {
  display: flex;
  gap: var(--space-12);
  padding-bottom: var(--space-16);
  border-bottom: 1px solid var(--c-line);
}

.cart-item:last-child { border-bottom: none; }

.cart-item__img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--c-blue);
}

.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }

.cart-item__img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--c-blue), var(--c-blue-2));
}

.cart-item__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
}

.cart-item__name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--c-blue);
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item__variant {
  font-size: 11px;
  color: var(--c-text);
  opacity: 0.6;
  margin: 0;
}

.cart-item__row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 2px;
}

.cart-qty-btn {
  background: none;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  color: var(--c-text);
  transition: background-color var(--transition);
}


.cart-qty-val {
  font-size: var(--text-xs);
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  color: var(--c-blue);
}

.cart-item__subtotal {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--c-blue);
  margin-left: auto;
}

.cart-item__remove {
  background: none;
  border: none;
  color: var(--c-text);
  opacity: 0.35;
  cursor: pointer;
  padding: 4px;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
}


/* Estado vacío del carrito */
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-16);
  text-align: center;
  padding: var(--space-48) var(--space-24);
  color: var(--c-text);
  opacity: 0.5;
}

.cart-empty p { margin: 0; font-size: var(--text-xs); }

/* Footer del drawer */
.cart-drawer__footer {
  padding: var(--space-24);
  border-top: 1px solid var(--c-line);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.cart-totals {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-totals__label {
  font-size: var(--text-xs);
  color: var(--c-text);
}

.cart-totals__val {
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--c-blue);
}

.cart-totals__note {
  font-size: 11px;
  color: var(--c-text);
  opacity: 0.5;
  margin: 0;
  text-align: center;
}

.cart-cta {
  text-align: center;
}

