/* ========================================
   STR34M.vip
   ESTILOS GENERALES - MOBILE FIRST
======================================== */

:root {
  --bg: #070814;
  --bg-soft: #0f1020;
  --card: #151628;
  --card-soft: #1c1d33;

  --primary: #8d4dff;
  --primary-dark: #6e34db;

  --text: #ffffff;
  --text-soft: #b9b9c9;
  --muted: #77788c;

  --success: #20c997;
  --warning: #ffb020;
  --danger: #ff4d67;

  --border: rgba(255, 255, 255, 0.08);

  --radius: 18px;
  --radius-small: 12px;

  --bottom-nav-height: 72px;
}


/* ========================================
   RESET
======================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  background: var(--bg);

  color: var(--text);

  min-height: 100vh;

  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}


/* ========================================
   APP
======================================== */

.app {
  min-height: 100vh;

  padding-bottom:
    calc(var(--bottom-nav-height) + 25px);
}


/* ========================================
   CABECERA
======================================== */

.topbar {
  position: sticky;

  top: 0;

  z-index: 100;

  height: 64px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding:
    env(safe-area-inset-top)
    16px
    0;

  background:
    rgba(7, 8, 20, 0.95);

  backdrop-filter: blur(14px);

  border-bottom:
    1px solid var(--border);
}


.brand {
  font-weight: 800;

  font-size: 20px;

  letter-spacing: 0.4px;
}


.icon-btn,
.cart-btn {
  min-width: 42px;

  height: 42px;

  border: none;

  border-radius: 12px;

  background: var(--card);

  color: var(--text);

  font-size: 20px;

  display: flex;

  align-items: center;

  justify-content: center;

  position: relative;
}


.cart-btn {
  gap: 4px;
}


#cartCount {
  position: absolute;

  top: -4px;

  right: -4px;

  min-width: 20px;

  height: 20px;

  padding: 0 5px;

  border-radius: 999px;

  display: flex;

  align-items: center;

  justify-content: center;

  background: var(--primary);

  color: white;

  font-size: 11px;

  font-weight: 700;
}


/* ========================================
   CONTENIDO PRINCIPAL
======================================== */

#mainContent {
  width: 100%;

  max-width: 900px;

  margin: 0 auto;
}


.page-view {
  padding-bottom: 20px;
}


/* ========================================
   HERO
======================================== */

.hero {
  margin: 16px;

  min-height: 180px;

  display: flex;

  align-items: flex-end;

  padding: 24px;

  border-radius: 22px;

  overflow: hidden;

  background:
    radial-gradient(
      circle at top right,
      rgba(141, 77, 255, 0.65),
      transparent 45%
    ),
    linear-gradient(
      135deg,
      #19152d,
      #0d0e1b
    );

  border:
    1px solid rgba(141, 77, 255, 0.25);
}


.hero-content {
  max-width: 500px;
}


.hero-label {
  display: inline-block;

  margin-bottom: 8px;

  color: #c8aaff;

  font-size: 12px;

  font-weight: 700;

  letter-spacing: 1.5px;

  text-transform: uppercase;
}


.hero h1 {
  margin: 0 0 8px;

  font-size: 29px;

  line-height: 1.05;
}


.hero p {
  margin: 0;

  color: var(--text-soft);

  font-size: 14px;

  line-height: 1.5;
}


/* ========================================
   BUSCADOR
======================================== */

.search-wrap {
  padding: 0 16px 10px;
}


.search-wrap input {
  width: 100%;

  height: 48px;

  padding: 0 16px;

  border-radius: 14px;

  border:
    1px solid var(--border);

  outline: none;

  background: var(--card);

  color: var(--text);
}


.search-wrap input::placeholder {
  color: var(--muted);
}


.search-wrap input:focus {
  border-color: var(--primary);
}


/* ========================================
   CATÁLOGO
======================================== */

.catalog-container {
  padding-bottom: 20px;
}


.category-section {
  margin-top: 18px;
}


.category-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 0 16px;

  margin-bottom: 10px;
}


.category-header h2 {
  margin: 0;

  font-size: 19px;
}


.category-header small {
  color: var(--muted);

  font-size: 12px;
}


