/* ============================================================
   Carrito de pedidos — pizzadelhorno.com (ver js/pedido.js)
   ============================================================ */
:root {
  --pdh-red: #ca0610;
  --pdh-red-dark: #9f0810;
  --pdh-ink: #333;
  --pdh-brown: #5e472b;
  --pdh-muted: #82786e;
  --pdh-cream: #f4efe8;
  --pdh-line: #e4ddd3;
}

[hidden] { display: none !important; }

/* ---------- pestaña Pedido ---------- */
.pdh-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--pdh-red);
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0;
  text-align: center;
  vertical-align: 1px;
}

/* Tablet (601-1024 px): 6 enlaces + contador en una sola línea */
@media only screen and (max-width: 1024px) {
  #header #mobile-menu { flex-wrap: wrap; }
  #header #mobile-menu li a { padding: 12px 8px !important; }
  #header #mobile-menu .pdh-badge { margin-left: 3px; }
}
/* Celular (hasta 600 px): 2 filas de 3, letra legible en vez de apretar todo en una línea
   (decisión de José, 2026-11-19). El logo se achica un poco para que la barra no crezca de más. */
@media only screen and (max-width: 600px) {
  #header-wrap > .logo { width: 150px !important; padding: 8px 0 0 !important; }
  #header #mobile-menu {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    max-width: 420px;
    margin: 0 auto !important;
    padding: 2px 8px 6px !important;
  }
  /* .clearfix del template agrega ::before/::after: en grid ocuparían celdas */
  #header #mobile-menu::before,
  #header #mobile-menu::after { display: none !important; content: none !important; }
  #header #mobile-menu li { text-align: center; }
  #header #mobile-menu li a {
    padding: 8px 2px !important;
    font-size: 14px !important;
    line-height: 20px !important;
    letter-spacing: .5px !important;
  }
  #header #mobile-menu .pdh-badge { margin-left: 4px; vertical-align: 1px; }
}
@media only screen and (max-width: 340px) {
  #header #mobile-menu li a { font-size: 13px !important; letter-spacing: 0 !important; }
}

/* ---------- Pizzas: selector bajo la foto ---------- */
/* Rejilla en filas (en vez del masonry del template) para que abrir un selector
   solo alargue su fila y no reacomode las pizzas. */
