/* ========== Reset & Base ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --g1: #e6f0ff;
  --g2: #efe6ff;
  --g3: #ffe6f2;
  --g4: #fff1e2;
  --ink: #222;
  --muted: #666;
  --card: rgba(255, 255, 255, 0.62);
  --stroke: rgba(255, 255, 255, 0.65);
  --shadow: 0 10px 40px rgba(20, 22, 32, 0.12);
  --brand-blue: #7ba3ff;
  --brand-rose: #e6a8c9;
  --brand-lilac: #b8a7f5;
  --brand-gold: #f2c98e;
  --btn-grad: linear-gradient(135deg, var(--brand-blue), var(--brand-rose));
  --btn-grad-alt: linear-gradient(135deg,
      var(--brand-lilac),
      var(--brand-gold));
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  line-height: 1.6;
  background: linear-gradient(125deg,
      var(--g1),
      var(--g2),
      var(--g3),
      var(--g4));
  background-size: 160% 160%;
  animation: bgShift 16s ease-in-out infinite;
  padding: 0 20px 8px;
  /* respiro inferior general */
}

main,
#main {
  flex: 1 0 auto;
}

@keyframes bgShift {
  0% {
    background-position: 0% 30%;
  }

  50% {
    background-position: 100% 70%;
  }

  100% {
    background-position: 0% 30%;
  }
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(8px);
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0.55));
  border: 1px solid var(--stroke);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  padding: 14px 22px;
  margin: 14px auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  max-width: 1200px;
  flex-wrap: nowrap;
}

.header-text h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-text h1 span {
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-text p {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 2px;
}

.navbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-left: auto;
}

.navbar img.usuario-icon {
  border-radius: 50%;
}

.navbar a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.navbar a:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.navbar a.active {
  outline: 2px solid rgba(123, 163, 255, 0.5);
  background: rgba(255, 255, 255, 0.9);
}

.btn-nav {
  background: var(--btn-grad);
  color: #fff !important;
  box-shadow: var(--shadow);
}

/* ========== Contenedor genérico ========== */
.container {
  max-width: 1100px;
  margin: 24px auto;
}

/* ========== Botones ========== */
.btn {
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn.primary {
  background: var(--btn-grad);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn.secondary {
  background: #fff;
  color: #2b2b2b;
  border: 1px solid #eee;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.btn.lg {
  padding: 12px 20px;
  font-size: 1rem;
}

/* ========== HERO sin banner (una sola columna) ========== */
.hero {
  max-width: 1200px;
  margin: 0 auto 18px;
  display: block;
}

.hero-inner {
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.88),
      rgba(255, 255, 255, 0.58));
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  padding: 28px;
  max-width: 980px;
  margin-inline: auto;
  box-shadow: var(--shadow);
}

.hero h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 8px;
}

.hero-sub {
  color: #444;
  margin-bottom: 16px;
}

.hero-search {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-bottom: 12px;
}

.hero-search input {
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid #e7e7e7;
  outline: none;
  background: #fff;
  font-size: 0.98rem;
  height: 48px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.82rem;
  background: linear-gradient(135deg,
      rgba(123, 163, 255, 0.16),
      rgba(230, 168, 201, 0.16));
  border: 1px solid rgba(123, 163, 255, 0.25);
}

/* ========== HOME: card “glass” + features ========== */
.content.glass {
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.82),
      rgba(255, 255, 255, 0.58));
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  padding: 22px;
  margin: 0 auto 24px;
  max-width: 1200px;
  box-shadow: var(--shadow);
}

/* >>> FIX: evita que el card de “Bienvenido” se estire en el grid de home */
body.home .content.glass {
  align-self: start;
}

/* Compactar el bloque de “Bienvenido …”  */
.content.glass h3 {
  margin: 0 0 6px;
}

.content.glass>p {
  margin: 0 0 8px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 6px 0 8px;
}

.cta-row {
  margin-top: 10px;
}

.feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--r-lg);
  padding: 12px 14px;
}

.feature .icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  border-radius: 12px;
  background: var(--btn-grad-alt);
  color: #1c1c1c;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

/* ========== Filtros (Productos) ========== */
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.filters select,
.filters input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  min-width: 180px;
}

#openModal {
  white-space: nowrap;
}

/* ========== Grid de productos ========== */
.grouped .category-block {
  margin-bottom: 26px;
}

.category-title {
  font-size: 1.3rem;
  margin: 10px 0 6px;
  color: #111;
}

