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

:root {
  --cream: #f6f0e4;
  --cream-dark: #efe6d3;
  --brown-dark: #3a2415;
  --brown-mid: #6b4a30;
  --terracotta: #a9642f;
  --terracotta-dark: #8f5024;
  --border-color: #e3d9c2;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--cream);
  color: var(--brown-dark);
}

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

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

/* HEADER */
.header {
  background: var(--cream);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--brown-dark);
  line-height: 1;
}

.logo-text p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--terracotta);
  line-height: 1.4;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--brown-dark);
  display: block;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--brown-dark);
  font-weight: 500;
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
}

.nav a.active,
.nav a:hover {
  border-bottom: 2px solid var(--terracotta);
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  color: var(--brown-dark);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--terracotta);
  color: #fff;
  font-size: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* HERO */
.hero {
  max-width: 1300px;
  margin: 0 auto;
  padding: 60px 40px;
  display: flex;
  align-items: center;
  gap: 60px;
}

.hero-text {
  flex: 1;
}

.hero-text h2 {
  font-size: 56px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--brown-dark);
}

.hero-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
}

.hero-divider span:not(.heart-small) {
  height: 1px;
  width: 60px;
  background: var(--border-color);
}

.heart-small {
  color: var(--terracotta);
}

.hero-text p {
  font-size: 16px;
  color: var(--brown-mid);
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--terracotta);
  color: #fff;
  padding: 16px 30px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
}

.btn-primary:hover {
  background: var(--terracotta-dark);
}

.hero-features {
  list-style: none;
  display: flex;
  gap: 30px;
  margin-top: 40px;
  font-size: 13px;
  color: var(--brown-mid);
}

.hero-features li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-image {
  flex: 1;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  box-shadow: 0 20px 40px rgba(58, 36, 21, 0.15);
}

/* MENU SECTION */
.menu-section {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px 40px 100px;
}

.menu-intro {
  text-align: center;
  padding: 30px 20px;
}

.menu-intro h2 {
  font-size: 34px;
  margin-bottom: 8px;
}

.menu-intro p {
  color: var(--brown-mid);
  font-size: 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
}

.tab-btn {
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--brown-mid);
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 13px;
  letter-spacing: 1px;
  font-weight: 500;
  cursor: pointer;
}

.tab-btn:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.tab-btn.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}

.category-panel {
  display: none;
}

.category-panel.active {
  display: block;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.category-header h3 {
  font-size: 26px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.item-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
}

.item-photo {
  aspect-ratio: 4 / 3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-dark);
}

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

/* La foto del cono de helado es muy vertical: se ve mejor completa (sin recortar)
   en vez de recortada con "cover", para que no se pierda la punta del cono. */
.item-photo img[src="hel24.png"] {
  object-fit: contain;
  padding: 10px;
}

.item-photo.empty::before {
  content: '📷';
  font-size: 28px;
  opacity: 0.4;
}

.item-info {
  padding: 16px;
}

.item-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.item-desc {
  font-size: 13px;
  color: var(--brown-mid);
  margin-bottom: 12px;
  min-height: 18px;
}

.size-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.size-btn {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--brown-mid);
  padding: 8px 6px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.size-btn:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.size-btn.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}

.item-price-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
}

.btn-add {
  width: 100%;
  background: var(--terracotta);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 0.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-add:hover {
  background: var(--terracotta-dark);
}

/* CONTACT PANEL */
.contact-panel {
  max-width: 600px;
  margin: 0 auto;
}

.contact-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 40px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
}

.contact-row:last-child {
  border-bottom: none;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.contact-details {
  flex: 1;
}

.contact-label {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--brown-mid);
  margin-bottom: 3px;
  text-transform: uppercase;
}

.contact-value {
  font-size: 15px;
  font-weight: 500;
}

/* OVERLAY */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58, 36, 21, 0.5);
  z-index: 200;
}

.overlay.open {
  display: block;
}

/* CART PANEL */
.cart-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--cream);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -10px 0 30px rgba(0,0,0,0.15);
}