.pizzas-grid .portfolio-container {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  height: auto !important;
}
/* el clearfix del template agrega ::before/::after, que en grid ocupan una celda */
.pizzas-grid .portfolio-container::before,
.pizzas-grid .portfolio-container::after { display: none !important; }
.pizzas-grid .portfolio-container > .element {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  float: none !important;
}
@media only screen and (max-width: 767px) {
  .pizzas-grid .portfolio-container { grid-template-columns: 1fr; }
}
.pizzas-grid .thumb-wrap { cursor: pointer; }
.pdh-overlay-text {
  display: inline-block;
  padding: 10px 22px;
  border: 2px solid #fff;
  color: #fff;
  font-family: Montserrat, sans-serif;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.pdh-add {
  margin: 14px 0 4px;
  padding: 14px 16px;
  background: var(--pdh-cream);
  border-left: 3px solid var(--pdh-red);
}
.pdh-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.pdh-add-label {
  color: var(--pdh-brown);
  font-family: Montserrat, sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.pdh-qty {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #cfc6b8;
  background: #fff;
}
.pdh-add .pdh-qty-btn {
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: #fff;
  color: var(--pdh-ink);
  font-size: 20px;
  line-height: 40px;
  letter-spacing: 0;
}
.pdh-add .pdh-qty-btn:hover { background: #eee6da; }
.pdh-add input.pdh-qty-input {
  width: 52px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid #cfc6b8;
  border-right: 1px solid #cfc6b8;
  text-align: center;
  text-indent: 0;
  font-size: 16px;
  line-height: 40px;
  -moz-appearance: textfield;
}
.pdh-add input.pdh-qty-input::-webkit-outer-spin-button,
.pdh-add input.pdh-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pdh-btn,
.pdh-add .pdh-add-btn {
  display: inline-block;
  margin: 0;
  padding: 13px 22px;
  border: 0;
  border-radius: 3px;
  background: var(--pdh-red);
  color: #fff !important;
  font-family: Montserrat, sans-serif;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s;
}
.pdh-btn:hover,
.pdh-add .pdh-add-btn:hover { background: var(--pdh-red-dark); }
.pdh-btn[disabled] {
  background: #c9c2b8;
  cursor: not-allowed;
}
.pdh-btn-dark { background: var(--pdh-ink); }
.pdh-btn-dark:hover { background: #000; }
.pdh-btn-ghost {
  background: transparent;
  color: var(--pdh-ink) !important;
  box-shadow: inset 0 0 0 1px var(--pdh-ink);
}
.pdh-btn-ghost:hover { background: var(--pdh-ink); color: #fff !important; }

.pdh-add-msg {
  margin: 10px 0 0;
  min-height: 0;
  color: var(--pdh-brown);
  font-size: 14px;
  line-height: 20px;
}
.pdh-add-msg:empty { display: none; }
.pdh-add-msg a { color: var(--pdh-red); text-decoration: underline; }

/* ---------- Pedido: columna izquierda ---------- */
.pdh-progress {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: pdh;
}
.pdh-progress li {
  position: relative;
  margin: 0 0 14px;
  padding-left: 42px;
  color: var(--pdh-muted);
  font-size: 15px;
  line-height: 30px;
  counter-increment: pdh;
}
.pdh-progress li::before {
  content: counter(pdh);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #cfc6b8;
  text-align: center;
  font-size: 13px;
  line-height: 28px;
}
.pdh-progress li.is-current { color: var(--pdh-brown); font-weight: 600; }
.pdh-progress li.is-current::before { background: var(--pdh-red); border-color: var(--pdh-red); color: #fff; }
.pdh-progress li.is-done::before { content: '\2713'; background: var(--pdh-brown); border-color: var(--pdh-brown); color: #fff; }

/* ---------- Pedido: formularios ---------- */
#pdh-pedido h3 {
  margin: 0 0 6px;
  color: var(--pdh-ink);
}
#pdh-pedido .pdh-lead {
  margin: 0 0 22px;
  color: var(--pdh-muted);
}
.pdh-field { margin-bottom: 16px; }
.pdh-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--pdh-brown);
  font-size: 13px;
  letter-spacing: .5px;
}
.pdh-field label small { color: var(--pdh-muted); letter-spacing: 0; }
#pdh-pedido .pdh-field input,
#pdh-pedido .pdh-field select,
#pdh-pedido .pdh-field textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #ddd5c9;
  border-radius: 0;
  background: #fff;
  color: var(--pdh-ink);
  font-size: 15px;
  text-indent: 0;
  line-height: 44px;
  height: 46px;
}
#pdh-pedido .pdh-field textarea {
  height: 90px;
  padding: 10px 12px;
  line-height: 22px;
  resize: vertical;
}
#pdh-pedido .pdh-field input:focus,
#pdh-pedido .pdh-field select:focus,
#pdh-pedido .pdh-field textarea:focus {
  outline: 0;
  border-color: var(--pdh-brown);
  box-shadow: 0 0 0 2px rgba(94, 71, 43, .15);
}
.pdh-row2 { display: flex; gap: 14px; }
.pdh-row2 > .pdh-field { flex: 1; min-width: 0; }
.pdh-note {
  margin: -6px 0 18px;
  color: var(--pdh-muted);
  font-size: 13px;
  line-height: 19px;
}
.pdh-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
.pdh-actions .pdh-spacer { flex: 1; }
.pdh-msg {
  margin: 12px 0 0;
  color: var(--pdh-red);
  font-size: 14px;
}
.pdh-msg:empty { display: none; }
.pdh-link-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pdh-muted);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: underline;
  cursor: pointer;
}
.pdh-link-btn:hover { color: var(--pdh-ink); }
.pdh-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Pedido: lista ---------- */
.pdh-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--pdh-line); }
.pdh-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--pdh-line);
}
.pdh-line-qty { min-width: 34px; color: var(--pdh-red); font-weight: 700; font-size: 16px; }
.pdh-line-name { flex: 1; min-width: 0; color: var(--pdh-ink); font-size: 16px; }
.pdh-line-name small { display: block; color: var(--pdh-muted); font-size: 12px; }
.pdh-line-sub { color: var(--pdh-ink); font-weight: 600; white-space: nowrap; }
#pdh-pedido .pdh-remove {
  margin: 0 0 0 6px;
  padding: 8px 10px;
  border: 1px solid #e3b5b7;
  border-radius: 3px;
  background: #fff;
  color: var(--pdh-red);
  font-size: 11px;
  line-height: 12px;
}
#pdh-pedido .pdh-remove:hover { background: var(--pdh-red); border-color: var(--pdh-red); color: #fff; }
.pdh-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0 0;
  color: var(--pdh-muted);
}
.pdh-total strong { color: var(--pdh-ink); font-size: 20px; }

