:root {
  --bg: #faf6f4;
  --bg-soft: #f3ebe8;
  --card: #ffffff;
  --accent: #c9958a;
  --accent-dark: #a8746a;
  --rose: #e8d5d0;
  --rose-light: #f7eeeb;
  --text: #4a3a38;
  --text-light: #7a6562;
  --border: #ead9d4;
  --shadow: 0 8px 32px rgba(74, 58, 56, 0.08);
  --shadow-hover: 0 16px 48px rgba(74, 58, 56, 0.12);
  --radius: 16px;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Montserrat', sans-serif;
  --whatsapp: #25d366;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 244, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--accent-dark);
}

.cart-btn {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.cart-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.cart-count {
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  background: linear-gradient(180deg, var(--rose-light) 0%, var(--bg) 100%);
}

.hero-logo {
  width: min(92vw, 520px);
  height: auto;
  max-height: 70vh;
  margin: 0 auto 2rem;
  object-fit: contain;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 480px;
  margin: 0 auto;
  font-weight: 300;
}

/* Filters */
.filters {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.45rem 1.1rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-light);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Catalog */
.catalog {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.product-image {
  aspect-ratio: 3/4;
  object-fit: cover;
  width: 100%;
  background: var(--bg-soft);
}

.product-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.product-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--accent-dark);
  margin-bottom: 1rem;
}

.product-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.option-group label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  display: block;
  margin-bottom: 0.3rem;
}

.option-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.85rem;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border: none;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: white;
}

.btn-whatsapp:hover {
  background: #1fb855;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.btn-danger {
  background: #e57373;
  color: white;
}

.btn-danger:hover {
  background: #d32f2f;
}

/* Cart sidebar */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 58, 56, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--card);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-empty {
  text-align: center;
  color: var(--text-light);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item img {
  width: 72px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-soft);
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.cart-item-meta {
  font-size: 0.78rem;
  color: var(--text-light);
}

.cart-item-price {
  font-weight: 500;
  color: var(--accent-dark);
  margin-top: 0.25rem;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  text-decoration: underline;
}

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--rose-light);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.cart-footer .btn {
  width: 100%;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.footer a {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* Admin */
.admin-page {
  background: var(--bg);
  min-height: 100vh;
}

.admin-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-header h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.login-box {
  max-width: 400px;
  margin: 4rem auto;
  background: var(--card);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-box h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.login-box p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--bg);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.admin-panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.admin-panel h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 600px;
  overflow-y: auto;
}

.product-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.product-list-item:hover,
.product-list-item.active {
  border-color: var(--accent);
  background: var(--rose-light);
}

.product-list-item img {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.product-list-item .info {
  flex: 1;
}

.product-list-item .info h4 {
  font-size: 0.9rem;
  font-family: var(--font-serif);
}

.product-list-item .info span {
  font-size: 0.75rem;
  color: var(--text-light);
}

.product-list-item .status {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
  background: var(--rose);
}

.product-list-item .status.inactive {
  background: #eee;
  color: #999;
}

.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.tag {
  background: var(--rose-light);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tag button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1;
}

.add-tag-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.add-tag-row input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.image-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 0.5rem;
  background: var(--bg-soft);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.settings-bar {
  background: var(--rose-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.settings-bar .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 200px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.85rem;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .nav a:not(.cart-btn) {
    display: none;
  }

  .hero-logo {
    width: min(95vw, 420px);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