.cart-panel.open {
  right: 0;
}

.cart-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.cart-panel-header h3 {
  font-size: 20px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--brown-dark);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-empty {
  text-align: center;
  color: var(--brown-mid);
  font-size: 14px;
  padding: 60px 0;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: var(--cream-dark);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.cart-item-price {
  font-size: 13px;
  color: var(--brown-mid);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.qty-btn:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.remove-item-btn {
  background: none;
  border: none;
  color: var(--brown-mid);
  cursor: pointer;
  font-size: 14px;
  margin-left: 8px;
}

.remove-item-btn:hover {
  color: #c0392b;
}

.cart-panel-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.btn-checkout {
  width: 100%;
  background: var(--terracotta);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
}

.btn-checkout:hover {
  background: var(--terracotta-dark);
}

/* CHECKOUT MODAL */
.checkout-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 640px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--cream);
  border-radius: 12px;
  z-index: 202;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.checkout-modal.open {
  display: block;
}

.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-color);
}

.checkout-header h3 {
  font-size: 20px;
}

.checkout-body {
  padding: 24px 28px 32px;
}

.order-summary {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.order-summary h4 {
  font-size: 14px;
  margin-bottom: 12px;
}

.summary-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--brown-mid);
  padding: 6px 0;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 600;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
}

.delivery-section {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.delivery-section h4 {
  font-size: 14px;
  margin-bottom: 14px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--brown-mid);
  margin-bottom: 6px;
}

.form-group .required {
  color: var(--terracotta);
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--brown-dark);
  background: var(--cream);
}

.form-group input:focus {
  outline: none;
  border-color: var(--terracotta);
}

.form-group.invalid input {
  border-color: #c0392b;
}

.field-error {
  display: none;
  font-size: 11px;
  color: #c0392b;
  margin-top: 5px;
}

.form-group.invalid .field-error {
  display: block;
}

.payment-method-section {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.payment-method-section h4 {
  font-size: 14px;
  margin-bottom: 14px;
}

.payment-method-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.method-btn {
  flex: 1 1 calc(50% - 8px);
  min-width: 140px;
  background: var(--cream);
  border: 1px solid var(--border-color);
  color: var(--brown-mid);
  padding: 10px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.method-btn:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.method-btn.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}

.payment-method-section.invalid .method-btn {
  border-color: #c0392b;
}

.payment-method-section .field-error {
  display: none;
}

.payment-method-section.invalid .field-error {
  display: block;
  margin-top: 10px;
}

.btn-pay {
  width: 100%;
  background: var(--terracotta);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
}

.btn-pay:hover {
  background: var(--terracotta-dark);
}

.checkout-disclaimer {
  font-size: 11px;
  color: var(--brown-mid);
  opacity: 0.7;
  margin-top: 12px;
  line-height: 1.5;
  text-align: center;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brown-dark);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 13px;
  z-index: 999;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .hamburger { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 10px 20px 20px;
    gap: 0;
  }
  .nav.open { display: flex; }
  .nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
  }
  .nav a.active, .nav a:hover { border-bottom: 1px solid var(--terracotta); }
  .item-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero { flex-direction: column; padding: 40px 20px; }
  .hero-text h2 { font-size: 36px; }
  .header-inner { padding: 14px 20px; }
  .header-icons { gap: 10px; }
  .menu-section { padding: 10px 20px 60px; }
  .menu-intro h2 { font-size: 26px; }
  .contact-card { padding: 24px; }
}

@media (max-width: 480px) {
  .item-grid { grid-template-columns: 1fr; }
  .hero-features { flex-direction: column; gap: 12px; }
  .logo-text h1 { font-size: 15px; letter-spacing: 1px; }
  .logo-text p { font-size: 11px; }
  .logo-badge { width: 40px; height: 40px; }
  .contact-row { gap: 12px; }
  .contact-icon { width: 38px; height: 38px; font-size: 15px; }
  .cart-panel { width: 100%; right: -100%; }
  .checkout-body { padding: 18px 18px 24px; }
}