/* ============================================================
   Flor de Maio — Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Lato:wght@300;400;700&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: #fef0f6;
  color: #be4788;
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* ── Typography ───────────────────────────────────────────── */
.font-playfair { font-family: 'Playfair Display', serif; }

h1, h2, h3 { font-family: 'Playfair Display', serif; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #fce4f0 0%, #fef0f6 60%, #fde8ec 100%);
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #f5c0d8;
}

.hero-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin: 0;
}

.hero-logo-placeholder {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  background: #fce4f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #be4788;
  font-size: 2.5rem;
  box-shadow: 0 4px 16px rgba(190,71,136,.18);
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: #5e1f42;
  line-height: 1.15;
  margin-bottom: .5rem;
}

.hero-subtitle {
  font-size: .95rem;
  color: #be4788;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 300;
  margin-bottom: 1.2rem;
}

.hero-tagline {
  font-size: 1rem;
  color: #c94f72;
  max-width: 360px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.hero-socials {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.hero-socials a {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: #be4788;
  background: white;
  border: 1px solid #f5c0d8;
  border-radius: 999px;
  padding: .4rem .9rem;
  transition: background .2s, box-shadow .2s;
}

.hero-socials a:hover {
  background: #fce4f0;
  box-shadow: 0 2px 8px rgba(190,71,136,.15);
}

/* ── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(254,240,246,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #f5c0d8;
  padding: .75rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-bar-inner {
  display: flex;
  gap: .5rem;
  white-space: nowrap;
  min-width: max-content;
}

.filter-btn {
  padding: .45rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid #f5c0d8;
  background: white;
  color: #be4788;
  font-size: .82rem;
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}

.filter-btn:hover {
  background: #fce4f0;
  border-color: #e088b0;
}

.filter-btn.active {
  background: #be4788;
  color: white;
  border-color: #be4788;
  box-shadow: 0 2px 8px rgba(190,71,136,.3);
}

/* ── Catalog Content ──────────────────────────────────────── */
.catalog-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ── Collection Section ───────────────────────────────────── */
.collection-section {
  margin-bottom: 3rem;
}

.collection-section.hidden { display: none; }

.collection-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.collection-header-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.collection-header h2 {
  font-size: 1.3rem;
}

.collection-badge {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-family: 'Lato', sans-serif;
}

/* ── Product Grid ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}

@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Product Card ─────────────────────────────────────────── */
.product-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(190,71,136,.08);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(190,71,136,.16);
}

.product-card-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fef0f6;
}

.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.product-card:hover .product-card-img-wrap img {
  transform: scale(1.04);
}

.product-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fce4f0;
}

.product-card-body {
  padding: .85rem .85rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-name {
  font-family: 'Playfair Display', serif;
  font-size: .92rem;
  color: #5e1f42;
  line-height: 1.35;
  margin-bottom: .3rem;
  flex: 1;
}

.product-card-category {
  font-size: .72rem;
  color: #be4788;
  opacity: .7;
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.product-card-desc {
  font-size: .78rem;
  color: #be4788;
  opacity: .8;
  line-height: 1.5;
  margin-bottom: .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.product-card-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: #5e1f42;
  font-weight: 700;
}

.btn-wa {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: #25D366;
  color: white;
  font-size: .75rem;
  font-weight: 700;
  font-family: 'Lato', sans-serif;
  padding: .4rem .75rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .18s, box-shadow .18s;
  border: none;
  cursor: pointer;
}

.btn-wa:hover {
  background: #1da851;
  box-shadow: 0 2px 8px rgba(37,211,102,.3);
}

/* ── Floating WhatsApp ────────────────────────────────────── */
.float-wa {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,.45);
  transition: transform .2s, box-shadow .2s;
}

.float-wa:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(37,211,102,.55);
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: #5e1f42;
  color: #f5c0d8;
  text-align: center;
  padding: 2rem 1rem;
  font-size: .85rem;
}

.footer p + p { margin-top: .4rem; }

.footer strong { color: white; }

