/* ==========================================================================
   LIAA MARKET // TOTALLY RESPONSIVE E-COMMERCE ENGINE
   ========================================================================== */

:root {
  --primary: #121316;
  --primary-accent: #E6392E;
  --primary-accent-hover: #CC2F24;
  --bg-page: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F3F5;
  --text-main: #1A1D20;
  --text-muted: #6C757D;
  --border-light: #E9ECEF;
  --border-strong: #CED4DA;
  --success: #2B8A3E;
  --whatsapp: #25D366;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP PROMO BANNER */
.top-banner {
  background: var(--primary);
  color: #FFFFFF;
  font-size: clamp(0.68rem, 2vw, 0.78rem);
  letter-spacing: 0.04em;
  padding: 8px 12px;
  text-align: center;
  line-height: 1.35;
}

/* NAVBAR (FLUID & WRAPPING) */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-brand {
  display: flex;
  flex-direction: column;
}

.brand-badge {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--primary-accent);
  display: block;
}

.brand-logo {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.brand-logo b {
  color: var(--primary-accent);
}

.nav-search {
  flex: 1;
  min-width: 220px;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.nav-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  border-radius: 30px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.nav-search input:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 19, 22, 0.08);
}

.btn-cart {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  height: 40px;
  padding: 0 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-cart:hover {
  background: #2C2E35;
  transform: translateY(-1px);
}

.cart-badge {
  background: var(--primary-accent);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* HERO SECTION (ADAPTIVE FLUID) */
.hero-section {
  background: linear-gradient(135deg, #121316 0%, #22252C 100%);
  color: #FFFFFF;
  padding: clamp(36px, 7vw, 64px) 16px;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  background: rgba(230, 57, 46, 0.2);
  border: 1px solid rgba(230, 57, 46, 0.4);
  color: #FF7B72;
  font-size: clamp(0.68rem, 1.8vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-desc {
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  color: #C5CBD6;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.5;
}

.hero-desc b {
  color: #FFFFFF;
}

/* MAIN CATALOG */
.main-catalog {
  max-width: 1200px;
  width: 100%;
  margin: clamp(24px, 4vw, 40px) auto;
  padding: 0 16px;
  flex: 1;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.catalog-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 1.6rem);
  font-weight: 700;
}

.catalog-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.catalog-trust {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.trust-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  color: var(--text-main);
  white-space: nowrap;
}

/* PRODUCTS GRID (TOTALLY RESPONSIVE CSS GRID) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr));
  gap: clamp(16px, 2.5vw, 24px);
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.product-img-wrapper {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #EAECEF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.product-card:hover .product-img {
  transform: scale(1.04);
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary-accent);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.product-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  margin: 4px 0 6px;
  color: var(--primary);
  line-height: 1.3;
}

.product-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
  flex: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  gap: 8px;
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.btn-add-cart {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-add-cart:hover {
  background: var(--primary-accent);
}

.btn-add-cart:active {
  transform: scale(0.96);
}

/* CART SLIDE-OVER DRAWER (FULL HEIGHT & ADAPTIVE WIDTH) */
.cart-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: absolute;
  top: 0; right: 0; width: 100%; max-width: 400px; height: 100%;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-overlay.open .cart-drawer {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.btn-close:hover { color: var(--primary); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  margin: auto;
  font-size: 0.9rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.cart-item-img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #EAECEF;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.qty-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  background: #FAFBFD;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.cod-banner {
  background: #EBFBEE;
  color: var(--success);
  border: 1px solid #D3F9D8;
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  text-align: center;
}

.btn-checkout {
  width: 100%;
  background: var(--primary-accent);
  color: #FFFFFF;
  border: none;
  height: 48px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-checkout:hover:not(:disabled) {
  background: var(--primary-accent-hover);
}

.btn-checkout:disabled {
  background: #CED4DA;
  cursor: not-allowed;
}

/* CHECKOUT MODAL (RESPONSIVE DIALOG) */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.badge-cod {
  background: #EBFBEE;
  color: var(--success);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 2px;
}

.order-form {
  padding: 18px 20px;
  overflow-y: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
}

.form-group input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font-main);
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(230, 57, 46, 0.1);
}

.order-summary-box {
  margin-top: 14px;
  padding: 12px;
  background: var(--bg-subtle);
  border-radius: 8px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.summary-line.highlight {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-accent);
  border-top: 1px solid var(--border-light);
  padding-top: 6px;
  margin-top: 6px;
}

.btn-submit-order {
  width: 100%;
  background: var(--success);
  color: #FFFFFF;
  border: none;
  height: 48px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-submit-order:hover {
  background: #237032;
}

/* SUCCESS MODAL */
.success-card {
  text-align: center;
  padding: 28px 20px;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.order-num {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 4px 0 14px;
}

.success-box {
  background: #FAFBFD;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px;
  font-size: 0.82rem;
  text-align: left;
  margin-bottom: 20px;
}

.highlight-cod {
  color: var(--success);
  font-size: 0.9rem;
  margin-top: 6px;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #FFFFFF;
  text-decoration: none;
  height: 46px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  height: 42px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* CLEAN RESTORED FOOTER (FLUID & BALANCED) */
.app-footer {
  background: #121316;
  color: #8C93A0;
  padding: clamp(36px, 6vw, 48px) 16px 20px;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 28px;
}

.footer-col .brand-logo {
  color: #FFFFFF;
  margin-bottom: 8px;
}

.footer-col h4 {
  color: #FFFFFF;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.footer-col p {
  font-size: 0.82rem;
  line-height: 1.5;
}

.footer-bottom {
  max-width: 1200px;
  margin: 28px auto 0;
  padding-top: 16px;
  border-top: 1px solid #22252C;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  flex-wrap: wrap;
  gap: 8px;
}

/* SMARTPHONE SPECIFIC MEDIA QUERIES (<640px) */
@media (max-width: 640px) {
  .nav-search {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full-width {
    grid-column: span 1;
  }
  .cart-drawer {
    max-width: 100%;
  }
}
