/* Bodas.pro · componentes comunes */

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px;
  border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; font-size: .95rem; letter-spacing: .01em;
  text-decoration: none; transition: background .2s var(--ease), color .2s, border-color .2s, transform .1s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent-strong); color: #fff; }
.btn--primary:hover { background: var(--ink); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--lg { min-height: 54px; padding: 12px 26px; font-size: 1rem; }
.btn--sm { min-height: 38px; padding: 6px 14px; font-size: .86rem; }
.btn--block { width: 100%; }
/* Botones por función (paneles e impresiones): mismos tonos que panel.css */
.btn--success { background: #0F8A47; color: #fff; } .btn--success:hover { background: #0B6E38; color: #fff; }
.btn--warning { background: #B45309; color: #fff; } .btn--warning:hover { background: #92400E; color: #fff; }
.btn--info { background: #0E7C86; color: #fff; } .btn--info:hover { background: #0B636B; color: #fff; }
.btn--secondary { background: #4B5563; color: #fff; } .btn--secondary:hover { background: #374151; color: #fff; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.is-loading { position: relative; color: transparent; }
.btn.is-loading::after { content: ""; position: absolute; width: 20px; height: 20px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink); text-decoration: none; flex: none;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--ink); }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }
.icon-btn--danger { color: var(--danger); }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; font-size: .9rem; min-height: 32px; }
.link-btn--danger { color: var(--danger); }
.link-more { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; text-decoration: none; font-size: .92rem; }
.link-more .icon { width: 18px; height: 18px; }

.badge {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent-strong); color: #fff; font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center;
}

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.tag--new { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag--sage { background: var(--sage-soft); border-color: transparent; color: #3E5239; }
.tag--warn { background: #FBEFD9; border-color: transparent; color: #7A5214; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chip-list--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin: 0 calc(var(--gutter) * -1) 16px; padding-left: var(--gutter); padding-right: var(--gutter); scrollbar-width: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 15px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 600; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip__n { font-size: .74rem; color: var(--muted); font-weight: 700; }

/* Formularios */
.field { display: grid; gap: 6px; }
.field + .field, .field-row + .field, .field + .field-row { margin-top: 14px; }
.field label, .ed-label { font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.field label .icon { width: 18px; height: 18px; color: var(--gold); }
.field-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface);
  font-size: 1rem; transition: border-color .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-strong); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field__error { color: var(--danger); font-size: .86rem; font-weight: 600; margin: 0; }
.input--code { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; font-size: .95rem; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent-strong); flex: none; }
.check--sm { font-size: .86rem; padding: 6px 0; }
.check--error span { color: var(--danger); }
.field--inline { grid-template-columns: auto 1fr; align-items: center; gap: 14px; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); width: max-content; }
.qty input { width: 52px; min-height: 44px; border: 0; text-align: center; padding: 0; -moz-appearance: textfield; background: transparent; font-weight: 700; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { box-shadow: none; }
.qty__btn { width: 44px; height: 44px; border: 0; background: none; font-size: 1.3rem; border-radius: 50%; }
.qty__btn:hover { background: var(--accent-soft); }
.qty--sm input { min-height: 38px; width: 42px; }
.qty--sm .qty__btn { width: 38px; height: 38px; }

.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); gap: 2px; }
.seg__btn { border: 0; background: none; border-radius: 999px; padding: 7px 13px; font-size: .84rem; font-weight: 700; min-height: 36px; display: inline-flex; gap: 5px; align-items: center; color: var(--muted); }
.seg__btn .icon { width: 17px; height: 17px; }
.seg__btn.is-on { background: var(--ink); color: #fff; }

/* Opciones de variante */
.opt { border: 0; padding: 0; margin: 0 0 16px; }
.opt__label { font-weight: 700; font-size: .9rem; margin-bottom: 8px; padding: 0; }
.opt__label strong { font-weight: 600; color: var(--muted); }
.opt__values { display: flex; flex-wrap: wrap; gap: 8px; }
.opt__value { position: relative; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.opt__value input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch { width: 40px; height: 40px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); outline: 2px solid transparent; outline-offset: 3px; }
.opt__value input:checked + .swatch { outline-color: var(--ink); }
.opt__value input:focus-visible + .swatch, .opt__value input:focus-visible + .size-btn { box-shadow: 0 0 0 3px var(--accent-soft); }
.size-btn { display: inline-grid; place-items: center; min-width: 48px; height: 44px; padding: 0 12px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: .9rem; }
.opt__value input:checked + .size-btn { border-color: var(--ink); background: var(--ink); color: #fff; }
.opt__name { font-size: .88rem; font-weight: 600; }

/* Avisos */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); font-size: .93rem; margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); }
.notice .icon { margin-top: 1px; }
.notice--ok { background: var(--sage-soft); border-color: transparent; color: #2F4429; }
.notice--error { background: #F8E4E1; border-color: transparent; color: #7C2B23; }
.notice--warn { background: #FBEFD9; border-color: transparent; color: #6A4510; }
.notice--info { background: var(--gold-soft); border-color: transparent; }
.notice--action { flex-wrap: wrap; align-items: center; justify-content: space-between; }
.flash-stack { padding-top: 14px; }

/* Cabecera y franja */
.promo-bar { position: relative; background: var(--ink); color: #F5EDE6; font-size: .82rem; font-weight: 600; letter-spacing: .02em; }
.promo-bar__track { position: relative; height: 36px; overflow: hidden; margin: 0 44px; }
.promo-bar__msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.promo-bar__msg.is-active { opacity: 1; transform: none; }
.promo-bar__close { position: absolute; right: 2px; top: 0; height: 36px; width: 40px; border: 0; background: none; color: inherit; display: grid; place-items: center; }
.promo-bar__close .icon { width: 16px; height: 16px; }

.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom: 1px solid transparent; transition: transform .3s var(--ease), border-color .2s; }
.site-header.is-scrolled { border-bottom-color: var(--line); background: var(--bg); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: var(--header-h); max-width: 1240px; margin: 0 auto; padding: 0 calc(var(--gutter) - 8px); }
.site-header__logo img { width: 150px; height: auto; }
.site-header__actions { display: flex; justify-content: flex-end; }
.site-nav { display: none; }
@media (min-width: 900px) {
  .site-header__inner { grid-template-columns: auto 1fr auto; gap: 28px; }
  .site-header__menu { display: none; }
  .site-header__logo img { width: 180px; }
  .site-nav { display: flex; gap: 26px; }
  .site-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 6px 0; border-bottom: 1.5px solid transparent; }
  .site-nav a:hover { border-bottom-color: var(--accent); }
}

/* Cajones */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(44, 37, 37, .38); opacity: 0; transition: opacity .25s; }
.drawer-backdrop.is-open { opacity: 1; }
.drawer { position: fixed; top: 0; bottom: 0; z-index: 61; width: min(400px, 92vw); background: var(--bg); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transition: transform .28s var(--ease); overflow-y: auto; overscroll-behavior: contain; }
.drawer--left { left: 0; transform: translateX(-100%); }
.drawer--right { right: 0; transform: translateX(100%); }
.drawer.is-open { transform: none; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px var(--gutter); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.drawer__title { font-family: var(--font-display); font-size: 1.7rem; margin: 0; }
.drawer__foot { margin-top: auto; padding: 18px var(--gutter) 28px; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.drawer__pro { color: var(--ink); text-decoration: none; font-size: .95rem; }
.drawer__pro strong { color: var(--accent-strong); }
.drawer-nav { padding: 8px 0; }
.drawer-nav__link { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem; list-style: none; cursor: pointer; min-height: 52px; }
.drawer-nav__link::-webkit-details-marker { display: none; }
.drawer-nav__group[open] > summary .icon { transform: rotate(180deg); }
.drawer-cats { list-style: none; margin: 0; padding: 0 0 8px; }
.drawer-cats__family { padding: 12px var(--gutter) 4px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.drawer-cats a { display: flex; align-items: center; gap: 12px; padding: 7px var(--gutter); color: var(--ink); text-decoration: none; font-size: .95rem; min-height: 48px; }
.drawer-cats a:hover { background: var(--accent-soft); }
.drawer-cats__thumb { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--gold-soft); display: grid; place-items: center; flex: none; color: var(--gold); }
.drawer-cats__thumb img { width: 100%; height: 100%; object-fit: cover; }
.drawer-cats__thumb .icon { width: 20px; height: 20px; }
.drawer-cats__count { margin-left: auto; font-size: .78rem; color: var(--muted); font-weight: 700; }

/* Minicarrito */
.minicart { padding: 16px var(--gutter) 24px; display: grid; gap: 12px; }
.minicart__empty { color: var(--muted); }
.minicart__lines { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.minicart__line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.minicart__line img { border-radius: var(--r-sm); background: var(--surface); object-fit: cover; width: 64px; height: 76px; }
.minicart__name { font-weight: 700; margin: 0; font-size: .92rem; }
.minicart__line .muted { margin: 0; font-size: .82rem; }
.minicart__subtotal { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; margin: 0; }
.ship-progress { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; font-size: .9rem; }
.ship-progress p { margin: 0 0 6px; }
.ship-progress progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; overflow: hidden; background: var(--line); }
.ship-progress progress::-webkit-progress-bar { background: var(--line); }
.ship-progress progress::-webkit-progress-value { background: var(--sage); }
.ship-progress progress::-moz-progress-bar { background: var(--sage); }
.ship-progress--done { display: flex; gap: 8px; align-items: center; color: #3E5239; background: var(--sage-soft); border-color: transparent; font-weight: 700; }

/* Botón flotante de WhatsApp */
.fab-whatsapp { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; width: 56px; height: 56px; border-radius: 50%; background: #2E7D4F; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.fab-whatsapp .icon { width: 28px; height: 28px; }
.fab-whatsapp:hover { background: #24653F; color: #fff; }

/* Diálogo */
.dialog { border: 0; border-radius: var(--r); padding: 20px; max-width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); background: var(--surface); }
.dialog::backdrop { background: rgba(44, 37, 37, .4); }
.dialog__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.dialog__head h2 { font-family: var(--font-display); font-size: 1.6rem; margin: 0; }
.dialog__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.table-wrap { overflow-x: auto; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.table-wrap th, .table-wrap td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }

/* Migas, pie, totales, estados vacíos */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .84rem; color: var(--muted); padding-top: 16px; }
.breadcrumbs a { color: var(--muted); }
.site-footer { margin-top: 64px; background: var(--surface); border-top: 1px solid var(--line); padding: 40px 0 calc(24px + env(safe-area-inset-bottom)); font-size: .92rem; }
.site-footer__grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.site-footer__brand { grid-column: 1 / -1; }
.site-footer__brand img { width: 170px; margin-bottom: 12px; }
.site-footer nav { display: grid; gap: 4px; align-content: start; }
.site-footer nav a { color: var(--ink); text-decoration: none; padding: 5px 0; }
.site-footer nav a:hover { color: var(--accent-strong); }
.site-footer h2 { font-family: var(--font-ui); font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin-bottom: 6px; }
.site-footer__contact a { color: var(--ink); }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer__bottom p { margin: 0; }
.pay-icons { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; }
.pay-icons li { border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; font-size: .78rem; font-weight: 800; color: var(--ink); background: var(--bg); }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } .site-footer__brand { grid-column: auto; } }

.totals { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 10px; }
.totals dl { margin: 0; display: grid; gap: 8px; }
.totals dl > div { display: flex; justify-content: space-between; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 700; }
.totals__grand { border-top: 1px solid var(--line); padding-top: 10px; font-size: 1.15rem; }
.totals__grand dt { color: var(--ink); font-weight: 700; }
.totals__vat { margin: 0; font-size: .85rem; }
.empty-state { text-align: center; padding: 40px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); display: grid; justify-items: center; gap: 6px; }
.empty-state--left { text-align: left; justify-items: start; }
.empty-state h2 { font-family: var(--font-display); font-size: 1.8rem; margin: 6px 0 0; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.minimal-header { padding: 18px var(--gutter); display: flex; justify-content: center; border-bottom: 1px solid var(--line); }