/* ========================================
   CARRUSEL HORIZONTAL
======================================== */

.product-row {
  display: flex;

  gap: 12px;

  overflow-x: auto;

  padding:
    2px
    16px
    12px;

  scroll-snap-type: x proximity;

  scrollbar-width: none;

  overscroll-behavior-inline: contain;
}


.product-row::-webkit-scrollbar {
  display: none;
}


/* ========================================
   TARJETA DE PRODUCTO
======================================== */

.product-card {
  flex:
    0 0
    155px;

  width: 155px;

  border-radius: var(--radius);

  overflow: hidden;

  background: var(--card);

  border:
    1px solid var(--border);

  scroll-snap-align: start;

  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}


.product-card:active {
  transform: scale(0.98);
}


.product-image {
  width: 100%;

  height: 135px;

  object-fit: cover;

  background: var(--card-soft);
}


.product-image-placeholder {
  width: 100%;

  height: 135px;

  display: flex;

  align-items: center;

  justify-content: center;

  text-align: center;

  padding: 10px;

  color: var(--muted);

  background:
    linear-gradient(
      135deg,
      #1c1d33,
      #11121f
    );
}


.product-body {
  padding: 12px;
}


.product-name {
  margin: 0 0 5px;

  font-size: 15px;

  font-weight: 700;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;
}


.product-description {
  min-height: 34px;

  margin: 0 0 8px;

  color: var(--text-soft);

  font-size: 12px;

  line-height: 1.4;
}


.product-price {
  margin-bottom: 10px;

  color: white;

  font-size: 18px;

  font-weight: 800;
}


.add-cart-btn {
  width: 100%;

  height: 38px;

  border: none;

  border-radius: 10px;

  background: var(--primary);

  color: white;

  font-size: 13px;

  font-weight: 700;
}


.add-cart-btn:active {
  background: var(--primary-dark);
}


/* ========================================
   ENCABEZADOS DE PÁGINAS
======================================== */

.page-header {
  padding: 22px 16px 12px;
}


.page-header h2 {
  margin: 0 0 5px;

  font-size: 25px;
}


.page-header p {
  margin: 0;

  color: var(--text-soft);

  font-size: 14px;
}


/* ========================================
   CARRITO
======================================== */

#cartItems,
#ordersList,
#accountContent {
  padding: 0 16px;
}


.cart-item {
  display: flex;

  gap: 12px;

  align-items: center;

  padding: 12px;

  margin-bottom: 10px;

  border-radius: 15px;

  background: var(--card);

  border:
    1px solid var(--border);
}


.cart-item-image {
  width: 60px;

  height: 60px;

  flex-shrink: 0;

  border-radius: 12px;

  object-fit: cover;

  background: var(--card-soft);
}


.cart-item-info {
  flex: 1;

  min-width: 0;
}


.cart-item-info strong {
  display: block;

  margin-bottom: 4px;
}


.cart-item-info small {
  color: var(--text-soft);
}


.quantity-controls {
  display: flex;

  align-items: center;

  gap: 8px;

  margin-top: 8px;
}


.quantity-controls button {
  width: 30px;

  height: 30px;

  border: none;

  border-radius: 8px;

  background: var(--card-soft);

  color: white;
}


.remove-btn {
  border: none;

  background: transparent;

  color: var(--danger);

  font-size: 18px;
}


/* ========================================
   RESUMEN DEL CARRITO
======================================== */

.cart-summary {
  margin: 20px 16px;

  padding: 18px;

  border-radius: 18px;

  background: var(--card);

  border:
    1px solid var(--border);
}


.cart-total {
  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 16px;

  font-size: 18px;
}


.cart-total strong {
  font-size: 24px;
}


/* ========================================
   BOTONES
======================================== */

.primary-btn {
  width: 100%;

  min-height: 48px;

  border: none;

  border-radius: 13px;

  background: var(--primary);

  color: white;

  font-weight: 700;
}


.primary-btn:active {
  background: var(--primary-dark);
}


.secondary-btn {
  width: 100%;

  min-height: 46px;

  border:
    1px solid var(--border);

  border-radius: 13px;

  background: var(--card-soft);

  color: white;

  font-weight: 600;
}


