/* ==========================================================================
   Flower Shop — Stylesheet
   Mobile-first. Design tokens live in :root.
   ========================================================================== */

:root {
    --bg: #faf8f1;
    --bg-soft: #f1ecdf;
    --surface: #ffffff;
    --ink: #2b2822;
    --ink-soft: #7c7568;
    --line: #e7dfcd;
    /* Brand colors from Maya's logo: deep emerald + gold */
    --green: #1f6350;
    --green-dark: #17493a;
    --sage: #e7efe7;
    --gold: #b08a1e;        /* gold accent (text/badges) */
    --gold-dark: #8f6d10;
    --gold-soft: #f8f0d4;   /* soft gold tint */
    --danger: #b04a3c;
    --radius-lg: 22px;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow-sm: 0 2px 10px rgba(80, 60, 40, 0.07);
    --shadow-md: 0 14px 34px rgba(80, 60, 40, 0.13);
    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-body: 'Jost', 'Segoe UI', Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.no-scroll {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

.hidden {
    display: none !important;
}

img {
    max-width: 100%;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    margin: 0;
}

p {
    margin: 0;
}

button {
    font-family: inherit;
}

/* Kill double-tap zoom delays on all tappable things */
button,
.chip,
.product-card,
.pay-option,
.gcash-qr-link {
    touch-action: manipulation;
}

/* ==========================================================================
   Buttons & shared controls
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--green);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--green-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--green);
    box-shadow: inset 0 0 0 1.5px var(--green);
}

.btn-ghost:hover {
    background: var(--sage);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-lg {
    padding: 15px 26px;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.icon-btn:hover {
    background: var(--bg-soft);
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(250, 248, 241, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(231, 223, 205, 0.8);
}

.header-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 720px) {
    .header-inner {
        padding: 12px 20px;
    }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

@media (max-width: 380px) {
    .brand {
        font-size: 1.15rem;
        gap: 8px;
    }

    .brand-logo {
        width: 28px;
        height: 28px;
    }
}

.brand-mark {
    width: 26px;
    height: 26px;
    color: var(--gold);
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(43, 40, 34, 0.18);
}

.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cart-btn svg {
    width: 22px;
    height: 22px;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.cart-count.pulse {
    animation: pulse 0.4s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   Header tagline (beside the shop name)
   ========================================================================== */

.brand-group {
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-width: 0;
}

.header-tagline {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border-left: 1px solid var(--line);
    padding-left: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}

@media (min-width: 720px) {
    .header-tagline {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    max-width: 1080px;
    margin: 0 auto;
    padding: 22px 14px 0;
}

@media (min-width: 720px) {
    .hero {
        padding: 36px 20px 0;
    }
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
    background: linear-gradient(150deg, #fffdf6, var(--gold-soft) 55%, var(--sage));
    border: 1px solid rgba(231, 223, 205, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px 22px;
}

@media (min-width: 860px) {
    .hero-inner {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 38px;
        padding: 48px 44px;
    }
}

.hero-copy {
    text-align: left;
}

.hero-eyebrow {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 12px;
}

.hero .section-title {
    font-size: clamp(2rem, 5.4vw, 3.1rem);
    margin-bottom: 10px;
}

.hero .section-sub {
    max-width: 46ch;
}

.hero-cta {
    margin-top: 22px;
}

.hero-media {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    aspect-ratio: 16 / 10;
    background: linear-gradient(150deg, var(--gold-soft), var(--bg-soft));
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (min-width: 860px) {
    .hero-media {
        aspect-ratio: 4 / 5;
    }
}

/* ==========================================================================
   Catalog
   ========================================================================== */

.catalog {
    max-width: 1080px;
    margin: 0 auto;
    padding: 22px 14px 90px;
    scroll-margin-top: 76px;
}

@media (min-width: 720px) {
    .catalog {
        padding: 30px 20px 72px;
    }
}

.catalog-head {
    text-align: center;
    margin-bottom: 22px;
}

.section-title {
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    margin-bottom: 8px;
}

.section-title em {
    color: var(--gold);
    font-style: italic;
}

.section-title-sm {
    font-size: clamp(1.5rem, 4.5vw, 2rem);
}

.section-sub {
    color: var(--ink-soft);
    font-weight: 300;
}

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 4px 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    flex: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: start;
}

.chip:hover {
    border-color: var(--green);
    color: var(--green);
}

.chip.is-active {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Compact 2-column grid on phones — more flowers visible per screen */
@media (min-width: 420px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .card-media {
        aspect-ratio: 1 / 1;
    }

    .card-body {
        padding: 12px 12px 14px;
    }

    .card-name {
        font-size: 1.12rem;
    }

    .card-desc {
        font-size: 0.8rem;
    }

    .card-price {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .add-btn {
        padding: 13px 10px;
        font-size: 0.8rem;
    }

    .availability-badge {
        font-size: 0.62rem;
        padding: 4px 9px;
    }
}

@media (min-width: 960px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }

    .card-media {
        aspect-ratio: 4 / 5;
    }

    .card-body {
        padding: 18px 18px 20px;
    }

    .card-name {
        font-size: 1.4rem;
    }

    .card-desc {
        font-size: 0.92rem;
    }

    .card-price {
        font-size: 1.12rem;
        margin-bottom: 14px;
    }

    .add-btn {
        padding: 13px 18px;
        font-size: 0.92rem;
    }

    .availability-badge {
        font-size: 0.72rem;
        padding: 5px 12px;
    }
}

/* --- Product card --- */

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-card:active {
    transform: scale(0.98);
}

@media (prefers-reduced-motion: no-preference) {
    .product-card {
        animation: cardIn 0.45s ease backwards;
    }
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.card-media {
    position: relative;
    aspect-ratio: 4 / 5;
    background: linear-gradient(150deg, var(--gold-soft), var(--bg-soft));
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.product-card:hover .card-img {
    transform: scale(1.04);
}

.product-card.is-unavailable .card-img {
    filter: grayscale(0.85);
    opacity: 0.75;
}

.availability-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.availability-badge.in {
    background: rgba(234, 240, 232, 0.94);
    color: var(--green);
}

.availability-badge.out {
    background: rgba(47, 43, 37, 0.72);
    color: #fff;
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 18px 20px;
}

.card-cat {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 6px;
}

.card-name {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.card-desc {
    color: var(--ink-soft);
    font-weight: 300;
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.card-price {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--gold-dark);
    margin-bottom: 14px;
    margin-top: auto;
}

.add-btn {
    border: none;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    padding: 13px 18px;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.12s ease;
}

.add-btn:hover {
    background: var(--green-dark);
}

.add-btn:active {
    transform: scale(0.97);
}

.add-btn:disabled {
    background: var(--bg-soft);
    color: var(--ink-soft);
    cursor: not-allowed;
}

/* --- Made to order & stock --- */

.availability-badge.mto {
    background: rgba(255, 244, 224, 0.95);
    color: var(--gold-dark);
}

.add-btn.fb-btn {
    background: #1877f2;
}

.add-btn.fb-btn:hover {
    background: #0f65e0;
}

a.fb-btn.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.stock-note {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gold-dark);
    margin: -8px 0 12px;
}

.stock-note.out {
    color: var(--ink-soft);
}

/* --- Skeleton loading --- */

.skeleton {
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.skeleton-media,
.skeleton-line {
    background: linear-gradient(90deg, var(--bg-soft) 25%, #faf5ec 50%, var(--bg-soft) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
}

.skeleton-media {
    aspect-ratio: 4 / 5;
}

.skeleton-body {
    padding: 18px;
    display: grid;
    gap: 10px;
}

.skeleton-line {
    height: 14px;
    border-radius: 7px;
}

.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* --- Catalog status messages --- */

.catalog-message {
    text-align: center;
    padding: 56px 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.message-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.message-text {
    color: var(--ink-soft);
    font-weight: 300;
    margin-bottom: 20px;
}

/* ==========================================================================
   Layers (modals / drawers / overlays) — shared
   ========================================================================== */

.modal,
.drawer,
.checkout-overlay,
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(47, 43, 37, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal.open,
.drawer.open,
.checkout-overlay.open,
.confirm-overlay.open {
    opacity: 1;
}

/* ==========================================================================
   Product detail modal (always centered)
   ========================================================================== */

.modal {
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
}

.modal-sheet {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 100%;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    transform: translateY(26px) scale(0.97);
    transition: transform 0.3s ease;
}

.modal.open .modal-sheet {
    transform: none;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
}

.detail-media {
    aspect-ratio: 4 / 3;
    background: linear-gradient(150deg, var(--gold-soft), var(--bg-soft));
    overflow: hidden;
}

.detail-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-body {
    padding: 22px 24px 28px;
}

.detail-cat {
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 6px;
}

.detail-name {
    font-size: 2rem;
    margin-bottom: 8px;
}

.detail-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gold-dark);
    margin-bottom: 14px;
}

.detail-desc {
    color: var(--ink-soft);
    font-weight: 300;
    margin-bottom: 20px;
}

.detail-unavailable {
    background: var(--bg-soft);
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.detail-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.detail-actions .btn-block {
    flex: 1;
}

/* --- Quantity stepper --- */

.stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.step-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: 50%;
    font-size: 1.15rem;
    color: var(--green);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.step-btn:hover:not(:disabled) {
    background: var(--sage);
}

.step-btn:disabled {
    color: var(--line);
    cursor: not-allowed;
}

.step-qty {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

/* ==========================================================================
   Cart drawer
   ========================================================================== */

.drawer {
    z-index: 60;
}

.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--bg);
    box-shadow: -12px 0 40px rgba(47, 43, 37, 0.25);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.drawer.open .drawer-panel {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 12px 16px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    border-radius: 0 0 var(--radius) var(--radius);
}

.drawer-title {
    font-size: 1.5rem;
}

.drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 24px;
}

.drawer-foot {
    padding: 16px 24px calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
}

.cart-empty {
    text-align: center;
    padding: 64px 12px;
}

.cart-empty-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.cart-empty-text {
    color: var(--ink-soft);
    font-weight: 300;
    margin-bottom: 22px;
}

.cart-line {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.cart-line:last-child {
    border-bottom: none;
}

.cart-thumb {
    width: 66px;
    height: 66px;
    flex: none;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: linear-gradient(150deg, var(--gold-soft), var(--bg-soft));
}

.cart-info {
    flex: 1;
    min-width: 0;
}

.cart-name-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.cart-name {
    font-weight: 500;
    font-size: 0.98rem;
}

.cart-remove {
    border: none;
    background: none;
    padding: 0;
    color: var(--ink-soft);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-decoration: underline;
    cursor: pointer;
    flex: none;
}

.cart-remove:hover {
    color: var(--danger);
}

.cart-unit {
    font-size: 0.82rem;
    color: var(--ink-soft);
    font-weight: 300;
    margin-top: 2px;
}

.cart-line-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.cart-line-total {
    font-weight: 600;
    color: var(--gold-dark);
}

.subtotal-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}

.subtotal-label {
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.subtotal-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink);
}

.drawer-note {
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-weight: 300;
    text-align: center;
    margin: 8px 0 14px;
}

/* ==========================================================================
   Checkout
   ========================================================================== */

.checkout-overlay {
    z-index: 70;
}

.checkout-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    transform: translateY(5%);
    transition: transform 0.28s ease;
}

.checkout-overlay.open .checkout-panel {
    transform: translateY(0);
}

@media (min-width: 720px) {
    .checkout-panel {
        inset: 0;
        margin: auto;
        width: min(620px, 94%);
        height: min(820px, 94%);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
        overflow: hidden;
    }
}

.checkout-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.checkout-title {
    font-size: 1.5rem;
}

.checkout-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px calc(28px + env(safe-area-inset-bottom));
}

.form-section {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
}

.form-heading {
    font-size: 1.35rem;
    margin-bottom: 16px;
}

.field {
    margin-bottom: 14px;
}

.field:last-child {
    margin-bottom: 0;
}

.field label {
    display: block;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.field .optional {
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 300;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: #fffdf9;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%237c7568' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.field textarea {
    resize: vertical;
    min-height: 58px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(65, 96, 78, 0.14);
}

.field.invalid input,
.field.invalid textarea,
.field.invalid select {
    border-color: var(--danger);
}

.field-error {
    display: none;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 5px;
}

.field.invalid .field-error {
    display: block;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 14px;
}

@media (min-width: 560px) {
    .field-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Payment options --- */

.pay-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 560px) {
    .pay-options {
        grid-template-columns: 1fr 1fr;
    }
}

.pay-option {
    position: relative;
    display: block;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.pay-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pay-name {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.pay-desc {
    display: block;
    font-size: 0.82rem;
    color: var(--ink-soft);
    font-weight: 300;
}

.pay-option:hover {
    border-color: var(--green);
}

.pay-option:has(input:checked) {
    border-color: var(--green);
    background: var(--sage);
    box-shadow: 0 0 0 1.5px var(--green) inset;
}

#payError {
    margin: 8px 2px 0;
}

/* --- GCash box --- */

.gcash-box {
    margin-top: 14px;
    padding: 16px;
    background: var(--gold-soft);
    border: 1.5px dashed rgba(143, 109, 16, 0.45);
    border-radius: var(--radius-sm);
}

.gcash-note {
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-weight: 300;
    margin-bottom: 10px;
}

.gcash-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.gcash-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
    min-width: 64px;
}

.gcash-qr-link {
    display: inline-block;
    margin: 4px 0 12px;
    color: var(--gold-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.gcash-box .field {
    margin: 12px 0 10px;
}

/* --- Order summary --- */

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 5px 0;
    font-size: 0.94rem;
}

.summary-row .muted {
    color: var(--ink-soft);
    font-weight: 300;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1.5px solid var(--line);
    font-weight: 600;
    font-size: 1.1rem;
}

.summary-total .amount {
    color: var(--gold-dark);
}

.form-error {
    background: #fbeae7;
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 14px;
}

#checkoutForm .btn-block {
    margin-bottom: 8px;
}

/* ==========================================================================
   Order confirmation
   ========================================================================== */

.confirm-overlay {
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.confirm-card {
    width: min(440px, 100%);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 36px 28px calc(30px + env(safe-area-inset-bottom));
    text-align: center;
    transform: scale(0.94);
    transition: transform 0.28s ease;
}

.confirm-overlay.open .confirm-card {
    transform: scale(1);
}

.confirm-check {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--sage);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-check svg {
    width: 32px;
    height: 32px;
}

.confirm-title {
    font-size: 2.1rem;
    margin-bottom: 8px;
}

.confirm-sub {
    color: var(--ink-soft);
    font-weight: 300;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.order-id-label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.order-id-pill {
    display: inline-block;
    background: var(--green);
    color: #fff;
    border-radius: 999px;
    padding: 10px 24px;
    font-weight: 600;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    margin-bottom: 22px;
}

.confirm-details {
    text-align: left;
    margin: 0 0 24px;
    padding: 16px 18px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.confirm-details .detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    font-size: 0.92rem;
}

.confirm-details dt {
    color: var(--ink-soft);
    font-weight: 300;
    flex: none;
}

.confirm-details dd {
    margin: 0;
    font-weight: 500;
    text-align: right;
}

.confirm-details ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 16px);
    z-index: 90;
    background: var(--green-dark);
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: calc(100vw - 40px);
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Keep the toast above the mobile cart bar */
@media (max-width: 719px) {
    .toast {
        bottom: 96px;
    }
}

/* ==========================================================================
   Floating mobile cart bar (thumb-friendly "View Cart" pill)
   ========================================================================== */

.mobile-cart-bar {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 55;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    padding: 15px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 28px rgba(23, 73, 58, 0.45);
    cursor: pointer;
    animation: barIn 0.25s ease;
    transition: background-color 0.2s ease, transform 0.12s ease;
}

.mobile-cart-bar:active {
    transform: scale(0.98);
    background: var(--green-dark);
}

.mcb-count {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mcb-label {
    flex: 1;
    text-align: left;
}

.mcb-total {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@keyframes barIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Desktop keeps the header cart button only */
@media (min-width: 720px) {
    .mobile-cart-bar {
        display: none;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    text-align: center;
    padding: 44px 20px calc(52px + env(safe-area-inset-bottom));
    color: var(--ink-soft);
    font-weight: 300;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
}

.footer-note {
    font-size: 0.85rem;
    margin-top: 4px;
    color: var(--gold-dark);
}

.footer-contact {
    font-size: 0.85rem;
    margin-top: 10px;
    color: var(--ink-soft);
}

.footer-contact a {
    color: var(--green);
    font-weight: 500;
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-tel {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--green);
    font-weight: 500;
    text-decoration: none;
}

.footer-tel:hover {
    text-decoration: underline;
}

.footer-fb {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--gold-dark);
    font-weight: 500;
    text-decoration: none;
}

.footer-fb:hover {
    text-decoration: underline;
}

.staff-link {
    display: inline-block;
    margin-top: 18px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(124, 117, 104, 0.55);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease;
}

.staff-link:hover {
    color: var(--ink-soft);
    border-bottom-color: var(--ink-soft);
}

/* ==========================================================================
   Keyboard focus rings
   ========================================================================== */

.btn:focus-visible,
.chip:focus-visible,
.add-btn:focus-visible,
.step-btn:focus-visible,
.icon-btn:focus-visible,
.cart-btn:focus-visible,
.mobile-cart-bar:focus-visible,
.cart-remove:focus-visible,
.gcash-qr-link:focus-visible,
.staff-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(65, 96, 78, 0.3);
}

.product-card:focus-visible {
    outline: 3px solid rgba(31, 99, 80, 0.55);
    outline-offset: 3px;
}
