/* Chapter Two - UI v4 */
:root{
  --bg: #f7f5ee;
  --panel: rgba(255,255,255,0.65);
  --border: rgba(107,106,72, 0.20);
  --shadow: 0 10px 25px rgba(0,0,0,0.08);
  --brand: #6b6a48;
  --brand-600: #57563a;
  --sand: #b5a78e;
  --brand-2: #8a8862;
  --text: #2b2b2b;
  --muted: rgba(43,43,43,0.65);
  --white: #ffffff;
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

/* Header */
.site-header{
  padding: 36px 16px 14px;
  text-align: center;
}

.brand-box{
  display: inline-flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap: 6px;
  padding: 18px 48px;
  border: 2px solid rgba(107,106,72,0.15);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.55);
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}

.brand-text{
  letter-spacing: 6px;
  font-weight: 500;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  color: var(--brand);
  font-size: clamp(24px, 3.8vw, 36px);
}

.brand-sub{
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--sand);
  font-weight: 600;
}

.site-nav{
  margin-top: 14px;
}

.nav-pills{
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 0;
  justify-content: center;
  flex-wrap: wrap;
}

.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(107,106,72,0.18);
  background: rgba(255,255,255,0.70);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.pill:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.92);
}

.pill-active{
  border-color: rgba(107,106,72,0.35);
  box-shadow: 0 8px 18px rgba(107,106,72, 0.12);
}

.pill-ghost{
  background: rgba(255,255,255,0.35);
}

/* Page */
.page{
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 30px;
}

/* Toasts */
.toast-wrap{
  display: grid;
  gap: 8px;
  margin: 14px auto 0;
  max-width: 760px;
}

.toast{
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(107,106,72,0.18);
}

.toast-success{ border-color: rgba(45, 196, 116, 0.35); }
.toast-error{ border-color: rgba(255, 77, 77, 0.35); }

/* Titles */
.section-title{
  margin: 16px 0 10px;
  text-align: center;
  color: var(--brand);
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 18px;
}

.section-subtitle{
  margin: 10px 0 12px;
  color: var(--text);
  font-weight: 700;
}

/* Categories circles */
.cats{
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}

.cat{
  width: 86px;
  text-decoration:none;
  color: var(--text);
  display: grid;
  justify-items: center;
  gap: 6px;
}

.cat-ring{
  width: 66px;
  height: 66px;
  border-radius: 999px;
  padding: 3px;
  background: radial-gradient(circle at top, rgba(107,106,72,0.85), rgba(107,106,72,0.18));
  box-shadow: 0 10px 18px rgba(107,106,72,0.10);
}

.cat-avatar{
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  border: 2px solid rgba(255,255,255,0.85);
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.cat-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-letter{
  font-weight: 800;
  color: var(--brand);
  font-size: 22px;
}

.cat-name{
  font-size: 12px;
  font-weight: 600;
  color: rgba(43,43,43,0.70);
}

/* Cart CTA */
.cart-cta{
  display:flex;
  justify-content:center;
  margin: 8px 0 16px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid rgba(0,0,0,0.06);
  text-decoration:none;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.btn-cart, .btn-primary{
  background: var(--brand);
  color: var(--white);
  border-color: rgba(107,106,72,0.40);
}

.btn-ghost{
  background: rgba(255,255,255,0.55);
  color: var(--text);
  border-color: rgba(107,106,72,0.20);
}

.btn-success{
  background: #2dc474;
  color: var(--white);
  border-color: rgba(45,196,116,0.35);
}

.btn-danger{
  background: #ff4d4d;
  color: var(--white);
  border-color: rgba(255,77,77,0.35);
}

.btn-sm{ padding: 8px 12px; font-size: 13px; border-radius: 999px; }

/* Products grid */
.products-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 12px auto 0;
}

.product-card{
  background: rgba(255,255,255,0.80);
  border: 1px solid rgba(107,106,72,0.14);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 22px rgba(0,0,0,0.07);
  padding: 14px;
  display: grid;
  gap: 10px;
  text-align: center;
}

.product-img{
  border-radius: var(--radius-lg);
  overflow:hidden;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
  aspect-ratio: 1 / 1;
}

.product-img > img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-placeholder{
  aspect-ratio: 1 / 1;
  height: 120px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.product-name{
  font-size: 14px;
  margin: 0;
  font-weight: 800;
  color: rgba(43,43,43,0.82);
}

.product-price{
  display: grid;
  gap: 4px;
}

.price{
  font-weight: 900;
  color: var(--brand);
  font-size: 30px;
}

.price-meta{
  font-size: 20px;
  color: var(--muted);
  font-weight: 700;
}

.btn-add{
  justify-self: center;
  padding: 9px 14px;
  font-size: 13px;
}

.admin-actions{
  display:flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.muted{ color: var(--muted); text-align: center; }

/* Carrito */
.mayorista-ok{
  margin: 10px 0;
  text-align: center;
  color: #1a8a52;
  font-weight: 800;
}

.mayorista-hint{
  margin: 10px 0;
  text-align: center;
  color: rgba(107,106,72,0.95);
  font-weight: 800;
}

.table-wrap{
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(107,106,72,0.14);
  background: rgba(255,255,255,0.70);
}

.table-carrito{
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.table-carrito th, .table-carrito td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  text-align: center;
}

.table-carrito th{
  color: rgba(43,43,43,0.78);
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.55);
}

.table-carrito tfoot td{
  border-bottom: none;
}

.td-producto{ text-align: left; font-weight: 700; }
.td-cant input{
  width: 72px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.9);
  text-align:center;
}

.tfoot-label{
  text-align: right;
  font-weight: 900;
  padding-right: 14px !important;
}

.tfoot-total{
  font-weight: 900;
  color: var(--brand);
}

.carrito-actions{
  display:flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.divider{
  height: 1px;
  background: rgba(107,106,72,0.18);
  margin: 18px 0;
}

/* Checkout form */
.checkout-form{
  display: grid;
  gap: 10px;
}

.checkout-form p{
  margin: 0;
}

.checkout-form input, .checkout-form select, .checkout-form textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.9);
}

