:root,
body[data-theme="pastel-sky"],
body.theme-pastel-sky {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-hover: var(--primary-dark);
  --accent: #38bdf8;
  --bg: #f0f7ff;
  --surface: #ffffff;
  --card: var(--surface);
  --text: #0f172a;
  --text-muted: #475569;
  --border: #bfdbfe;
  --header-bg: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #38bdf8 100%);
  --header-text: #ffffff;
  --header-text-muted: rgba(255, 255, 255, 0.85);
  --header-input-bg: rgba(255, 255, 255, 0.92);
  --header-input-text: #0f172a;
  --header-border: rgba(255, 255, 255, 0.2);
  --offers-bg: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 60%, #0284c7 100%);
  --offers-text: #ffffff;
  --offers-cta-bg: #ffffff;
  --offers-cta-text: #1d4ed8;
  --whatsapp: #25D366;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body[data-theme="pastel-mint"],
body.theme-pastel-mint {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-hover: var(--primary-dark);
  --accent: #34d399;
  --bg: #ecfdf5;
  --surface: #ffffff;
  --card: var(--surface);
  --text: #064e3b;
  --text-muted: #374151;
  --border: #a7f3d0;
  --header-bg: linear-gradient(135deg, #047857 0%, #059669 55%, #10b981 100%);
  --header-text: #ffffff;
  --header-text-muted: rgba(255, 255, 255, 0.88);
  --header-input-bg: rgba(255, 255, 255, 0.94);
  --header-input-text: #064e3b;
  --header-border: rgba(255, 255, 255, 0.22);
  --offers-bg: linear-gradient(135deg, #064e3b 0%, #047857 60%, #059669 100%);
  --offers-text: #ffffff;
  --offers-cta-bg: #ffffff;
  --offers-cta-text: #047857;
}

body[data-theme="pastel-peach"],
body.theme-pastel-peach {
  --primary: #ea580c;
  --primary-dark: #c2410c;
  --primary-hover: var(--primary-dark);
  --accent: #fb923c;
  --bg: #fff7ed;
  --surface: #ffffff;
  --card: var(--surface);
  --text: #292524;
  --text-muted: #57534e;
  --border: #fed7aa;
  --header-bg: linear-gradient(135deg, #c2410c 0%, #ea580c 55%, #f97316 100%);
  --header-text: #ffffff;
  --header-text-muted: rgba(255, 255, 255, 0.9);
  --header-input-bg: rgba(255, 255, 255, 0.94);
  --header-input-text: #292524;
  --header-border: rgba(255, 255, 255, 0.22);
  --offers-bg: linear-gradient(135deg, #7c2d12 0%, #c2410c 60%, #ea580c 100%);
  --offers-text: #ffffff;
  --offers-cta-bg: #ffffff;
  --offers-cta-text: #c2410c;
}

body[data-theme="pastel-lilac"],
body.theme-pastel-lilac {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-hover: var(--primary-dark);
  --accent: #a78bfa;
  --bg: #faf5ff;
  --surface: #ffffff;
  --card: var(--surface);
  --text: #1e1b4b;
  --text-muted: #4b5563;
  --border: #ddd6fe;
  --header-bg: linear-gradient(135deg, #5b21b6 0%, #7c3aed 55%, #8b5cf6 100%);
  --header-text: #ffffff;
  --header-text-muted: rgba(255, 255, 255, 0.88);
  --header-input-bg: rgba(255, 255, 255, 0.94);
  --header-input-text: #1e1b4b;
  --header-border: rgba(255, 255, 255, 0.22);
  --offers-bg: linear-gradient(135deg, #3b0764 0%, #5b21b6 60%, #7c3aed 100%);
  --offers-text: #ffffff;
  --offers-cta-bg: #ffffff;
  --offers-cta-text: #5b21b6;
}

body[data-theme="dark-slate"],
body.theme-dark-slate {
  --primary: #38bdf8;
  --primary-dark: #0284c7;
  --primary-hover: var(--primary-dark);
  --accent: #818cf8;
  --bg: #0b1120;
  --surface: #1e293b;
  --card: var(--surface);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --header-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 70%, #0f172a 100%);
  --header-text: #f8fafc;
  --header-text-muted: #94a3b8;
  --header-input-bg: #0f172a;
  --header-input-text: #f8fafc;
  --header-border: #334155;
  --offers-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
  --offers-text: #f8fafc;
  --offers-cta-bg: #38bdf8;
  --offers-cta-text: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

body[data-theme="dark-slate"] .product-image-zone img,
body.theme-dark-slate .product-image-zone img {
  mix-blend-mode: normal;
}

body[data-theme="dark-slate"] .tenant-header,
body.theme-dark-slate .tenant-header {
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Generic / Utility */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
}
.btn:hover { background: var(--primary-hover); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; margin-top: 1rem; }
.btn-whatsapp:hover { background: #1ebe5d; }
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  cursor: pointer;
  width: 100%;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}
.btn-outline:hover { background: var(--bg); border-color: #cbd5e1; }

.hidden { display: none !important; }

/* Hero / Header (Tenant) */
.tenant-header {
  background: var(--header-bg, var(--primary));
  color: var(--header-text, #ffffff);
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--header-border, rgba(255, 255, 255, 0.15));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  z-index: 100;
  width: 100%;
}
.tenant-header-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-block: 0.85rem;
}
.tenant-header-inner h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--header-text, #ffffff);
  line-height: 1.2;
}
.tenant-header-inner p {
  font-size: 0.875rem;
  color: var(--header-text-muted, rgba(255, 255, 255, 0.85));
  font-weight: 500;
}
.tenant-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--header-text-muted, rgba(255, 255, 255, 0.85));
  border-bottom: 1px solid var(--header-border, rgba(255, 255, 255, 0.15));
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
}
.tenant-header-top a {
  color: var(--header-text, #ffffff) !important;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.tenant-header-top a:hover {
  opacity: 1;
}
.tenant-header-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 768px) {
  .tenant-header-main {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.tenant-header-inner input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--header-border, rgba(255, 255, 255, 0.25));
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background-color: var(--header-input-bg, #ffffff);
  color: var(--header-input-text, var(--text));
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.tenant-header-inner input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.tenant-header-inner input::placeholder {
  color: #64748b;
}

@media (min-width: 768px) {
  .tenant-header-inner {
    padding-block: 1rem;
  }
  .tenant-header-inner .header-titles { flex: 1; }
  .tenant-header-inner input { max-width: 320px; margin-top: 0; }
}

/* Offers Slider */
.offers-slider {
  position: relative;
  margin-top: 2rem;
  overflow: hidden;
}

.offers-track-container {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--offers-bg, var(--primary));
  color: var(--offers-text, #ffffff);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.offers-track { display: flex; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.offer-slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 2rem;
  gap: 2rem;
}
@media (min-width: 768px) {
  .offer-slide { flex-direction: row; align-items: center; justify-content: space-between; padding: 4rem; }
}
.offer-content { flex: 1; }
.offer-content h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  line-height: 1.1;
  color: var(--offers-text, #ffffff);
}
.offer-content p {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  color: var(--offers-text, #ffffff);
}
.offer-cta {
  display: inline-flex;
  background: var(--offers-cta-bg, #ffffff);
  color: var(--offers-cta-text, var(--primary));
  width: auto;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.offer-cta:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.offer-image { flex: 1; display: flex; justify-content: center; align-items: center; }
.offer-image img {
  max-width: 100%;
  height: auto;
  max-height: 280px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: var(--shadow-md);
}
.slider-controls { display: flex; align-items: center; justify-content: center; margin-top: 1.25rem; gap: 1rem; }
.slider-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.slider-btn:hover {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}
.slider-dots { display: flex; gap: 0.5rem; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}
.dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

/* Catalog Grid */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 100px;
}
@media (min-width: 768px) {
  .catalog { gap: 2rem; }
}

/* Product Card */
.product-card {
  background: var(--card);
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}
.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.product-image-zone {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  overflow: hidden;
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border: 1px solid var(--border);
}
.product-image-zone img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Better framing for products */
  display: block;
  mix-blend-mode: multiply; /* Helps if images have white backgrounds */
  transition: transform 0.3s ease;
}
.product-card:hover .product-image-zone img {
  transform: scale(1.03);
}
.product-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: var(--text);
}
.product-card h3 a {
  color: inherit;
  text-decoration: none;
}
.product-card h3 a:hover { color: var(--primary); }
.product-card .price {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
  letter-spacing: -0.025em;
}
.btn-add {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: auto;
  font-weight: 700;
  font-size: 0.95rem;
  width: 100%;
  text-align: center;
  transition: all 0.2s;
}
.btn-add:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Empty State */
.catalog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-size: 1.125rem;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

/* Cart Bar */
.cart-bar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 600px;
  background: var(--primary-dark);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  z-index: 20;
}
.cart-bar span { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.025em; }
.cart-bar .btn { 
  background: white; 
  color: var(--primary-dark); 
  width: auto; 
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  border-radius: 2rem;
}
.cart-bar .btn:hover { background: #f1f5f9; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 30;
}
@media (min-width: 768px) {
  .modal { align-items: center; }
}
.modal-content {
  background: var(--card);
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.1);
}
@media (min-width: 768px) {
  .modal-content { border-radius: var(--radius-xl); }
}
.modal-content h2 { margin-bottom: 1.5rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
.modal-content hr { margin: 1.5rem 0; border: 0; border-top: 1px solid var(--border); }
.modal-content label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
}
.modal-content input, .modal-content select {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background-color: var(--bg);
  transition: border-color 0.2s;
  outline: none;
  font-family: inherit;
}
.modal-content input:focus, .modal-content select:focus {
  border-color: #94a3b8;
  background-color: var(--card);
}

/* Landing/Admin preserve */
.hero { text-align: center; padding: 4rem 1rem; background: var(--card); border-bottom: 1px solid var(--border); }
.hero-logo { max-width: 300px; height: auto; margin: 0 auto 1.5rem auto; display: block; }
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; color: var(--text); font-weight: 800; letter-spacing: -0.05em; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; padding: 2rem; max-width: 1200px; margin: 0 auto; }
.feature { background: var(--card); padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); }

.card { background: var(--card); padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-top: 1rem; box-shadow: var(--shadow-sm); }
.alert { padding: 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; font-weight: 500; }
.alert.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

/* PWA / Mobile-First Adjustments */
input, select, textarea, button {
  font-size: 16px !important;
  min-height: 44px;
}

.admin-body { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.admin-sidebar { 
  width: 100%; 
  background: var(--card); 
  border-bottom: 1px solid var(--border); 
  border-right: none; 
  padding: 1rem; 
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.admin-sidebar ul { 
  display: flex; 
  gap: 1rem; 
  margin-top: 0; 
  list-style: none;
}
.admin-sidebar li { margin-bottom: 0; }
.admin-sidebar a { display: block; padding: 0.5rem; }

.admin-content { 
  flex: 1; 
  padding: 1rem; 
  width: 100%;
}

@media (min-width: 768px) {
  .admin-body { flex-direction: row; }
  .admin-sidebar { 
    width: 250px; 
    border-right: 1px solid var(--border); 
    border-bottom: none; 
    white-space: normal;
  }
  .admin-sidebar ul { display: block; margin-top: 1.5rem; }
  .admin-sidebar li { margin-bottom: 1rem; }
  .admin-content { padding: 2rem; max-width: 1200px; }
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
}
.table-responsive table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.table-responsive th, .table-responsive td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table-responsive th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* More PWA Card adjustments */
.card, .box-panel, .task-card {
  padding: 1rem;
}
@media (min-width: 768px) {
  .card, .box-panel, .task-card {
    padding: 1.5rem;
  }
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.store-container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}
@media (min-width: 768px) {
  .store-container {
    padding-inline: 2rem;
  }
}


/* Store Layout (Sidebar + Catalog) */
.store-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-block: 2rem;
}
.store-sidebar {
  order: -1; /* Mobile: above catalog */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.store-layout .catalog {
  order: 1; /* Mobile: below sidebar */
}

@media (min-width: 992px) {
  .store-layout {
    flex-direction: row;
    align-items: flex-start;
    padding-block: 3rem;
  }
  .store-sidebar {
    order: 2; /* Desktop: right side */
    flex: 0 0 260px;
    position: sticky;
    top: 120px;
  }
  .store-layout .catalog {
    order: 1; /* Desktop: left side */
    flex: 1;
    min-width: 0;
  }
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sidebar-nav li { margin: 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  background: var(--bg);
  border: 1px solid transparent;
}
.sidebar-nav a:hover {
  background: #f8fafc;
  color: var(--text);
  border-color: var(--border);
}
.sidebar-nav a.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.sidebar-nav a .cat-count {
  font-size: 0.75rem;
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: 12px;
  opacity: 0.8;
}
.sidebar-nav a.active .cat-count {
  background: rgba(255,255,255,0.25);
  color: white;
}
@media (min-width: 992px) {
  .sidebar-nav {
    flex-direction: column;
    gap: 0.25rem;
  }
  .sidebar-nav a {
    background: transparent;
    border-color: transparent;
  }
}