.gender-title {
  font-size: 1rem;
  margin: 14px 0 10px;
  color: #333;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.product-card {
  background: #fff;
  border: 1px solid #f0e6f2;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.product-info {
  padding: 10px 12px;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.product-price {
  font-size: 0.95rem;
}

/* ========== Modal ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 120;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(640px, 96vw);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.form-grid input,
.form-grid select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 6px;
}

/* ========== Utilidades ========== */
.price {
  font-weight: 800;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ========== Footer (global) ========== */
.site-footer {
  max-width: 1200px;
  margin: 10px auto 0;
  text-align: center;
  color: #333;
  font-size: 0.9rem;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.9),
      rgba(255, 255, 255, 0.6));
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  padding: 14px;
  box-shadow: var(--shadow);
}

/* ========== Skeletons (carga) ========== */
.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400% 100%;
  animation: sheen 1.4s ease infinite;
  border-radius: 8px;
}

@keyframes sheen {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.skeleton-row {
  margin-bottom: 20px;
}

.skeleton-title {
  height: 20px;
  width: 240px;
  margin: 6px 0;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.skeleton-card {
  background: #fff;
  border: 1px solid #f0e6f2;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 10px;
}

.skeleton-img {
  height: 120px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-line {
  height: 12px;
  width: 90%;
}

.skeleton-line.short {
  width: 60%;
}

/* ========== Contacto ========== */
/* Solo para contact.html */
body.contact {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* header | contenido | footer */
  padding-bottom: 0;
  /* sin aire debajo */
}

body.contact .site-footer {
  margin: 16px auto 0;
  /* respiro entre el mapa y el footer */
  /* si lo quieres “a ras” visual: border-radius: var(--r-xl) var(--r-xl) 0 0; */
}

.contact-hero {
  max-width: 1200px;
  margin: 6px auto 18px;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.88),
      rgba(255, 255, 255, 0.58));
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow);
}

.contact-hero h2 {
  font-size: clamp(1.6rem, 1rem + 2.2vw, 2.5rem);
  line-height: 1.15;
  margin-bottom: 8px;
}

.contact-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.contact-cards {
  display: grid;
  gap: 12px;
}

.contact-card {
  display: grid;
  gap: 6px;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.82),
      rgba(255, 255, 255, 0.62));
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.cc-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: var(--btn-grad-alt);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.cc-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(123, 163, 255, 0.35);
  width: fit-content;
  padding-bottom: 1px;
}

.cc-link:hover {
  opacity: 0.9;
}

.contact-form h3 {
  margin-bottom: 8px;
}

.contact-form form {
  display: grid;
  gap: 12px;
}

