/* --- BOOKING: "Book Now" buttons + booking form popup (see js/booking.js) --- */

/* "Book Now" button added to each product card. It copies the class of the
   card's Messenger button (order-btn / btn-order) so it gets the same size and
   shape on every page; these rules only reset <button> defaults. */
.product-card .fc-book-btn {
    width: 100%;
    border: 0;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
    margin-bottom: 8px;
}

/* The Messenger link becomes the second option under "Book Now". */
.product-card a.fc-secondary {
    background: transparent;
    color: var(--moss);
    box-shadow: inset 0 0 0 1.5px var(--moss);
}

.product-card a.fc-secondary:hover {
    background: var(--moss);
    color: #fff;
}

body.fc-booking-open { overflow: hidden; }

/* --- POPUP --- */
.fc-booking {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: 'Poppins', sans-serif;
    color: var(--moss);
}

.fc-booking[hidden] { display: none; }

.fc-booking-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(27, 48, 34, 0.6);
}

.fc-booking-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--white, #fff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.fc-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--cream);
    color: var(--moss);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.fc-close:hover { background: var(--blush); }

/* Product summary at the top */
.fc-booking-head {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 24px 64px 18px 24px;
    background: var(--cream);
    border-bottom: 1px solid #f0e6e1;
}

.fc-product-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.fc-product-img[hidden] { display: none; }

.fc-eyebrow {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    color: #9c5a6e;
}

.fc-product-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    line-height: 1.25;
    margin: 2px 0;
}

.fc-product-price {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Step indicator */
.fc-steps {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 14px 24px 0;
    gap: 6px;
    counter-reset: fc-step;
}

.fc-steps li {
    flex: 1;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8a948d;
    padding-top: 8px;
    border-top: 3px solid #ece6e2;
    counter-increment: fc-step;
}

.fc-steps[hidden] { display: none; }
.fc-steps li::before { content: counter(fc-step) ". "; }
.fc-steps li.is-active { color: var(--moss); border-top-color: var(--moss); }
.fc-steps li.is-done { color: var(--moss); border-top-color: var(--rose); }

/* Form */
.fc-form { padding: 8px 24px 24px; }

.fc-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.fc-step[hidden] { display: none; }

.fc-step-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    margin: 14px 0 4px;
}

.fc-field { margin-top: 14px; }
.fc-field[hidden] { display: none; }

.fc-field > label,
.fc-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.fc-optional { font-weight: 400; color: #6b766f; }

.fc-form input[type="text"],
.fc-form input[type="tel"],
.fc-form input[type="email"],
.fc-form input[type="date"],
.fc-form input[type="number"],
.fc-form select,
.fc-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd5d0;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 16px; /* 16px stops iPhones from zooming into the field */
    color: var(--moss);
}

.fc-form textarea { resize: vertical; min-height: 80px; }

.fc-form input:focus,
.fc-form select:focus,
.fc-form textarea:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(195, 141, 158, 0.25);
}

.fc-hint {
    font-size: 0.78rem;
    color: #5d6a61;
    margin-top: 6px;
    line-height: 1.5;
}

.fc-counter { float: right; font-weight: 400; color: #6b766f; }

/* Pill choices (Delivery / Pick-up, time slots) */
.fc-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fc-choice { position: relative; flex: 1 1 0; min-width: 0; }

.fc-choice input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.fc-choice span {
    display: block;
    padding: 11px 12px;
    border: 1px solid #ddd5d0;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    background: #fff;
    transition: 0.2s;
}

.fc-choice strong { display: block; }

.fc-choice small {
    display: block;
    font-size: 0.74rem;
    font-weight: 400;
    white-space: nowrap;
}

.fc-choice input:checked + span {
    background: var(--moss);
    border-color: var(--moss);
    color: #fff;
}

.fc-choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(195, 141, 158, 0.45); }

.fc-choice input:disabled + span {
    color: #b3b8b4;
    background: #f6f6f6;
    text-decoration: line-through;
}

.fc-field > label.fc-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 0;
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
}

.fc-check input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--moss);
}

