@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Montserrat-400.ttf") format("truetype"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/Montserrat-500.ttf") format("truetype"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Montserrat-600.ttf") format("truetype"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/Montserrat-700.ttf") format("truetype"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/Montserrat-800.ttf") format("truetype"); }
:root { --red: #c5232a; --red-dark: #a01c22; --white: #fff; --gray: #f5f5f5; --text: #222; --border: #ddd; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f8f7f5; color: var(--text); padding-bottom: 90px; }
[hidden] { display: none !important; }

.app-header { background: var(--red); color: var(--white); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 1.25rem; margin: 0; }
.badge { background: var(--white); color: var(--red); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .9rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }

.deadline-banner { background: #fff0f2; border: 1px solid var(--red); color: var(--red-dark); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.badge-countdown { background: var(--red); color: var(--white); }

.card, .state-card { background: var(--white); border-radius: 10px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card h2, .state-card h2 { margin-top: 0; color: var(--red); font-size: 1.1rem; }
.state-card { text-align: center; padding: 40px 16px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.field label { display: block; font-size: .75rem; font-weight: 700; color: #555; margin-bottom: 4px; }
input, select, textarea { font-family: inherit; width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: var(--white); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); border-color: var(--red); }
.field-error, input.field-error, select.field-error { border: 2px solid var(--red); }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters .grow { flex: 1 1 260px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.product-card { background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.product-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--gray); }
.product-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-meta { font-size: .7rem; color: #777; margin: 0; text-transform: uppercase; }
.product-name { margin: 0; font-size: 1rem; }
.product-price { margin: 0; font-weight: 700; color: var(--red); font-size: 1.1rem; }
.empty-message { text-align: center; color: #666; padding: 24px; }

.btn { border: 0; border-radius: 6px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: var(--white); color: var(--red); border: 1px solid var(--red); }
.stepper { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--red); border-radius: 6px; overflow: hidden; margin-top: auto; }
.stepper button { background: var(--red); color: var(--white); border: 0; width: 40px; height: 36px; font-size: 1.2rem; cursor: pointer; }
.qty-value { font-weight: 700; }
.add-btn { margin-top: auto; }

.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--white); border-top: 3px solid var(--red); padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 50; }
.sticky-info { display: flex; flex-direction: column; }
.sticky-info strong { color: var(--red); font-size: 1.2rem; }

.alert-error { background: #ffe5e8; color: var(--red-dark); border: 1px solid var(--red); border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--white); border-radius: 12px; padding: 20px; width: 100%; max-width: 440px; max-height: 95vh; overflow-y: auto; }
.modal-wide { max-width: 640px; }
.modal-center { text-align: center; }
.modal h2 { color: var(--red); margin-top: 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.items-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
.items-table th, .items-table td { padding: 6px; border-bottom: 1px solid var(--border); text-align: left; }
.total-line { display: flex; justify-content: space-between; font-size: 1.1rem; }
.total-line strong { color: var(--red); }
.notice { background: #fff0f2; border-left: 4px solid var(--red); padding: 8px 10px; font-size: .85rem; }
.notes-label { display: block; font-size: .8rem; font-weight: 700; margin: 8px 0 4px; }
.receipt { background: var(--white); border: 1px dashed #888; padding: 14px; font-size: .9rem; }
.receipt h3 { text-align: center; margin-top: 0; }
.receipt-folio { text-align: center; }
.receipt-folio strong { font-size: 1.5rem; color: var(--red); }
.receipt-footer { text-align: center; font-weight: 700; }
.copy-feedback { color: #1b7f3b; font-weight: 600; }
.spinner { width: 48px; height: 48px; margin: 0 auto 12px; border: 5px solid #f3c3ca; border-top-color: var(--red); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) { .sticky-bar { flex-direction: column; align-items: stretch; } .modal-actions .btn { flex: 1 1 100%; } }

/* Alert-style modal ("Completa tus datos") */
#data-modal { background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.modal-alert { max-width: 546px; border-radius: 18px; padding: 40px 32px 36px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-alert .modal-icon { width: 80px; height: 80px; margin: 0 auto 20px; border-radius: 50%; background: #fdeeee; border: 2px solid #f8c9cc; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.modal-alert h2 { color: #222; font-size: 1.5rem; font-weight: 800; margin: 0 0 16px; }
.modal-alert p { color: #555; font-size: 1.05rem; line-height: 1.6; margin: 0 0 28px; }
.modal-alert p strong { color: #444; font-weight: 700; }
.modal-alert .btn-block { display: block; width: 100%; padding: 16px; font-size: 1.05rem; font-weight: 700; border-radius: 10px; background: var(--red); }
.modal-alert .btn-block:hover { background: var(--red-dark); }

/* Product card styling */
.product-card { border: 1.5px solid transparent; border-radius: 16px; padding: 14px; transition: border-color .15s, box-shadow .15s; }
.product-card:hover { border-color: #f4b6b9; box-shadow: 0 4px 14px rgba(197,35,42,.12); }
.product-image { border: 1px solid #eee; border-radius: 12px; background: var(--white); object-fit: contain; }
.product-body { padding: 14px 0 0; }
.product-meta { font-size: .72rem; font-weight: 700; color: #8a8a80; letter-spacing: .03em; }
.product-name { font-size: .98rem; font-weight: 600; color: #222; }
.product-price { color: #111; font-weight: 800; font-size: 1.3rem; margin: 6px 0; }
.add-btn { background: #fff0f0; color: var(--red); border: 1.5px solid #f4b6b9; border-radius: 10px; padding: 12px; }
.add-btn:hover { background: #fde3e3; }

/* Summary + success modals */
#summary-modal, #success-modal { background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.modal-sheet { border-radius: 20px; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,.25); max-width: 732px; }
.modal-sheet h2 { color: #222; font-size: 1.5rem; font-weight: 800; margin: 0 0 20px; }
.modal-sheet .who { color: #555; line-height: 1.7; margin: 0 0 18px; }
.modal-sheet .who b { color: #222; }
.modal-sheet .items-table { font-size: .95rem; color: #555; margin: 0 0 16px; }
.modal-sheet .items-table th { color: #222; font-weight: 700; border-bottom: 2px solid #e5e5e5; padding: 10px 6px; white-space: nowrap; }
.modal-sheet .items-table td { padding: 14px 6px; border-bottom: 1px solid #e5e5e5; }
.modal-sheet .items-table td:last-child { font-weight: 700; color: #222; white-space: nowrap; }
.modal-sheet .total-line { display: block; text-align: right; font-size: 1.4rem; font-weight: 800; color: #222; margin: 18px 0; }
.modal-sheet .total-line strong { color: var(--red); }
.modal-sheet .notice { border-radius: 10px; padding: 14px 16px; font-size: .95rem; line-height: 1.6; color: #444; margin: 0 0 14px; border-left: 4px solid; }
.modal-sheet .notice b { color: #222; }
.notice-red { background: #fff0f0; border-color: var(--red) !important; }
.notice-dark { background: #f7f6f4; border-color: #222 !important; }
.modal-sheet .modal-actions { margin-top: 20px; }
.btn-light { background: #f7f6f4; color: #222; border: 1px solid #e2e2e2; padding: 14px 22px; border-radius: 10px; }
.modal-sheet .btn-primary { padding: 14px 22px; border-radius: 10px; }
.btn-dark { background: #222; color: #fff; border: 1.5px solid #222; border-radius: 10px; padding: 14px; }
.btn-outline { background: #f7f6f4; color: #222; border: 1.5px solid #222; border-radius: 10px; padding: 14px; }
.btn-block { display: block; width: 100%; }

.modal-success { max-width: 594px; padding: 24px; }
.modal-success h2 { text-align: center; font-size: 1.35rem; margin-bottom: 8px; }
.success-sub { text-align: center; color: #555; font-size: .9rem; margin: 0 0 16px; }
.modal-success .receipt { border: 1px solid #e5e5e5; border-radius: 18px; padding: 0; overflow: hidden; font-size: .9rem; background: #fff; }
.receipt-head { background: var(--red); color: #fff; text-align: center; padding: 22px 16px 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.receipt-head h3 { margin: 6px 0 0; font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; }
.receipt-head span { font-size: .85rem; }
.receipt-body { padding: 18px 20px 20px; }
.modal-success .receipt-folio { color: #8a8a80; font-weight: 700; font-size: .8rem; margin: 0 0 8px; }
.modal-success .receipt-folio strong { display: inline-block; margin-top: 8px; background: #fff0f0; border: 1.5px solid #f4b6b9; border-radius: 12px; padding: 10px 28px; color: var(--red); font-size: 1.6rem; font-weight: 800; letter-spacing: .04em; }
.receipt-info { line-height: 1.7; color: #444; margin: 16px 0; }
.receipt-info b { color: #222; }
.modal-success .items-table th, .modal-success .items-table td { font-size: .85rem; }
.modal-success .receipt-total-line { font-size: 1.15rem; border-top: 1.5px dashed #bbb; padding-top: 14px; }
.modal-success .notice { font-size: .85rem; margin-bottom: 0; }
.receipt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 12px; }
.modal-success .btn-block { font-size: 1rem; }
.modal-success .copy-feedback { text-align: center; margin: 8px 0 0; }
@media (max-width: 520px) { .modal-sheet { padding: 20px; } .receipt-actions { grid-template-columns: 1fr; } }

/* Header, banner, form and filters (icons via ::before) */
.app-header { padding: 18px 28px; border-radius: 0 0 0 0; }
.brand h1 { font-size: 1.3rem; font-weight: 700; }
.badge { font-weight: 700; font-size: .85rem; padding: 8px 18px; }
#delivery-badge::before { content: "\1F69A  "; }
.deadline-banner { background: #fff0f0; border: 1px solid #e8a3a6; border-radius: 10px; color: var(--red); padding: 14px 18px; }
.deadline-banner > span:first-child::before { content: "\23F0  "; }
.badge-countdown { background: var(--red); color: #fff; }
#employee-form h2::before { content: "\1F464  "; }
.card { border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.field label { text-transform: uppercase; color: #555; font-weight: 700; font-size: .72rem; letter-spacing: .02em; }
input, select, textarea { border: 1px solid #e3e1dc; border-radius: 8px; padding: 12px; }
input::placeholder { color: #9a9a9a; }
select:focus, select#category-select { border-radius: 8px; }
.filters .field.grow { position: relative; }
.filters .field.grow::before { content: "\1F50D"; position: absolute; left: 12px; bottom: 11px; font-size: 1rem; pointer-events: none; }
.filters #search-input { padding-left: 38px; }
#category-select { border: 2px solid var(--red); }
.app-header .logo { display: block; }
.app-header .brand { gap: 18px; }
.app-header .logo { width: 48px; height: 48px; }
.app-header .brand h1 { border-left: 1px solid rgba(255,255,255,.4); padding-left: 18px; line-height: 48px; }

/* Closed / no active period card */
#state-closed { max-width: 780px; margin: 24px auto; padding: 44px 40px; border-radius: 24px; border: 1px solid #ece9e4; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
#state-closed .closed-icon { width: 84px; height: 84px; margin: 0 auto 22px; border-radius: 50%; background: #fdeeee; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
#state-closed h2 { color: #222; font-size: 1.9rem; font-weight: 800; line-height: 1.35; margin: 0 0 16px; }
#state-closed .closed-lead { color: #555; font-size: 1.05rem; line-height: 1.8; margin: 0 0 24px; }
#state-closed .closed-lead strong { color: #222; }
#state-closed .closed-when { text-align: left; background: #f7f6f4; border: 1px solid #e8e5e0; border-left: 5px solid var(--red); border-radius: 12px; padding: 18px 22px; margin-bottom: 24px; }
#state-closed .closed-when h3 { margin: 0 0 8px; color: var(--red); font-size: 1.05rem; font-weight: 800; text-transform: uppercase; }
#state-closed .closed-when p { margin: 0; color: #444; line-height: 1.7; }
#state-closed .closed-when strong { color: #222; }
#state-closed .closed-note { color: #8a8a80; font-size: .85rem; line-height: 1.7; margin: 0; }
@media (max-width: 520px) { #state-closed { padding: 28px 18px; } #state-closed h2 { font-size: 1.4rem; } }

/* Email verification modal */
#verify-modal { background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
#verify-modal .modal-alert p { margin-bottom: 18px; }
.code-input { text-align: center; font-size: 1.8rem; letter-spacing: .5em; font-weight: 700; padding: 14px 10px 14px 18px; margin-bottom: 14px; }
.verify-error { color: var(--red) !important; font-weight: 600; font-size: .9rem !important; margin: -4px 0 14px !important; }
.verify-links { display: flex; justify-content: space-between; margin-top: 16px; }
.link-btn { background: none; border: 0; color: var(--red); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: underline; }

/* "Nuevo" badge in the product card corner */
.product-card { position: relative; }
.product-badge { position: absolute; top: 22px; left: 22px; z-index: 2; background: var(--red); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; box-shadow: 0 2px 6px rgba(197,35,42,.35); pointer-events: none; }