/* ---------- Pedido: pago ---------- */
.pdh-quote {
  margin: 0 0 22px;
  padding: 16px 18px;
  background: var(--pdh-cream);
}
.pdh-quote-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--pdh-ink);
}
.pdh-quote-muted { color: var(--pdh-muted); font-size: 13px; }
.pdh-quote-total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--pdh-line);
  font-size: 17px;
}
.pdh-quote-total strong { color: var(--pdh-red); font-size: 22px; }
.pdh-loading { margin: 0; color: var(--pdh-muted); }
.pdh-error { margin: 0 0 8px; color: var(--pdh-red); }
.pdh-sim {
  margin: 0 0 18px;
  padding: 10px 14px;
  border: 1px dashed #d9a441;
  background: #fff8e8;
  color: #7a5a14;
  font-size: 13px;
  line-height: 19px;
}

/* ---------- Pedido: vacío y confirmación ---------- */
.pdh-center { text-align: center; padding: 20px 0; }
.pdh-big-icon {
  display: inline-block;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--pdh-red);
  color: #fff;
  font-size: 32px;
  line-height: 64px;
}
.pdh-order-no {
  display: inline-block;
  margin: 6px 0 18px;
  padding: 8px 16px;
  background: var(--pdh-cream);
  color: var(--pdh-brown);
  font-family: Montserrat, sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
}

@media only screen and (max-width: 767px) {
  .pdh-row2 { display: block; }
  .pdh-line { flex-wrap: wrap; }
  .pdh-line-name { flex-basis: calc(100% - 50px); }
  .pdh-line-sub { margin-left: 46px; }
  .pdh-line .pdh-remove { margin-left: auto !important; }
  .pdh-actions .pdh-spacer { display: none; }
}

/* Celular: primero el formulario del pedido, después la caja de pasos y horario */
@media only screen and (max-width: 767px) {
  .pdh-layout { display: flex; flex-direction: column; }
  .pdh-layout > .pdh-side { order: 2; margin-top: 30px; }
}

/* ---------- Pizzas disponibles del día (gallery.html + pedido.html) ---------- */
.pdh-stock-bar {
  position: absolute;
  top: 94px; /* js/pedido.js lo ajusta al alto real del header */
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  padding: 14px 20px;
  background: var(--pdh-cream);
  border-bottom: 1px solid var(--pdh-line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  text-align: center;
  font-family: Montserrat, sans-serif;
  font-size: 15px;
  line-height: 22px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--pdh-brown);
}
.pdh-stock-bar[hidden] { display: none; }
.pdh-stock-bar.en-contenido { position: relative; top: auto; box-shadow: none; }
.pdh-stock-bar .pdh-stock-n {
  display: inline-block;
  min-width: 1.6em;
  margin-right: 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--pdh-red);
  vertical-align: -2px;
}
.pdh-stock-bar.is-pocas { background: #fff4e0; }
.pdh-stock-bar.is-agotado { background: var(--pdh-red); border-bottom-color: var(--pdh-red-dark); color: #fff; }
.pdh-stock-bar.is-agotado .pdh-stock-n { color: #fff; }
.pdh-add .pdh-add-btn[disabled],
.pdh-add .pdh-add-btn[disabled]:hover { background: #c9c2b8; cursor: not-allowed; }
.pdh-add.is-agotado .pdh-qty { opacity: .4; pointer-events: none; }
.pdh-stock-aviso {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-left: 4px solid var(--pdh-red);
  background: #fdeceb;
  color: var(--pdh-red-dark);
  font-weight: 600;
}
.pdh-stock-aviso[hidden] { display: none; }
@media only screen and (max-width: 600px) {
  .pdh-stock-bar { padding: 12px 16px; font-size: 13px; }
  .pdh-stock-bar .pdh-stock-n { font-size: 20px; }
}