/* Summary on the last step */
.fc-summary {
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--cream);
    border-radius: 10px;
    font-size: 0.82rem;
}

.fc-summary h4 { font-size: 0.85rem; margin-bottom: 8px; }

.fc-summary dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 12px;
    margin: 0;
}

.fc-summary dt { color: #5d6a61; }
.fc-summary dd { margin: 0; font-weight: 600; word-break: break-word; }

.fc-note {
    margin-top: 14px;
    font-size: 0.78rem;
    color: #5d6a61;
    line-height: 1.5;
}

/* Step 4: pay by GCash or BPI */
.fc-pay-methods { margin-top: 14px; }

.fc-pay {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 20px;
    align-items: center;
    margin-top: 16px;
    padding: 16px;
    background: var(--cream);
    border-radius: 12px;
}

.fc-pay-qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.fc-pay-qr {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 10px;
    background: #fff;
}

.fc-pay-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 8px;
    background: #fff;
    box-shadow: inset 0 0 0 1.5px #ddd5d0;
    color: var(--moss);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.fc-pay-save:hover { box-shadow: inset 0 0 0 1.5px var(--moss); }
.fc-pay-save:focus-visible { outline: 3px solid rgba(195, 141, 158, 0.6); outline-offset: 2px; }

.fc-pay-amount {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    line-height: 1.2;
    margin-bottom: 6px;
}

.fc-pay-account {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 2px 10px;
    margin: 12px 0 0;
    font-size: 0.82rem;
}

.fc-pay-account dt { color: #5d6a61; }
.fc-pay-account dd { margin: 0; font-weight: 600; }

.fc-pay-steps {
    margin: 16px 0 0 20px;
    font-size: 0.85rem;
    line-height: 1.7;
}

/* Buttons */
.fc-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.fc-btn {
    flex: 1;
    padding: 14px 16px;
    border-radius: 8px;
    border: 0;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
    text-decoration: none;
}

.fc-btn[hidden] { display: none; }
.fc-btn-primary { background: var(--moss); color: #fff; flex: 2; }
.fc-btn-primary:hover { background: #2c4a36; }
.fc-btn-primary:disabled { background: #9aa39d; cursor: wait; }
.fc-btn-ghost { background: transparent; color: var(--moss); box-shadow: inset 0 0 0 1.5px #ddd5d0; }
.fc-btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--moss); }

.fc-error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fdecee;
    color: #8a1f35;
    font-size: 0.82rem;
}

.fc-error[hidden] { display: none; }
.fc-error a { color: inherit; font-weight: 600; }

/* Success screen */
.fc-done { padding: 36px 24px 28px; text-align: center; }
.fc-done[hidden] { display: none; }

.fc-done-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--moss);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.fc-done h3 { font-family: 'Playfair Display', serif; font-size: 1.6rem; margin-bottom: 8px; }
.fc-done h3:focus { outline: none; }
.fc-done p { font-size: 0.9rem; margin-bottom: 8px; }
.fc-done p a { color: var(--moss); font-weight: 600; }

.fc-ref {
    display: inline-block;
    margin: 6px 0 14px;
    padding: 8px 16px;
    background: var(--cream);
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 1px;
}

.fc-done .fc-actions { flex-direction: column; }

/* Phones: popup fills the screen */
@media (max-width: 600px) {
    .fc-booking { padding: 0; align-items: stretch; }
    .fc-booking-dialog { max-height: none; height: 100%; border-radius: 0; }
    .fc-booking-head { padding: 18px 60px 14px 16px; }
    .fc-product-img { width: 56px; height: 56px; }
    .fc-product-name { font-size: 1.2rem; }
    .fc-steps { padding: 12px 16px 0; }
    .fc-form { padding: 4px 16px 24px; }
    .product-card .fc-book-btn { margin-bottom: 6px; }
    .fc-pay { grid-template-columns: 1fr; text-align: center; }
    .fc-pay-qr { max-width: 220px; margin: 0 auto; }
    .fc-pay-account { justify-content: center; text-align: left; }
}
