/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --green: #1b8f3a;
    --green-dark: #147230;
    --leaf: #cde97a;
    --sand: #f8f5ef;
    --ink: #18222c;
    --muted: #6b7280;
    --card: #ffffff;
    --chip: #eef3ef;
    --shadow: 0 16px 40px rgba(24, 34, 44, 0.08);
}

body {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--sand);
    background-image:
        radial-gradient(circle at 10% 10%, rgba(205, 233, 122, 0.25), transparent 40%),
        radial-gradient(circle at 90% 20%, rgba(27, 143, 58, 0.12), transparent 45%);
}

h1, h2, h3,
.brand-mark,
.brand-title {
    font-family: 'Fraunces', serif;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(24, 34, 44, 0.08);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-block {
    display: flex;
    flex-direction: column;
}

.brand-mark {
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(24, 34, 44, 0.1);
    background: #fff;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--ink);
}

.text-link {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-pill {
    background: var(--green);
    color: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
}

.cart-pill span {
    background: #fff;
    color: var(--green-dark);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Search & Chips */
.search-panel {
    margin: 1.2rem 0 0.6rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fff;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow);
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    background: transparent;
}

.search-icon {
    color: var(--muted);
    font-size: 1.1rem;
}

.category-strip {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.5rem 0 1rem;
    scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
    display: none;
}

.chip-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.chip {
    padding: 0.45rem 0.9rem;
    background: var(--chip);
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--ink);
    white-space: nowrap;
}

.chip.active {
    background: #fff;
    border-color: var(--green);
    color: var(--green-dark);
}

/* Product List */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0 4.5rem;
}

.product-row {
    background: var(--card);
    border-radius: 18px;
    padding: 0.85rem;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 0.9rem;
    align-items: center;
    box-shadow: var(--shadow);
    animation: fadeUp 320ms ease both;
}

.product-row.out-of-stock {
    opacity: 0.7;
}

.product-thumb-wrap {
    position: relative;
}

.product-thumb {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    object-fit: cover;
    background: #f1f3f5;
}

.fav-tag {
    position: absolute;
    bottom: -6px;
    left: 6px;
    background: #ffe6a7;
    color: #7a4a00;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.product-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.product-top {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: flex-start;
}

.product-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.product-price {
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
}

.product-description {
    font-size: 0.85rem;
    color: var(--muted);
}

.product-meta {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    align-items: center;
}

.product-chip {
    background: var(--chip);
    color: var(--muted);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.stock-info {
    font-size: 0.75rem;
    color: var(--green-dark);
    font-weight: 600;
}

.add-pill {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: var(--green);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.add-pill.disabled {
    background: #b8c2b0;
    cursor: not-allowed;
    font-size: 0.75rem;
}

/* Secondary button for "Back" / neutral actions */
.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1rem;
    min-height: 44px;
    background: #fff;
    color: var(--ink);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.15s, border-color 0.15s, transform 0.08s;
    text-align: center;
}

.btn-secondary:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.btn-secondary:active {
    transform: translateY(1px);
}

.btn-secondary:disabled,
.btn-secondary.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus for accessibility */
.btn-secondary:focus {
    outline: 3px solid rgba(27, 143, 58, 0.18);
    outline-offset: 2px;
}

/* Cart / Checkout UI */
.cart-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    align-items: stretch;
}

.cart-left {
    display: flex;
    gap: 0.75rem;
    align-items:center;      /* center vertically */
    justify-content: flex-start; /* align to left */
}

.cart-thumb {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f0f0;
}

.cart-meta {
    min-width: 0;
    text-align: left;         /* force name & unit price to align left */
}

.cart-item-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.98rem;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    text-align: left;         /* ensure multi-line name is left aligned */
}

.cart-unit-price {
    color: #7f8c8d;
    font-size: 0.88rem;
}

.cart-right {
    width: 100%;
}

.cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f7f7f7;
    padding: 4px;
    border-radius: 8px;
}

