/*
TiendaFlow V1 — Main Styles
Extraído de demos/index.html y demos/producto.html
Mobile-first design, sin frameworks externos.
*/

:root {
  --primary: #135bec;
  --bg: #f6f6f8;
  --card: #ffffff;
  --text: #111318;
  --muted: #616f89;
  --line: #e8ebf3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(900px 300px at 50% -120px, rgba(19, 91, 236, 0.12), transparent 60%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 0 14px 0;
}

.app {
  width: min(100%, 430px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 100vh;
  box-shadow: none;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Header */
.top {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 5;
  padding: 14px 18px 18px;
}

.head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding-right: 56px;
  margin-bottom: 0;
}

.brand {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.2px;
  text-align: left;
}

.brand-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: left;
}

.cart {
  border: none;
  background: #eef3ff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--primary);
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.08rem;
  cursor: pointer;
  text-decoration: none;
}

.cart-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* Showcase / Hero */
.showcase {
  padding: 14px 14px 8px;
}

.hero-banner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 24px rgba(16, 22, 34, 0.16);
  margin-bottom: 14px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.7) 100%);
}

.hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  color: #fff;
  padding: 16px;
}

.hero-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  font-weight: 500;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 4px;
}

.hero-title {
  font-size: 1.92rem;
  line-height: 1.05;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 12px;
}

/* Categories */
.cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cat-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cat-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.category-list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-list::-webkit-scrollbar {
  display: none;
}

.category-item {
  text-decoration: none;
  color: inherit;
  width: 96px;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.category-thumb {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 4px #fff;
}

.category-name {
  font-size: 0.86rem;
  font-weight: 500;
  color: #202635;
}

/* Admin launch */
.admin-launch {
  margin-top: 12px;
}

.admin-link {
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  color: #1f2937;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Content / Product Grid */
.content {
  padding: 12px 14px 22px;
}

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

.meta p {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.media {
  height: 172px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.media-product {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  position: relative;
  border-bottom: 1px solid var(--line);
}

.fav {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #6b7280;
  font-size: 0.92rem;
}

.fav.on {
  color: #e11d48;
}

.info {
  padding: 10px;
}

.name {
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.25;
  min-height: 2.1em;
  margin-bottom: 8px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price {
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
}

.add {
  border: none;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

/* Product Detail */
.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.product-title {
  font-size: 1.15rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.description {
  font-size: 0.88rem;
  color: #313b4f;
  line-height: 1.5;
  margin-bottom: 14px;
}

.attrs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.attr {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  background: #fbfcff;
}

.attr strong {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.attr span {
  display: block;
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
}

/* Size/Color Pickers */
.size-picker, .color-picker {
  margin-bottom: 14px;
}

.size-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.size-head h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.size-note {
  font-size: 0.76rem;
  color: var(--primary);
  font-weight: 700;
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.size-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 10px;
  height: 42px;
  cursor: pointer;
}

.size-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(19, 91, 236, 0.08);
}

.size-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
}

.color-grid {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  cursor: pointer;
}

.color-btn.active {
  border: 2px solid var(--primary);
}

/* Quantity Picker */
.qty-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fbfcff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.qty-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.qty-btn {
  border: 0;
  background: #fff;
  width: 34px;
  height: 34px;
  color: #1f2937;
  cursor: pointer;
  font-size: 0.86rem;
}

.qty-value {
  min-width: 34px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  height: 34px;
  display: grid;
  place-items: center;
}

/* CTA Button */
.cta-wrap {
  display: block;
  margin-bottom: 10px;
}

.cta {
  border: none;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
}

.cta:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

/* Footer Navigation */
.footer {
  width: 100%;
  position: sticky;
  bottom: 0;
  z-index: 8;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 10px 10px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: auto;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 4px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.tab .icon {
  font-size: 1.1rem;
  line-height: 1;
}

.tab .label {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tab.active {
  color: var(--primary);
  background: rgba(19, 91, 236, 0.08);
}

/* Responsive */
@media (max-width: 380px) {
  .media {
    height: 154px;
  }
}

@media (min-width: 900px) {
  body {
    padding: 0 14px 0;
  }
}

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none; }