.contact-form .form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid #e6e6e6;
  background: #fff;
  outline: none;
  font-size: 0.98rem;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form .full {
  grid-column: 1/-1;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-msg {
  min-height: 1.2rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.form-msg.ok {
  color: #1f7a42;
}

.form-msg.error {
  color: #b43d3d;
}

.map-wrap {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-wrap iframe {
  width: 100%;
  height: 340px;
  border: 0;
  display: block;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== Responsive ========== */
/* Tablets */
@media (max-width: 980px) {
  .navbar {
    gap: 10px;
  }

  .hero {
    display: block;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-form .form-row {
    grid-template-columns: 1fr;
  }
}

/* Móviles */
@media (max-width: 680px) {
  .modal {
    align-items: flex-start;
    padding: 24px 8px 16px;
  }

  .modal-content {
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 48px);
    /* algo más de altura útil */
    margin: 0 auto;
    border-radius: 18px;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .detail-layout {
    flex-direction: column;
    /* ya lo tenías, lo reforzamos */
    gap: 16px;
  }

  .detail-left {
    flex: 0 0 auto;
    width: 100%;
    text-align: center;
  }

  .detail-img {
    max-width: 220px;
    margin: 0 auto 8px;
  }

  .detail-right {
    width: 100%;
  }

  /* que el input de cantidad no se vea tan chiquito */
  #detailQty {
    width: 100%;
  }

  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actions .btn {
    width: 100%;
  }


  .site-header {
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .header-text h1 {
    font-size: 1.35rem;
  }

  .hero-search {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filters-row {
    flex-direction: column;
  }

  .filters select,
  .filters input {
    width: 100%;
    min-width: unset;
  }

  #openModal {
    width: 100%;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .product-card img {
    aspect-ratio: 1/1;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* Filtros: selects de orden y límite */
.filters-row select#sortBy,
.filters-row select#sortDir,
.filters-row select#limit {
  min-width: 140px;
}

/* Pager */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 6px;
}

.pager .btn {
  min-width: 160px;
}

/* Pager móvil */
@media (max-width: 680px) {
  .pager {
    flex-direction: column;
  }

  .pager .btn {
    width: 100%;
  }
}

/* ==== Home en dos columnas (desktop) ==== */
@media (min-width: 1024px) {
  body.home {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "header header"
      "hero   welcome"
      "footer footer";
    gap: 18px;
    padding: 0 20px 8px;
  }

  body.home .site-header {
    grid-area: header;
  }

  body.home .hero {
    grid-area: hero;
    margin-bottom: 0;
  }

  body.home .content.glass {
    grid-area: welcome;
    margin-bottom: 0;
  }

  body.home .site-footer {
    grid-area: footer;
  }

  body.home .hero-inner {
    max-width: unset;
    width: 100%;
  }
}

/* Tablet: 2/3 (hero) + 1/3 (bienvenido) */
@media (min-width: 680px) and (max-width: 1023px) {
  body.home {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "header header"
      "hero   welcome"
      "footer footer";
    gap: 16px;
    padding: 0 20px 8px;
  }

  body.home .site-header {
    grid-area: header;
  }

  body.home .hero {
    grid-area: hero;
    margin-bottom: 0;
  }

  body.home .content.glass {
    grid-area: welcome;
    margin-bottom: 0;
  }

  body.home .site-footer {
    grid-area: footer;
  }

  body.home .hero-inner {
    max-width: unset;
    width: 100%;
  }
}

/* Móvil: apilado normal */
@media (max-width: 679px) {

  .hero,
  .content.glass {
    width: 100%;
    float: none;
    display: block;
    margin: 0 auto 18px;
  }
}

/* ==== LOGIN ==== */

body.login {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-bottom: 0;
}

body.login .auth-card .contact-form .form-row {
  grid-template-columns: 1fr !important;
}

body.login .auth-card .contact-form label {
  width: 100%;
}

/* 1) Checkbox "Recordarme" más lindo y alineado */
body.login .check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  color: var(--muted);
}

body.login .check input[type="checkbox"] {
  /* tamaño consistente y color de marca */
  width: 18px;
  height: 18px;
  accent-color: #9e8cf2;
  /* cerca de --brand-lilac */
  cursor: pointer;
  margin: 0;
}

/* 2) Botones del login: mismo alto, mejor espaciado y alineados a la derecha */
/* Fila: enlaces a la izquierda (dos renglones) + botones a la derecha */
body.login .auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

/* Columna izquierda: apilado vertical */
body.login .auth-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

body.login .auth-left a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(123, 163, 255, .35);
}

body.login .auth-left a:hover {
  opacity: .9;
}

/* Botones a la derecha */
body.login .auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.login .auth-buttons .btn {
  min-width: 120px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
}

body.login .auth-buttons .btn.primary {
  background: var(--btn-grad);
  color: #fff;
  box-shadow: 0 8px 22px rgba(123, 163, 255, .24);
}

/* Responsive: apilar en móvil */
@media (max-width:680px) {
  body.login .auth-row {
    flex-direction: column;
    align-items: stretch;
  }

  body.login .auth-buttons .btn {
    width: 100%;
    min-width: 0;
  }
}

/* ==== REGISTER ==== */
body.register {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-bottom: 0;
}

/* Card igual que login */
body.register .auth-card {
  max-width: 520px;
  margin: 10px auto 24px;
  padding: 24px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .58));
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}

body.register .auth-card h3 {
  margin-bottom: 8px;
}

/* Inputs en una columna en pantallas chicas */
@media (max-width: 980px) {
  body.register .contact-form .form-row {
    grid-template-columns: 1fr !important;
  }
}

/* Enlaces a la izquierda + botones a la derecha (mismo patrón que login) */
body.register .auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

body.register .auth-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

body.register .auth-left a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(123, 163, 255, .35);
}

body.register .auth-left a:hover {
  opacity: .9;
}

body.register .auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.register .auth-buttons .btn {
  min-width: 120px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
}

body.register .auth-buttons .btn.primary {
  background: var(--btn-grad);
  color: #fff;
  box-shadow: 0 8px 22px rgba(123, 163, 255, .24);
}

/* Checkbox términos */
body.register .check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  color: var(--muted);
}

body.register .check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #9e8cf2;
  cursor: pointer;
  margin: 0;
}

body.register .check a {
  font-weight: 600;
  border-bottom: 2px solid rgba(123, 163, 255, .35);
  color: var(--ink);
}