.qty-btn {
    min-width: 40px;
    min-height: 40px;
    height: 40px;
    width: 40px;
    border: none;
    background: #fff;
    border-radius: 6px;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.qty-value {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
}

.cart-subtotal {
    font-weight: 800;
    color: #222;
    white-space: nowrap;
    margin-left: auto;
}

.btn-remove {
    border: none;
    background: transparent;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 8px;
}

.btn-remove.btn-remove-big {
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Checkout Page */
.checkout-wrapper {
    min-height: calc(100vh - 160px); /* leave space for header/footer */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    box-sizing: border-box;
    background-color: transparent;
}

/* Inner card: constrain width and keep white card styling */
.checkoutRoot {
    width: 100%;
    max-width: 980px;
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    box-sizing: border-box;
}

/* Desktop: allow two-column layout inside the card (summary sidebar) */
@media (min-width: 1000px) {
    .checkoutRoot {
        display: grid;
        grid-template-columns: 1fr 360px;
        gap: 1.5rem;
        align-items: start;
    }
}

@media (max-width: 768px) {
    .checkout-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.25rem 0;
    }
    .product-image {
        aspect-ratio: 4/4;
    }
}


@media (min-width: 601px) and (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-image {
        aspect-ratio: 10/16;
    }
}


@media (min-width: 901px) {
    .products-grid {
        gap: 1.5rem;
        grid-auto-rows: auto;
    }
}

.checkoutRoot,
.order-summary,
.customer-info,
.payment-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.checkoutRoot h2,
.order-summary h2,
.customer-info h2,
.payment-info h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.cart-item-quantity {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.cart-item-price {
    font-weight: bold;
    color: #27ae60;
}

.total-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #2c3e50;
    font-size: 1.2rem;
    text-align: right;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--ink);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green);
}