/* Footer */
.site-footer{
  text-align:center;
  padding: 16px 10px 22px;
  color: rgba(43,43,43,0.55);
}

/* Responsive */
@media (max-width: 1024px){
  .products-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px){
  .page{ width: min(720px, calc(100% - 24px)); }
  .products-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .product-img > img, .img-placeholder{ height: auto; }
  .cat{ width: 80px; }
  .cat-ring{ width: 62px; height: 62px; }
}

@media (max-width: 420px){
  .products-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-card{ padding: 12px; }
  .product-img > img, .img-placeholder{ height: auto; }
}


/* ===== Carruseles (Inicio / Nuestro Local) ===== */
.carousel-container{
  width: 100%;
  max-width: 1100px;
  margin: 18px auto 0;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  background: #fff;
}
.carousel{
  display: flex;
  transition: transform 1.1s ease;
  will-change: transform;
}
.carousel img{
  flex: 0 0 100%;
  width: 100%;
  height: 360px;
  object-fit: contain;
  background: #fff;
  display: block;
}
@media (max-width: 768px){
  .carousel img{
  flex: 0 0 100%;
  width: 100%;
  height: 360px;
  object-fit: contain;
  background: #fff;
  display: block;
}
}

/* ===== Cards: atributos y precios ===== */
.product-desc{
  margin: 6px 0 10px;
  color: #6b6b6b;
  font-size: 0.95rem;
  line-height: 1.25rem;
  min-height: 2.5rem;
}
.product-attrs{
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: grid;
  gap: 4px;
  color: #4b4b4b;
  font-size: 0.92rem;
}
.product-attrs strong{ color: #333; }
.price-meta{
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
  color: #7a7a7a;
}
.price-note{
  font-style: normal;
  opacity: .9;
}
.price-edit{
  display: inline-block;
  margin-top: 8px;
  font-size: 0.9rem;
  text-decoration: none;
}


/* Contenedores generales de páginas (Inicio, Conócenos, Contáctanos) */
.page-container{
  width: 100%;
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 18px;
}

.page-container h2{
  margin-top: 0;
}

.page-container p{
  line-height: 1.55;
}

/* Formulario contacto */
.page-container form{
  max-width: 520px;
  margin-top: 14px;
}

.page-container form p{
  margin: 12px 0;
}

.page-container label{
  font-weight: 700;
  display: inline-block;
  margin-bottom: 6px;
}

.page-container input, 
.page-container textarea, 
.page-container select{
  width: 100%;
  border-radius: 14px;
  border: 2px solid rgba(107,106,72,.25);
  padding: 10px 12px;
  outline: none;
  background: #fff;
}

.page-container button[type="submit"]{
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: var(--brand-600);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.page-container button[type="submit"]:hover{ filter: brightness(.97); }

/* Mapa / imagen de ubicación */
.mapa-google{
  display: block;
  width: 100%;
}
.mapa-google img{
  width: 100%;
  max-width: 1000px;
  height: auto;
  display: block;
  margin: 14px auto 0;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

/* Slider de imágenes dentro de la card */
.product-img{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
}
.prod-slider-track{
  position: relative;
  width: 100%;
  height: 100%;
}
.prod-slide{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.prod-slide.is-active{ display: block !important; }

.prod-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.45);
  color: rgba(0,0,0,.65);
  font-size: 22px;
  line-height: 30px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.prod-nav:hover{ background: rgba(255,255,255,.65); }
.prod-nav.prev{ left: 10px; }
.prod-nav.next{ right: 10px; }

/* Link admin en la barra (no resaltado) */
.nav-admin{ margin-left: 8px; }
.pill-admin{
  opacity: .85;
  font-weight: 700;
}
.pill-admin:hover{ opacity: 1; }

@media (max-width: 640px){
  .carousel img{ height: 240px; }
  .prod-slide{ height: 100%; }
}


/* Tienda - filtros */
.shop-filters{
  margin: 18px auto 8px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
}
.shop-filters input[type="text"]{
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
}
.shop-filters select{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
}


/* --- Mensajes Django --- */
.messages-wrap{max-width:1100px;margin:12px auto 0;padding:0 16px;}
.msg{padding:12px 14px;border-radius:12px;margin:8px 0;font-weight:600;}
.msg-success{background:#e9f9ef;border:1px solid #9fe3b4;}
.msg-error{background:#ffecec;border:1px solid #ffb0b0;}
.msg-warning{background:#fff7e6;border:1px solid #ffd08a;}
.msg-info{background:#eef5ff;border:1px solid #b7d3ff;}

/* --- Modal imagen producto --- */
.image-modal{position:fixed;inset:0;display:none;z-index:9999;}
.image-modal.is-open{display:block;}
.image-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.65);}
.image-modal-card{position:relative;max-width:720px;width:92%;margin:6vh auto;background:#fff;border-radius:18px;padding:14px;box-shadow:0 18px 60px rgba(0,0,0,.35);}
.image-modal-card img{width:100%;height:auto;border-radius:14px;display:block;}
.image-modal-close{position:absolute;top:10px;right:12px;border:none;background:#fff;border-radius:12px;width:40px;height:40px;font-size:26px;line-height:38px;cursor:pointer;box-shadow:0 8px 18px rgba(0,0,0,.15);}

/* --- Admin (Mi Tienda) --- */
.admin-shell{max-width:1100px;margin:0 auto;padding:18px;}
.admin-top{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px;}
.admin-top h1{margin:0;font-size:34px;}
.admin-links a{margin-right:10px;}
.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;}
@media(max-width:900px){.admin-grid{grid-template-columns:1fr;}}
.admin-card{background:#fff;border-radius:18px;padding:16px 16px;border:1px solid rgba(0,0,0,.08);box-shadow:0 10px 30px rgba(0,0,0,.06);}
.admin-card h2,.admin-card h3{margin:0 0 10px;}
.admin-input{width:100%;padding:10px 12px;border-radius:12px;border:1px solid rgba(0,0,0,.18);margin:6px 0;}
.admin-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.admin-row .admin-input{flex:1;min-width:220px;}
.thumb-grid{display:flex;gap:10px;flex-wrap:wrap;}
.thumb{width:92px;height:92px;border-radius:14px;overflow:hidden;border:1px solid rgba(0,0,0,.12);background:#fafafa;display:flex;align-items:center;justify-content:center;}
.thumb img{width:100%;height:100%;object-fit:cover;}
.small{font-size:13px;opacity:.85;}
.table{width:100%;border-collapse:collapse;}
.table th,.table td{padding:10px 8px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top;}
.badge{display:inline-block;padding:6px 10px;border-radius:999px;font-weight:700;font-size:12px;background:#eef5ff;border:1px solid #b7d3ff;}
.badge-pendiente{background:#fff7e6;border-color:#ffd08a;}
.badge-procesando{background:#eef5ff;border-color:#b7d3ff;}
.badge-enviado{background:#e9f9ef;border-color:#9fe3b4;}
.badge-cancelado{background:#ffecec;border-color:#ffb0b0;}


/* ===== Modal tarjeta producto (tienda) ===== */
.card-modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}
.card-modal.is-open{ display: flex; }
.card-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.card-modal-card{
  position: relative;
  z-index: 1;
  width: min(520px, 94vw);
  max-height: 88vh;
  overflow: auto;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(107,106,72,0.18);
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  padding: 14px;
}
.card-modal-close{
  position: sticky;
  top: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.9);
  font-size: 22px;
  cursor: pointer;
}
/* el clon de la tarjeta dentro del modal */
.modal-product-card{
  cursor: default;
  transform: none !important;
}