/* ========================================
   PEDIDOS
======================================== */

.order-card {
  padding: 15px;

  margin-bottom: 12px;

  border-radius: 16px;

  background: var(--card);

  border:
    1px solid var(--border);
}


.order-card-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 10px;

  margin-bottom: 10px;
}


.order-code {
  font-weight: 800;

  font-size: 14px;
}


.order-total {
  font-weight: 800;
}


.order-status {
  display: inline-flex;

  align-items: center;

  padding: 6px 10px;

  border-radius: 999px;

  font-size: 11px;

  font-weight: 700;
}


.status-pending {
  color: #ffd37a;

  background:
    rgba(255, 176, 32, 0.12);
}


.status-paid {
  color: #c7a5ff;

  background:
    rgba(141, 77, 255, 0.14);
}


.status-preparing {
  color: #70b8ff;

  background:
    rgba(0, 135, 255, 0.12);
}


.status-delivered {
  color: #77efc5;

  background:
    rgba(32, 201, 151, 0.12);
}


.status-cancelled {
  color: #ff8999;

  background:
    rgba(255, 77, 103, 0.12);
}


/* ========================================
   CUENTA
======================================== */

.account-card {
  padding: 18px;

  border-radius: 18px;

  background: var(--card);

  border:
    1px solid var(--border);
}


.account-row {
  padding: 12px 0;

  border-bottom:
    1px solid var(--border);
}


.account-row:last-child {
  border-bottom: none;
}


.account-row small {
  display: block;

  margin-bottom: 4px;

  color: var(--muted);
}


/* ========================================
   NAVEGACIÓN INFERIOR
======================================== */

.bottom-nav {
  position: fixed;

  left: 0;

  right: 0;

  bottom: 0;

  z-index: 200;

  height:
    calc(
      var(--bottom-nav-height)
      + env(safe-area-inset-bottom)
    );

  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  padding:
    8px
    8px
    env(safe-area-inset-bottom);

  background:
    rgba(12, 13, 27, 0.97);

  backdrop-filter: blur(16px);

  border-top:
    1px solid var(--border);
}


.nav-btn {
  border: none;

  background: transparent;

  color: var(--muted);

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 3px;

  border-radius: 12px;
}


.nav-btn span {
  font-size: 20px;
}


.nav-btn small {
  font-size: 11px;

  font-weight: 600;
}


.nav-btn.active {
  color: var(--primary);
}


/* ========================================
   ESTADO VACÍO
======================================== */

.empty-state {
  margin: 25px 16px;

  padding: 30px 20px;

  text-align: center;

  border-radius: 18px;

  background: var(--card);

  color: var(--text-soft);

  border:
    1px solid var(--border);
}


/* ========================================
   MODALES
======================================== */

.modal-backdrop {
  position: fixed;

  inset: 0;

  z-index: 1000;

  padding: 20px;

  display: flex;

  align-items: flex-end;

  justify-content: center;

  background:
    rgba(0, 0, 0, 0.72);
}


.modal {
  width: 100%;

  max-width: 520px;

  max-height: 90vh;

  overflow-y: auto;

  padding: 20px;

  border-radius:
    22px
    22px
    16px
    16px;

  background: var(--bg-soft);

  border:
    1px solid var(--border);
}


.modal-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 10px;

  margin-bottom: 16px;
}


.modal-header h2 {
  margin: 0;

  font-size: 21px;
}


.modal-close {
  width: 38px;

  height: 38px;

  border: none;

  border-radius: 10px;

  background: var(--card);

  color: white;

  font-size: 18px;
}


/* ========================================
   TABLET / PC
======================================== */

@media (min-width: 700px) {

  .hero {
    min-height: 230px;

    padding: 35px;
  }


  .hero h1 {
    font-size: 38px;
  }


  .product-card {
    flex-basis: 180px;

    width: 180px;
  }


  .product-image,
  .product-image-placeholder {
    height: 160px;
  }


  .bottom-nav {
    left: 50%;

    transform: translateX(-50%);

    max-width: 700px;

    border-left:
      1px solid var(--border);

    border-right:
      1px solid var(--border);

    border-radius:
      18px
      18px
      0
      0;
  }

}