/* ==========================================================================
   COMPONENTS.CSS  —  Cards · Forms · FAQ · Modals · Gallery · Misc UI
   ========================================================================== */

/* ── 1. Base card ───────────────────────────────────────────────────────── */

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--r-md, 20px);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--t-base, 0.22s) var(--ease-out, ease),
    box-shadow var(--t-base, 0.22s) var(--ease-out, ease);
}

.card:where(a, [href]):hover,
a.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-media {
  overflow: hidden;
  background: linear-gradient(145deg, #f6e7cf, #fff8ef);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow, 0.38s) var(--ease-out, ease);
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-body {
  display: grid;
  gap: 0.9rem;
  padding: var(--sp-5, 1.25rem) var(--sp-5, 1.25rem);
}

.card-meta {
  color: var(--primary-strong, #8b4f0a);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--ink, #1d1007);
  text-decoration: none;
}


/* ── 2. Product & category cards ────────────────────────────────────────── */

.category-card__link,
.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.category-card__media {
  aspect-ratio: 4 / 3;
}

.product-card__media {
  aspect-ratio: 1 / 1;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4, 1rem);
  margin-top: auto;
  padding-top: var(--sp-3, 0.75rem);
}


/* ── 3. Info / feature / value cards ────────────────────────────────────── */

.step-card,
.value-card,
.feature-card,
.info-card {
  padding: var(--sp-6, 1.5rem);
}

.step-card__number {
  display: block;
  margin-bottom: var(--sp-3, 0.75rem);
  color: rgba(196, 122, 32, 0.32);
  font-size: 2.2rem;
  font-weight: 700;
  font-family: "Cormorant Garamond", serif;
  line-height: 1;
}

.feature-card,
.info-card {
  display: flex;
  gap: var(--sp-4, 1rem);
  align-items: flex-start;
}

.feature-card .icon,
.info-card .icon {
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md, 20px);
  background: rgba(196, 122, 32, 0.12);
  color: var(--primary-strong, #8b4f0a);
  font-size: 1.1rem;
}

.contact-stack {
  display: grid;
  gap: var(--sp-4, 1rem);
}


/* ── 4. Form panels ─────────────────────────────────────────────────────── */

.form-panel,
.product-copy {
  padding: var(--sp-7, 1.75rem);
  border-radius: var(--r-xl, 32px);
  background: rgba(255, 254, 249, 0.9);
  border: 1px solid rgba(196, 122, 32, 0.12);
  box-shadow: 0 8px 28px rgba(45, 24, 7, 0.06), 0 2px 8px rgba(45, 24, 7, 0.03);
}

.product-copy {
  display: grid;
  gap: var(--sp-4, 1rem);
}

.form-stack {
  display: grid;
  gap: var(--sp-4, 1rem);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4, 1rem);
}

/* Labels */
.form-stack label {
  display: grid;
  gap: 0.45rem;
  color: #2b1606;
  font-weight: 700;
  font-size: 0.93rem;
  letter-spacing: 0.01em;
}

/* Inputs */
.form-stack input,
.form-stack textarea,
.form-stack select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid rgba(196, 122, 32, 0.22);
  border-radius: var(--r-lg, 24px);
  background: rgba(255, 254, 250, 0.96);
  color: var(--ink, #1d1007);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition:
    border-color var(--t-fast, 0.14s) var(--ease-out, ease),
    box-shadow var(--t-fast, 0.14s) var(--ease-out, ease),
    background var(--t-fast, 0.14s) var(--ease-out, ease);
  appearance: none;
  -webkit-appearance: none;
}

.form-stack input:hover,
.form-stack textarea:hover,
.form-stack select:hover {
  border-color: rgba(196, 122, 32, 0.42);
  background: #ffffff;
}

.form-stack input:focus,
.form-stack textarea:focus,
.form-stack select:focus {
  outline: none;
  border-color: var(--primary, #c47a20);
  background: #fffefb;
  box-shadow: 0 0 0 3px rgba(196, 122, 32, 0.15), 0 2px 8px rgba(45, 24, 7, 0.06);
}

.form-stack textarea {
  resize: vertical;
  min-height: 8rem;
}

.form-stack select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b5e3c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
  cursor: pointer;
}

/* Form actions row */
.form-actions {
  display: flex;
  gap: var(--sp-3, 0.75rem);
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Flash feedback */
.form-feedback {
  padding: 0.9rem 1.1rem;
  border-radius: var(--r-lg, 24px);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-feedback.is-success {
  background: rgba(46, 125, 90, 0.1);
  color: var(--success, #2e7d5a);
  border: 1px solid rgba(46, 125, 90, 0.2);
}

.form-feedback.is-error {
  background: rgba(181, 72, 58, 0.1);
  color: var(--danger, #b5483a);
  border: 1px solid rgba(181, 72, 58, 0.2);
}

.form-hint {
  font-size: 0.875rem;
  color: var(--text-soft, #6b5a42);
}


/* ── 5. Product detail ──────────────────────────────────────────────────── */

.product-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: var(--sp-8, 2rem);
}

.product-media {
  overflow: hidden;
  border-radius: var(--r-lg, 24px);
  box-shadow: var(--shadow-lg);
}

.product-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.product-price {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary-strong, #8b4f0a);
  line-height: 1;
}

.product-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success, #2e7d5a);
  font-weight: 700;
  font-size: 0.95rem;
}

.product-related {
  margin-top: var(--sp-12, 3rem);
}


/* ── 7. Search field ────────────────────────────────────────────────────── */

.search-field {
  position: relative;
}

.search-field .icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: var(--text-soft, #6b5a42);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 1.5px solid var(--line, rgba(196, 122, 32, 0.2));
  border-radius: var(--r-pill, 999px);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.97rem;
  color: var(--ink, #1d1007);
  font-family: inherit;
  transition: border-color var(--t-fast, 0.14s) ease,
    box-shadow var(--t-fast, 0.14s) ease;
}

.search-field input:focus {
  outline: 2px solid rgba(201, 120, 31, 0.35);
  outline-offset: 1px;
  border-color: var(--primary, #c47a20);
  box-shadow: 0 0 0 3px rgba(196, 122, 32, 0.14);
}


/* ── 8. Catalog sidebar ─────────────────────────────────────────────────── */

.catalog-toolbar {
  display: grid;
  gap: var(--sp-4, 1rem);
}

.catalog-toolbar__count {
  color: var(--text-soft, #6b5a42);
  font-weight: 600;
  font-size: 0.9rem;
}


/* ── 9. Gallery grid ────────────────────────────────────────────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4, 1rem);
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl, 32px);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow, 0.38s) var(--ease-out, ease);
}

.gallery-card:hover img {
  transform: scale(1.06);
}

.gallery-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(18, 10, 4, 0.72) 0%,
      transparent 55%);
  opacity: 0;
  transition: opacity var(--t-base, 0.22s) ease;
}

.gallery-card:hover .gallery-card__overlay {
  opacity: 1;
}

.gallery-card__title {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--r-lg, 24px);
  background: rgba(20, 12, 6, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff8ef;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  transform: translateY(4px);
  opacity: 0;
  transition:
    opacity var(--t-base, 0.22s) ease,
    transform var(--t-base, 0.22s) var(--ease-out, ease);
}

.gallery-card:hover .gallery-card__title {
  opacity: 1;
  transform: translateY(0);
}

/* ── 10. Lightbox ───────────────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(0.9rem, 2vw, 1.4rem);
}

.lightbox.is-visible {
  display: flex;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 6, 3, 0.78), rgba(18, 10, 4, 0.9));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 1120px);
  max-height: min(92dvh, 980px);
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 231, 194, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.985), rgba(255, 247, 236, 0.97));
  box-shadow:
    0 30px 80px rgba(10, 5, 2, 0.32),
    0 10px 28px rgba(10, 5, 2, 0.18);
}

.lightbox__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-height: min(92dvh, 980px);
}

.lightbox__media-wrap {
  background:
    linear-gradient(135deg, rgba(247, 230, 201, 0.36), rgba(255, 247, 232, 0.2));
  overflow: auto;
  max-height: calc(92dvh - 96px);
}

.lightbox__media-wrap img,
.lightbox__panel img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(92dvh - 120px);
  object-fit: contain;
  margin: 0 auto;
}

.lightbox__meta {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.15rem 1.1rem;
  border-top: 1px solid rgba(130, 77, 20, 0.1);
  background: rgba(255, 251, 245, 0.92);
}

.lightbox__eyebrow {
  margin: 0;
  color: #a05515;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lightbox__title,
.lightbox__panel p {
  margin: 0;
  color: #1d1007;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 700;
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 3;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 122, 32, 0.18);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 10px 22px rgba(18, 10, 4, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.32rem;
  color: #1d1007;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: #ffffff;
  border-color: rgba(196, 122, 32, 0.28);
  transform: scale(1.04);
  box-shadow:
    0 14px 26px rgba(18, 10, 4, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.lightbox__close span {
  line-height: 1;
  transform: translateY(-1px);
}

/* Video dentro del lightbox */
.lightbox__media-wrap video {
  display: block;
  width: 100%;
  max-height: 80dvh;
  border-radius: inherit;
  background: #0c0c0c;
}

/* Badge de vídeo sobre la miniatura en la galería */
.gallery-card__video-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  background: rgba(10, 10, 10, 0.68);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.26rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Miniatura de vídeo en la card (mismo comportamiento que img) */
.gallery-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.42s ease;
}

.gallery-card:hover video {
  transform: scale(1.05);
}

body.modal-open {
  overflow: hidden;
}

/* Tablet */
@media (max-width: 900px) {
  .lightbox {
    padding: 1rem;
  }

  .lightbox__panel {
    border-radius: 22px;
  }

  .lightbox__media-wrap img,
  .lightbox__media-wrap video,
  .lightbox__panel img {
    max-height: calc(92dvh - 112px);
  }

  .lightbox__meta {
    padding: 0.9rem 1rem 1rem;
  }

  .lightbox__title,
  .lightbox__panel p {
    font-size: 0.96rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .lightbox {
    padding: 0.6rem;
    align-items: flex-end;
  }

  .lightbox__panel {
    width: 100%;
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
  }

  .lightbox__content {
    max-height: 94dvh;
  }

  .lightbox__media-wrap {
    max-height: calc(94dvh - 82px);
  }

  .lightbox__media-wrap img,
  .lightbox__media-wrap video,
  .lightbox__panel img {
    max-height: calc(94dvh - 96px);
  }

  .lightbox__meta {
    gap: 0.25rem;
    padding: 0.8rem 0.9rem 0.95rem;
  }

  .lightbox__eyebrow {
    font-size: 0.66rem;
  }

  .lightbox__title,
  .lightbox__panel p {
    font-size: 0.92rem;
    line-height: 1.42;
  }

  .lightbox__close {
    top: 0.7rem;
    right: 0.7rem;
    width: 2.55rem;
    height: 2.55rem;
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox__close {
    transition: none;
  }
}

/* ── 11. Modal ──────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4, 1rem);
}

.modal.is-visible {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 10, 4, 0.7);
  cursor: pointer;
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2rem), 820px);
  max-height: calc(100dvh - 3rem);
  overflow: auto;
  border-radius: var(--r-xl, 32px);
  background: #fffaf2;
  box-shadow: var(--shadow-xl);
  padding: var(--sp-7, 1.75rem);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--r-pill, 999px);
  border: 1.5px solid var(--line, rgba(196, 122, 32, 0.2));
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__header {
  display: grid;
  gap: 0.75rem;
  margin-bottom: var(--sp-6, 1.5rem);
  padding-right: 3rem;
}


/* ── 12. Floating WhatsApp ──────────────────────────────────────────────── */

.floating-contact {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 24;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1.3rem;
  border-radius: var(--r-pill, 999px);
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-weight: 700;
  font-size: 0.93rem;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(18, 87, 53, 0.32), 0 3px 10px rgba(18, 87, 53, 0.18);
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.floating-contact:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 16px 40px rgba(18, 87, 53, 0.42), 0 5px 16px rgba(18, 87, 53, 0.26);
}

.floating-contact svg {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
}