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

:root {
  --primary: #135bec;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #111318;
  --muted: #6b7280;
  --line: rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: "DM Sans", sans-serif;
  background: linear-gradient(180deg, #fafafa 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 0;
}

.app {
  width: 100%;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 100vh;
  max-height: 100dvh;
  box-shadow: none;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 800px) {
  .app {
    width: min(100%, 430px);
    max-width: 430px;
  }
}

/* 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: 10px 14px 10px;
}

.head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding-right: 100px;
  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: 12px;
  color: var(--primary);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: left;
  min-width: 0;
  max-width: calc(100% - 108px);
}

.brand-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
}

.brand-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tagline {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart {
  border: none;
  background: #eef3ff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--primary);
  position: relative;
  font-size: 1.08rem;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

/* Header icon button — reusable circular button for dashboard/store icons */
.header-icon-btn {
  border: none;
  background: #eef3ff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.08rem;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.header-icon-btn:hover,
.header-icon-btn:focus {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(19, 91, 236, 0.2);
}

.header-icon-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Header actions container */
.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.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 {
  display: block;
  flex-shrink: 0;
  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: 260px;
  background-size: cover;
  background-position: center top;
  position: relative;
}

.media-product {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center top;
  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: fixed;
  left: 0;
  right: 0;
  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 calc(6px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 0;
}

.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: 800px) {
  .footer {
    width: 430px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* 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; }