.field-note {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.field-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.field-error + .field-note {
    color: #b91c1c;
    font-weight: 600;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #229954;
}

/* Payment Info */
.payment-details {
    margin-bottom: 1.5rem;
}

.payment-method {
    margin-bottom: 1rem;
}

.payment-details p {
    margin: 0.5rem 0;
}

.qris-image {
    text-align: center;
    margin-top: 1rem;
}

.qris-image img {
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Success Page */
.success-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.success-card {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: #27ae60;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
}

.success-card h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.success-card p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.order-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.order-info p {
    margin: 0.5rem 0;
    color: #2c3e50;
}

.success-actions {
    margin-top: 2rem;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.empty-state.compact {
    padding: 1.5rem;
}

.empty-state h2 {
    margin-bottom: 1rem;
}
.product-card.out-of-stock .product-image {
    filter: grayscale(100%);
    opacity: 0.75;
}

/* cart icon bump animation used after add-to-cart flight */
.cart-bump {
    animation: cart-bump 360ms ease;
}
@keyframes cart-bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* Accessibility / spacing */
.qty-btn:focus, .btn-remove:focus {
    outline: 2px solid rgba(52,152,219,0.35);
    outline-offset: 2px;
}

/* Ensure compact but not cramped on small screens */
@media (max-width: 420px) {
    /* Make actions inline on small screens: qty | subtotal | remove */
    .cart-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .qty-controls {
        order: 1;
        flex: 0 0 auto;
    }

    .cart-subtotal {
        order: 2;
        flex: 1 1 auto;
        margin-top: 0;
        text-align: right;
        white-space: nowrap;
        font-weight: 800;
    }

    .btn-remove.btn-remove-big {
        order: 3;
        margin-left: 8px;
        flex: 0 0 auto;
    }
}

/* Ensure image + name are left-aligned and vertically centered */
.cart-left {
    display: flex;
    gap: 0.75rem;
    align-items: center;      /* center vertically */
    justify-content: flex-start; /* align to left */
}

.cart-meta {
    min-width: 0;
    text-align: left;         /* force name & unit price to align left */
}

.cart-item-name {
    text-align: left;         /* ensure multi-line name is left aligned */
}

/* On desktop keep left block stretched to left and actions to the right */
@media (min-width: 900px) {
    .cart-left {
        align-items: center;
        justify-content: flex-start;
    }
}

/* Spacing between "Dikirim" and "Diambil" buttons */
.delivery-actions {
    display: flex;
    gap: 12px;              /* space between buttons */
    align-items: center;
    justify-content: flex-start;
    margin-top: 8px;
}

/* Make delivery buttons grow equally and comfortable tap area on mobile */
.delivery-actions > .delivery-btn {
    flex: 1 1 0;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
}

/* Stack vertically on small screens */
@media (max-width: 420px) {
    .delivery-actions {
        flex-direction: column;
        gap: 10px;
    }
    .delivery-actions > .delivery-btn {
        width: 100%;
    }
}

    /* Layout helpers */
    .page-stack {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 0 2.5rem;
    }

    .card {
        background: var(--card);
        border-radius: 18px;
        padding: 1rem;
        box-shadow: var(--shadow);
    }

    .field-label {
        display: block;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    .field-input {
        width: 100%;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 0.75rem 0.9rem;
        font-family: inherit;
    }

    .summary-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.6rem;
        font-weight: 600;
    }

    .summary-row.muted {
        color: var(--muted);
        font-weight: 500;
    }

    .summary-row.total {
        font-size: 1.05rem;
        border-top: 1px dashed #e5e7eb;
        padding-top: 0.75rem;
    }

    .section-note {
        margin-top: 0.75rem;
        font-size: 0.85rem;
        color: var(--muted);
    }

    /* Cart list adjustments */
    .cart-list .cart-item {
        border-bottom: 1px dashed #e5e7eb;
    }

    .cart-list .cart-item:last-child {
        border-bottom: none;
    }

    /* Bottom cart bar */
    .cart-bar {
        position: fixed;
        left: 50%;
        transform: translateX(-50%) translateY(120%);
        bottom: 16px;
        width: min(560px, calc(100% - 32px));
        background: #0f3d22;
        color: #fff;
        border-radius: 18px;
        padding: 0.85rem 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 18px 36px rgba(10, 35, 20, 0.25);
        transition: transform 220ms ease;
        z-index: 120;
    }

    .cart-bar.visible {
        transform: translateX(-50%) translateY(0);
    }

    .cart-bar-left {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .cart-bar-title {
        font-weight: 700;
        font-size: 0.95rem;
    }

    .cart-bar-subtitle {
        font-size: 0.85rem;
        color: #d8f2c4;
    }

    .cart-bar-btn {
        background: #fff;
        color: #0f3d22;
        padding: 0.55rem 1rem;
        border-radius: 999px;
        text-decoration: none;
        font-weight: 700;
        font-size: 0.9rem;
    }

    /* Orders page */
    .orders-list {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
    }

    .order-card {
        border: 1px solid #edf0f2;
        border-radius: 14px;
        padding: 0.9rem 1rem;
        background: #fff;
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }

    .order-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .order-id {
        font-weight: 700;
    }

    .order-time {
        font-size: 0.8rem;
        color: var(--muted);
    }

    .order-status {
        font-size: 0.75rem;
        font-weight: 700;
        padding: 0.2rem 0.6rem;
        border-radius: 999px;
        background: #ecfdf3;
        color: #15803d;
    }

    .order-status.PENDING { background: #fef9c3; color: #854d0e; }
    .order-status.COOKING { background: #fee2e2; color: #991b1b; }
    .order-status.READY { background: #e0f2fe; color: #0369a1; }
    .order-status.COMPLETED { background: #dcfce7; color: #166534; }

    .order-summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 600;
    }

    .order-link {
        border: none;
        background: transparent;
        color: var(--green-dark);
        font-weight: 600;
        cursor: pointer;
        text-align: left;
        padding: 0;
    }

    /* Checkout steps */
    .checkout-step {
        background: #fff;
        border-radius: 18px;
        padding: 1rem;
        box-shadow: var(--shadow);
        margin-bottom: 1rem;
    }

    .checkout-step h2 {
        font-size: 1.1rem;
    }

    .checkout-wrapper {
        align-items: flex-start;
        padding-top: 1.5rem;
    }

    .checkout-root {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .checkout-card h2 {
        margin-bottom: 0.8rem;
    }

    .toggle-group {
        display: flex;
        gap: 0.75rem;
        margin-top: 0.5rem;
    }

    .toggle-btn {
        flex: 1 1 0;
        border: 1px solid #e5e7eb;
        background: #f9fafb;
        border-radius: 12px;
        padding: 0.7rem 0.9rem;
        font-weight: 600;
        cursor: pointer;
        color: var(--ink);
    }

    .toggle-btn.active {
        background: #e8f5eb;
        border-color: var(--green);
        color: var(--green-dark);
    }

    .inline-input {
        display: flex;
        gap: 0.6rem;
        align-items: center;
    }

    .inline-input input {
        flex: 1 1 auto;
    }

    @media (max-width: 520px) {
        .toggle-group {
            flex-direction: column;
        }
        .inline-input {
            flex-direction: column;
            align-items: stretch;
        }
    }

    /* Success page */
    .success-card-modern {
        background: #fff;
        border-radius: 22px;
        box-shadow: var(--shadow);
    }

    .success-actions {
        display: grid;
        gap: 0.6rem;
    }

    .success-actions .btn-secondary {
        width: 100%;
    }

    /* Buttons */
    .btn-primary {
        background-color: var(--green);
    }

    .btn-primary:hover {
        background-color: var(--green-dark);
    }

    /* Animations */
    @keyframes fadeUp {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

.form-actions {
    display: flex;
    gap: 12px;              /* space between buttons */
    align-items: center;
    justify-content: flex-end; /* adjust alignment as needed */
    margin-top: 12px;
    flex-wrap: wrap;        /* allow wrapping on small widths */
}

/* Make buttons full width stacked on very small screens */
@media (max-width: 420px) {
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .form-actions > button {
        width: 100%;
    }
}

/* Ensure textarea in forms is comfortable and multiline */
.form-group textarea {
    min-height: 72px;
    resize: vertical;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    width: 100%;
}

/* Summary total card (mobile-first, clean & prominent) */
.summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(20,20,20,0.04);
    margin-top: 12px;
}

/* Label area (left) */
.summary-total > div:first-child {
    color: #495057;
    font-weight: 600;
    font-size: 0.98rem;
}

/* Amount (right) — prominent */
.summary-total-amount {
    color: #16a34a; /* green */
    font-weight: 800;
    font-size: 1.1rem;
    white-space: nowrap;
    text-align: right;
}

/* Optional small helper / note under total (use .summary-note inside .summary-total) */
.summary-total .summary-note {
    display: block;
    width: 100%;
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
}

/* When summary appears as sidebar (desktop) make it sticky & slightly larger */
@media (min-width: 1000px) {
    .summary-total {
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
        border-radius: 12px;
    }
    .summary-total > div:first-child {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    .summary-total-amount {
        font-size: 1.35rem;
    }

    /* If summary container is placed in the right column, keep it visible while scrolling */
    .checkout-wrapper .summary-sidebar,
    .summary-sidebar {
        position: sticky;
        top: 16px;
        align-self: start;
    }
}

/* Tight spacing on very small screens */
@media (max-width: 420px) {
    .summary-total {
        padding: 12px;
        gap: 8px;
    }
    .summary-total-amount {
        font-size: 1rem;
    }
}

/* Read-only cart list — improved desktop layout and responsive behavior */
.cart-readonly-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.cart-readonly-item {
    display: flex;
    flex-direction: row;       /* keep items in a single row on desktop */
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(16,24,40,0.03);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

/* Left block: image + meta */
.cart-readonly-left {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0; /* allow text truncation */
    flex: 1 1 auto;
}

.cart-readonly-meta {
    min-width: 0;
}

/* Thumbnail */
.cart-readonly-item .cart-thumb {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    object-fit: cover;
    border-radius: 6px;
    background: #f6f7f8;
}

/* Name: allow up to 2 lines then ellipsis */
.cart-readonly-item .cart-item-name {
    font-weight: 700;
    font-size: 0.97rem;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* Unit price small & muted */
.cart-readonly-item .cart-unit-price {
    color: #6b7280;
    font-size: 0.88rem;
}

/* Right block: subtotal */
.cart-readonly-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
    min-width: 120px;
}

/* Subtotal emphasis */
.cart-readonly-right .cart-subtotal {
    font-weight: 800;
    color: #111827;
    font-size: 1rem;
    white-space: nowrap;
}

/* subtle hover for desktop */
.cart-readonly-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(16,24,40,0.06);
}

/* Responsive: on small screens stack vertically and keep spacing comfortable */
@media (max-width: 720px) {
    .cart-readonly-item {
        flex-direction: column;
        align-items: stretch;
    }
    .cart-readonly-left {
        align-items: center;
    }
    .cart-readonly-meta {
        text-align: center;
    }
    .cart-readonly-right {
        justify-content: space-between;
        margin-top: 8px;
        min-width: 0;
    }
    .cart-readonly-item .cart-item-name {
        -webkit-line-clamp: 2;
    }
}

/* Tighten spacing for very small screens */
@media (max-width: 420px) {
    .cart-readonly-item {
        padding: 10px;
    }
    .cart-readonly-right {
        gap: 8px;
    }
}

/* Current method info */
.current-method {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fff7e6;
    border: 1px solid #ffe5b4;
    color: #6a4a00;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Visual state for selected delivery button */
.delivery-btn.active {
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transform: translateY(-2px);
    border: 1px solid rgba(0,0,0,0.06);
}

/* ensure .delivery-btn baseline styles exist (if removed earlier) */
.delivery-actions > .delivery-btn {
    flex: 1 1 0;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

/* Map picker modal */
.map-picker-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 16px;
}
.map-picker-card {
    width: 100%;
    max-width: 920px;
    height: 80vh;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.map-picker-map { flex: 1 1 auto; min-height: 320px; }
.map-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-top: 1px solid #eee;
}
.map-picker-address { flex: 1 1 auto; color: #334155; font-size: 0.95rem; }
.map-picker-actions { display: flex; gap: 8px; }
/* Map picker locate button tweak */
.map-picker-locate-btn {
    min-width: 160px;
    background: #fff;
    border: 1px solid #ddd;
}

/* ensure modal buttons have consistent spacing */
.map-picker-header .btn-secondary {
    padding: 8px 10px;
}
