.products {
  padding: 140px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.products__header {
  text-align: center;
  margin-bottom: 48px;
}

.products__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.products__subtitle {
  color: var(--text-light);
  font-size: 1.05rem;
}

.products__empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.products__empty p {
  margin-bottom: 20px;
}

.products__search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto 16px;
  padding: 12px 18px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-light);
  transition: border-color 0.2s ease;
}

.products__search:focus-within {
  border-color: var(--primary);
}

.products__search svg {
  flex-shrink: 0;
}

.products__search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
}

.products__count {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

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

.product-card {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.product-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card__badge-nuevo {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: #dcfce7;
  color: #15803d;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.product-card__no-image {
  color: var(--text-light);
  font-size: 0.9rem;
}

.product-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.product-card__body .btn {
  margin-top: auto;
  text-align: center;
}

.product-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: none;
  padding: 12px 24px;
  font-size: 14px;
}

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

@media (max-width: 600px) {
  .products {
    padding: 120px 16px 60px;
  }

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

/* ===========================
   MODAL DE DETALLE DE PRODUCTO
   =========================== */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1200;
}

.product-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.product-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: min(560px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--light);
  border-radius: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 1201;
  display: flex;
  flex-direction: column;
}

.product-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.product-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
}

.product-modal__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.product-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
}

.product-modal__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-modal__sku {
  font-size: 0.8rem;
  color: var(--text-light);
  font-family: monospace;
}

.product-modal__price {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}

.product-modal__obs {
  color: var(--text);
  white-space: pre-line;
  line-height: 1.5;
}

.product-modal__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.product-modal__actions .btn {
  flex: 1;
}

/* ===========================
   CARRITO
   =========================== */
.cart-toggle {
  position: fixed;
  right: 24px;
  bottom: 90px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 999;
}

.cart-toggle:hover {
  filter: brightness(1.1);
}

.cart-toggle--pulse {
  animation: cart-toggle-pulse 1.8s ease-in-out infinite;
}

.cart-toggle--bump {
  animation: cart-toggle-bump 0.4s ease;
}

@keyframes cart-toggle-pulse {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2), 0 0 0 0 var(--primary);
  }
  50% {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2), 0 0 0 8px transparent;
  }
}

@keyframes cart-toggle-bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.25);
  }
  60% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

.cart-toggle__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--secondary-dark);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1200;
}

.cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 92vw);
  background: var(--light);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1201;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

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

.cart-drawer__header h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.3rem;
  color: var(--text);
}

.cart-drawer__close {
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
}

.cart-drawer__empty {
  color: var(--text-light);
  text-align: center;
  padding: 40px 0;
}

.cart-drawer__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.cart-item__image {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.cart-item__price {
  font-size: 0.85rem;
  color: var(--text-light);
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.cart-item__qty button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.cart-item__remove {
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 1.4rem;
  cursor: pointer;
  align-self: flex-start;
}

.cart-drawer__footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  color: var(--text);
}

.cart-checkout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 16px;
}

.cart-checkout__back {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}

.cart-checkout label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.cart-checkout input,
.cart-checkout textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}

.cart-checkout__error {
  color: #dc2626;
  font-size: 0.85rem;
}

body.no-scroll {
  overflow: hidden;
}

@media (max-width: 600px) {
  .cart-toggle {
    right: 16px;
    bottom: 78px;
    width: 44px;
    height: 44px;
  }
}