/* Responsive: apilar botones/enlaces */
@media (max-width:680px) {
  body.register .auth-row {
    flex-direction: column;
    align-items: stretch;
  }

  body.register .auth-buttons .btn {
    width: 100%;
    min-width: 0;
  }
}

/* ==== MENÚ DE USUARIO (icono arriba a la derecha) ==== */

.user-btn {
  border: 0;
  background: transparent;
  padding: 4px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease,
    background-color 0.2s ease;
}

.user-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.user-btn img.usuario-icon {
  border-radius: 50%;
}

/* Panel flotante */
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 22px;
  width: 280px;
  max-width: 90vw;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.94),
      rgba(255, 255, 255, 0.78));
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: none;
  z-index: 80;
}

.user-menu.open {
  display: block;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--btn-grad-alt);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.user-menu-name {
  font-weight: 700;
  margin: 0;
}

.user-menu-email {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.user-menu-body {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
}

.user-menu-body .btn-sm {
  padding: 8px 12px;
  font-size: 0.88rem;
  border-radius: 999px;
}

.user-menu-footer {
  display: flex;
  justify-content: flex-end;
}

.user-menu-logout {
  background: none;
  border: 0;
  color: #b43d3d;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

/* En móvil que el panel no se salga */
@media (max-width: 680px) {
  .user-menu {
    right: 12px;
  }
}

.detail-label {
  margin-top: 12px;
  font-weight: 600;
  display: block;
}

.detail-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}

.detail-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.detail-left {
  flex: 0 0 260px;
  /* ancho fijo aprox para la foto */
}

.detail-img {
  width: 100%;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.detail-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.detail-title {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.detail-price {
  font-weight: 800;
  margin: 8px 0;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* Responsive: en móvil se apila */
@media (max-width: 680px) {
  .detail-layout {
    flex-direction: column;
  }

  .detail-left {
    flex-basis: auto;
  }

  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actions .btn {
    width: 100%;
  }
}

.option-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: 0.2s;
}

.option-btn:hover {
  background: #f2f2f2;
}

.option-btn.active {
  border-color: #9f77ff;
  background: #ede5ff;
  font-weight: 600;
}

.color-btn {
  text-transform: capitalize;
}

/* ==== CARRITO ==== */
.cart-wrapper {
  max-width: 980px;
  margin: 2.5rem auto 3.5rem;
  padding: 2rem;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(88, 63, 170, 0.18);
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 0.9fr);
  gap: 1.75rem;
  align-items: flex-start;
}

.cart-header-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.cart-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.1rem 1.3rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
}

.cart-item-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.cart-item-main {
  display: grid;
  gap: 4px;
}

.cart-item-name {
  font-weight: 700;
}

.cart-item-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.cart-item-actions {
  display: grid;
  gap: 8px;
  align-items: center;
  justify-items: end;
}

.cart-qty-input {
  width: 70px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.cart-item-remove {
  background: none;
  border: 0;
  color: #b43d3d;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Resumen */
.cart-summary {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
  padding: 1.5rem 1.6rem;
  height: auto;
  align-self: flex-start;
}

.cart-summary h3 {
  margin-bottom: 4px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cart-summary-total {
  font-weight: 800;
  font-size: 1.05rem;
}

@media (max-width: 768px) {
  .cart-wrapper {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
    margin-top: 1rem;
  }

  .cart-item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: flex-start;
  }

  .cart-item-actions {
    margin-top: 0.5rem;
  }
}

/* Responsive carrito */
@media (max-width: 780px) {
  .cart-wrapper {
    grid-template-columns: 1fr;
  }

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

  .cart-item-actions {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-content: space-between;
  }
}

/* ==== Toggle ver/ocultar contraseña ==== */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  padding-right: 40px;
  /* espacio para el icono */
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0;
}

.toggle-password:hover {
  opacity: 0.8;
}

/* ===== Variants (tallas + colores + stock) ===== */

/* Grid en 2 columnas */
.variants-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

/* Tarjeta individual */
.variant-card {
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.88),
      rgba(255, 255, 255, 0.62));
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Título de la tarjeta */
.variant-title {
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

/* Lista de colores dentro de cada tarjeta */
.variant-colors {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Renglón color + input */
.variant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Nombre del color */
.variant-row span {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: capitalize;
}

/* Input de cantidad */
.variant-row input {
  width: 60px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 0.9rem;
}

/* Responsive para móvil */
@media (max-width: 680px) {
  .variants-grid-2 {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  body {
    padding-left: 8px;
    padding-right: 8px;
  }
}