/* ── Admin Login ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(190,71,136,.15);
  text-align: center;
}

.login-card h1 {
  color: #5e1f42;
  font-size: 1.6rem;
  margin-bottom: .25rem;
}

.login-card .subtitle {
  font-size: .85rem;
  color: #be4788;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: .82rem;
  color: #5e1f42;
  margin-bottom: .35rem;
  font-weight: 700;
}

.form-control {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid #f5c0d8;
  border-radius: 10px;
  font-size: .9rem;
  font-family: 'Lato', sans-serif;
  color: #5e1f42;
  background: #fef9fb;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.form-control:focus {
  border-color: #be4788;
  box-shadow: 0 0 0 3px rgba(190,71,136,.12);
}

.btn-primary {
  width: 100%;
  padding: .75rem;
  background: #be4788;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  cursor: pointer;
  margin-top: .5rem;
  transition: background .18s, box-shadow .18s;
}

.btn-primary:hover:not(:disabled) {
  background: #a33877;
  box-shadow: 0 4px 14px rgba(190,71,136,.3);
}

.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.alert-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: .65rem .9rem;
  font-size: .85rem;
  margin-bottom: 1rem;
  text-align: left;
}

/* ── Admin Layout ─────────────────────────────────────────── */
.admin-page { min-height: 100vh; background: #fef0f6; }

.admin-header {
  background: linear-gradient(135deg, #5e1f42, #be4788);
  color: white;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.admin-header h1 {
  font-size: 1.3rem;
  color: white;
}

.admin-header .subtitle {
  font-size: .8rem;
  opacity: .8;
  font-weight: 300;
}

.btn-logout {
  padding: .45rem 1rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: white;
  border-radius: 8px;
  font-size: .82rem;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  transition: background .18s;
}

.btn-logout:hover { background: rgba(255,255,255,.25); }

.admin-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ── Stats Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background: white;
  border-radius: 14px;
  padding: 1.1rem;
  box-shadow: 0 2px 8px rgba(190,71,136,.08);
  text-align: center;
}

.stat-card .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: #5e1f42;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: .78rem;
  color: #be4788;
  margin-top: .25rem;
}

/* ── Toolbar ──────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 180px;
  padding: .55rem .85rem;
  border: 1.5px solid #f5c0d8;
  border-radius: 10px;
  font-size: .9rem;
  font-family: 'Lato', sans-serif;
  color: #5e1f42;
  background: white;
  outline: none;
  transition: border-color .18s;
}

.search-input:focus { border-color: #be4788; }

.btn-new {
  padding: .55rem 1.2rem;
  background: #be4788;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: .88rem;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s;
}

.btn-new:hover { background: #a33877; }

/* ── Products Table ───────────────────────────────────────── */
.table-wrap {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(190,71,136,.08);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

thead th {
  background: #fce4f0;
  color: #5e1f42;
  font-family: 'Lato', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .75rem 1rem;
  text-align: left;
}

tbody tr {
  border-bottom: 1px solid #fce4f0;
  transition: background .15s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: #fff5f9; }

tbody td {
  padding: .7rem 1rem;
  font-size: .85rem;
  color: #5e1f42;
  vertical-align: middle;
}

.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  background: #fce4f0;
}

.thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #fce4f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #be4788;
  font-size: 1.2rem;
}

.badge-active {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}

.badge-active.on  { background: #dcfce7; color: #166534; }
.badge-active.off { background: #fee2e2; color: #991b1b; }

.action-btns { display: flex; gap: .4rem; }

.btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s;
}

.btn-icon:hover { opacity: .75; }

.btn-edit   { background: #dbeafe; color: #1e40af; }
.btn-delete { background: #fee2e2; color: #b91c1c; }

.empty-row td {
  text-align: center;
  padding: 3rem;
  color: #be4788;
  opacity: .6;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #fce4f0;
}

.modal-header h2 {
  font-size: 1.1rem;
  color: #5e1f42;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #be4788;
  cursor: pointer;
  padding: .1rem .4rem;
  border-radius: 6px;
  transition: background .15s;
}

.btn-close:hover { background: #fce4f0; }

.modal-body { padding: 1.25rem 1.5rem 1.5rem; }

.modal-body .form-group + .form-group { margin-top: .85rem; }

.modal-body .form-group { margin-bottom: 0; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23be4788' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.upload-zone {
  border: 2px dashed #f5c0d8;
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}

.upload-zone:hover { border-color: #be4788; background: #fef9fb; }

.upload-zone p {
  font-size: .82rem;
  color: #be4788;
  margin-top: .35rem;
}

.upload-zone .upload-icon { font-size: 2rem; color: #be4788; opacity: .5; }

.img-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: .75rem;
  display: none;
}

.img-preview.show { display: block; }

.uploading-text {
  font-size: .8rem;
  color: #be4788;
  margin-top: .4rem;
  display: none;
}

.uploading-text.show { display: block; }

.checkbox-group {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #be4788;
  cursor: pointer;
}

.checkbox-group label {
  margin-bottom: 0;
  cursor: pointer;
  font-size: .88rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1.25rem;
}

.btn-cancel {
  padding: .6rem 1.2rem;
  background: white;
  color: #be4788;
  border: 1.5px solid #f5c0d8;
  border-radius: 10px;
  font-size: .88rem;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  transition: background .18s;
}

.btn-cancel:hover { background: #fce4f0; }

.btn-save {
  padding: .6rem 1.4rem;
  background: #be4788;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: .88rem;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
}

.btn-save:hover:not(:disabled) { background: #a33877; }
.btn-save:disabled { opacity: .6; cursor: not-allowed; }

/* ── Confirm Modal ────────────────────────────────────────── */
.confirm-modal {
  max-width: 380px;
}

.confirm-modal .modal-body {
  text-align: center;
  padding: 1.5rem;
}

.confirm-modal .confirm-icon {
  font-size: 3rem;
  margin-bottom: .75rem;
}

.confirm-modal p {
  color: #5e1f42;
  font-size: .95rem;
  margin-bottom: .25rem;
}

.confirm-modal .confirm-name {
  font-weight: 700;
  color: #be4788;
}

.confirm-modal .modal-footer {
  justify-content: center;
  gap: .75rem;
}

.btn-danger {
  padding: .6rem 1.4rem;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: .88rem;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
}

.btn-danger:hover { background: #b91c1c; }

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: .5rem; }

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #fca5a5;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle input:checked + .toggle-slider { background: #4ade80; }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero { padding: 2rem 1rem 1.5rem; }
  .admin-header { flex-direction: column; align-items: flex-start; }
}
