/* A4 portrait and print adjustments */
@page { size: A4 portrait; margin: 20mm 15mm; }
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: #f3f6fb;
  color: #222;
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.toolbar {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #d4ddec;
  padding: 8px 12px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
}

.toolbar button {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #0a57d1;
  background: #0a57d1;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
}

.toolbar button:hover {
  background: #084aa9;
}

#pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: clamp(12px, 4vw, 40px) clamp(12px, 5vw, 60px) 40px;
}

.page {
  width: min(100%, 210mm);
  height: 297mm;
  margin: 0 auto;
  border: 1px solid #e0e8f5;
  box-shadow: 0 12px 36px rgba(15, 46, 109, 0.12);
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

.header {
  text-align: center;
  padding: 12px 14px 8px;
  border-bottom: 3px solid #0a57d1;
}

.header .title {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #101727;
  text-transform: uppercase;
  font-size: 18px;
}

.header .phone {
  color: #313d52;
  font-weight: 600;
  font-size: 13px;
  margin-top: 4px;
}

.content {
  flex: 1;
  padding: 10mm 8mm 6mm;
  overflow: hidden;
}

.menu-section {
  width: 100%;
  margin: 0;
  padding: 0;
  height: 0;
}

@media print {
  .menu-section.pizzas {
    page-break-before: always !important;
    break-before: always !important;
  }
}

.footer {
  border-top: 1px dashed #d0d9e9;
  text-align: center;
  padding: 6px 8px 10px;
  font-size: 11px;
  color: #6c7a92;
  font-family: "Montserrat", sans-serif;
}

.section {
  margin: 8px 0 10px;
}

.section-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #0a57d1;
  text-transform: uppercase;
  font-size: 16px;
  border-bottom: 1px solid #0a57d1;
  padding-bottom: 4px;
  margin: 8px 0 6px;
}

.item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(14, 47, 109, 0.12);
}

.item:last-child {
  border-bottom: none;
}

.item-name {
  color: #c21d1d;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
  margin: 0 0 2px;
  letter-spacing: 0.4px;
}

.item-lines {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
}

.item-lines.fr {
  font-style: normal;
  color: #1e2533;
}

.item-lines.en {
  font-style: italic;
  color: #6f7a8f;
}

.item-lines.note {
  color: #6f7a8f;
  font-style: italic;
}

.pizza-head,
.pizza-row {
  display: grid;
  grid-template-columns: 1fr 130px 130px;
  gap: 12px;
  align-items: start;
}

.pizza-head {
  font-size: 12px;
  color: #6c7a92;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid rgba(14, 47, 109, 0.2);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.pizza-head .col-title {
  text-align: right;
}

.pizza-row .item-name {
  margin-bottom: 3px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: start;
}

.price {
  text-align: right;
  font-weight: 700;
  color: #0c1f40;
  white-space: nowrap;
}

.price:empty {
  display: none;
}

.extra {
  padding-top: 4px;
  padding-bottom: 4px;
  border-bottom-style: dotted;
}

@media screen and (max-width: 1024px) {
  .toolbar {
    justify-content: center;
    padding: 10px 16px;
  }

  #pages {
    padding-inline: clamp(16px, 6vw, 48px);
  }

  .page {
    border-radius: 12px;
  }

  .content {
    padding: 24px 20px 18px;
  }

  .section-title {
    font-size: 15px;
  }

  .item-name {
    font-size: 13.5px;
  }
}

@media screen and (max-width: 768px) {
  .content {
    padding: 20px 18px 16px;
  }

  .pizza-head {
    display: none;
  }

  .pizza-row,
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pizza-row .price,
  .row .price {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    text-align: left;
    white-space: normal;
  }

  .price::before {
    content: attr(data-label);
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #0a57d1;
    font-size: 12px;
  }
}

@media screen and (max-width: 520px) {
  body {
    background: #fff;
  }

  #pages {
    padding: 12px 12px 32px;
    gap: 16px;
  }

  .page {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 46, 109, 0.1);
  }

  .header {
    padding: 16px 12px 10px;
  }

  .header .title {
    font-size: 16px;
  }

  .section-title {
    font-size: 14px;
  }

  .item-lines {
    font-size: 12px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .toolbar {
    display: none;
  }

  #pages {
    display: block;
    padding: 0;
  }

  .page {
    width: 210mm;
    margin: 0 auto;
    border: none;
    box-shadow: none;
    height: 297mm;
  }
}
