/* ==========================================================================
   Es Mambo — Public Styles
   ========================================================================== */

/* ── Reset & Base ─────────────────────────────────────────────────────── */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f6ff;
    color: #333;
    line-height: 1.6;
    margin: 0;
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Header ────────────────────────────────────────────────────────────── */

.public-header {
    background: #2d1b69;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 20px rgba(45, 27, 105, 0.3);
}

.public-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.public-header .brand {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.3px;
    transition: opacity 0.15s;
}

.public-header .brand:hover {
    opacity: 0.85;
    color: #fff;
}

.public-header .brand-logo {
    height: 36px;
    width: auto;
    border-radius: 6px;
}

.public-header .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.15s;
    text-decoration: none;
}

.public-header .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.public-header .btn-register {
    background: #fff;
    color: #5b21b6;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.375rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.15s;
}

.public-header .btn-register:hover {
    background: #f3e8ff;
}

.public-header .cart-link {
    color: #fff;
    position: relative;
    text-decoration: none;
    padding: 0.375rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
}

.public-header .cart-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero-section {
    background: linear-gradient(135deg, #2d1b69 0%, #5b21b6 50%, #7c3aed 100%);
    color: #fff;
    padding: 4rem 1rem 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255, 255, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, #f8f6ff 0%, transparent 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 1rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero-section h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.hero-section p {
    font-size: 1.05rem;
    opacity: 0.85;
    max-width: 500px;
    margin: 0.5rem auto 0;
}

/* ── Section Title ────────────────────────────────────────────────────── */

.section-title {
    color: #2d1b69;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #c4b5fd;
    display: inline-block;
}

.section-title-sm {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7c3aed;
    margin-bottom: 0.25rem;
}

/* ── Stats ─────────────────────────────────────────────────────────────── */

.stats-row {
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.06);
    height: 100%;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
    transform: translateY(-1px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2d1b69;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
}

/* ── Menu Grid ─────────────────────────────────────────────────────────── */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.menu-card {
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.13);
}

.menu-card-img {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f3f0ff;
}

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

.menu-card:hover .menu-card-img img {
    transform: scale(1.08);
}

.menu-card-img .carousel,
.menu-card-img .carousel-inner,
.menu-card-img .carousel-item {
    height: 100%;
}

.menu-card-img .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-card-img .carousel-indicators {
    margin-bottom: 0.25rem;
}

.menu-card-img .carousel-indicators button {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.5);
}

.menu-card-img .carousel-indicators button.active {
    background: #fff;
}

.menu-card-img .carousel-control-prev,
.menu-card-img .carousel-control-next {
    width: 18%;
}

.menu-card-img .carousel-control-prev-icon,
.menu-card-img .carousel-control-next-icon {
    width: 18px;
    height: 18px;
}

.card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-unavailable {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    font-size: 0.7rem;
    font-weight: 600;
}

.menu-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.menu-card-body h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d1b69;
    margin: 0;
    line-height: 1.3;
}

.menu-card-body .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #7c3aed;
}

.menu-card-body .btn-order {
    display: inline-block;
    width: 100%;
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
    border: none;
    border-radius: 0.5rem;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.menu-card-body .btn-order:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
    text-decoration: none;
}

.menu-card-body .btn-order:active {
    transform: scale(0.97);
}

.menu-card-body .btn-order.disabled {
    background: #adb5bd;
    box-shadow: none;
    pointer-events: none;
    cursor: not-allowed;
}

.menu-card-body .qty-input {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    padding: 0.25rem;
}

.menu-card.card-disabled {
    opacity: 0.55;
    filter: grayscale(0.4);
}

.menu-card.card-disabled .price {
    color: #999;
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.public-footer {
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    font-size: 0.85rem;
}

.public-footer a {
    color: #aa7ed6;
    text-decoration: none;
}

.public-footer a:hover {
    color: #c4b5fd;
}

/* ── Empty State ───────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: #888;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ── Featured Banner ───────────────────────────────────────────────────── */

.featured-banner {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    border-radius: 1rem;
    padding: 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.featured-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
}

.featured-banner h3 {
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.featured-banner p {
    opacity: 0.9;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.featured-banner .btn-wa {
    background: #25D366;
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
    transition: opacity 0.15s;
}

.featured-banner .btn-wa:hover {
    opacity: 0.9;
    color: #fff;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 576px) {
    .hero-section {
        padding: 2.5rem 1rem 2rem;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .hero-section p {
        font-size: 0.9rem;
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .menu-card-img {
        height: 130px;
    }

    .menu-card-body {
        padding: 0.65rem;
    }

    .menu-card-body h3 {
        font-size: 0.8rem;
    }

    .menu-card-body .price {
        font-size: 0.95rem;
    }

    .menu-card-body .btn-order {
        font-size: 0.78rem;
        padding: 0.35rem 0.5rem;
    }

    .menu-card-body .qty-input {
        max-width: 44px !important;
        font-size: 0.78rem;
    }

    .stat-card {
        padding: 0.65rem 0.75rem;
        gap: 0.5rem;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .featured-banner {
        padding: 1.5rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.85rem;
    }
}

/* ── Marker Labels (shared: checkout + profile) ──────────────────────── */

.store-marker-label {
    background: #7c3aed;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 2px solid #fff;
}

.user-marker-label {
    background: #2563eb;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 2px solid #fff;
}

/* ── Checkout ─────────────────────────────────────────────────────────── */

.checkout-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.checkout-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkout-card h5 {
    color: #4c1d95;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #aa7ed6;
}

#map {
    height: 300px;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    z-index: 1;
}

/* ── Map Search (autocomplete) ───────────────────────────────────────── */

.map-search {
    z-index: 1000;
}

.map-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2000;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
}

.map-search-results .result-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid #f3f0ff;
}

.map-search-results .result-item:last-child {
    border-bottom: none;
}

.map-search-results .result-item:hover {
    background: #f5f3ff;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f0ff;
}

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

.cart-item .info {
    flex: 1;
}

.cart-item .info h6 {
    margin: 0;
    font-weight: 600;
}

.cart-item .info .price {
    color: #7c3aed;
    font-weight: 700;
}

.cart-item .qty-input {
    width: 60px;
    text-align: center;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

.cart-empty svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.pengiriman-options {
    display: flex;
    gap: 1rem;
}

.pengiriman-options .form-check {
    flex: 1;
}

.pengiriman-options .form-check .card-radio {
    display: block;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pengiriman-options .form-check .card-radio:hover {
    border-color: #aa7ed6;
}

.pengiriman-options .form-check .card-radio.selected {
    border-color: #7c3aed;
    background: #f5f3ff;
}

.pengiriman-options .form-check .card-radio svg {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
    color: #7c3aed;
}

.btn-checkout {
    background: #7c3aed;
    color: #fff;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    width: 100%;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.btn-checkout:hover {
    background: #6d28d9;
    color: #fff;
}

.btn-checkout:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc2626;
    padding: 0.25rem;
    cursor: pointer;
}

.location-status {
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 0.4rem;
    margin-bottom: 0.75rem;
}

.location-status.loading {
    background: #fff3cd;
    color: #856404;
}

.location-status.success {
    background: #d1e7dd;
    color: #0f5132;
}

.location-status.error {
    background: #f8d7da;
    color: #842029;
}

.distance-info {
    background: #f5f3ff;
    border: 1px solid #aa7ed6;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.distance-info strong {
    color: #7c3aed;
}

/* ── Print ──────────────────────────────────────────────────────────────── */

@media print {
    .public-header,
    .public-footer,
    .hero-section::after,
    .cart-float {
        display: none;
    }
}

/* ── Qty Stepper ─────────────────────────────────────────────────────── */

.qty-stepper .qty-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #7c3aed;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
}

.qty-stepper .qty-btn:hover {
    background: #f5f3ff;
    border-color: #aa7ed6;
}

@media (max-width: 576px) {
    .qty-stepper .qty-btn {
        width: 26px;
        height: 26px;
    }
}

/* ── Floating Cart ───────────────────────────────────────────────────── */

.cart-float {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #7c3aed;
    color: #fff;
    border-radius: 999px;
    padding: 0.6rem 1.1rem;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s, transform 0.15s;
}

.cart-float:hover {
    background: #6d28d9;
    color: #fff;
    transform: translateY(-2px);
}

.cart-float-count {
    background: #fff;
    color: #7c3aed;
    border-radius: 999px;
    padding: 0 0.4rem;
    font-size: 0.8rem;
    font-weight: 800;
}

/* ── Home Features ───────────────────────────────────────────────────── */

.feature-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.06);
    height: 100%;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

/* ── Payment Info (modal) ─────────────────────────────────────────────── */

.payment-box {
    background: #f8f6ff;
    border: 1px solid #e0d6ff;
    border-radius: 0.75rem;
    padding: 0.75rem;
}

.payment-box-title {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7c3aed;
    margin-bottom: 0.5rem;
}

.payment-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #ede9fe;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.payment-row:last-child {
    margin-bottom: 0;
}

.payment-chip {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.payment-row-body {
    min-width: 0;
}

.payment-provider {
    font-weight: 700;
    font-size: 0.85rem;
    color: #333;
}

.payment-account {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    color: #7c3aed;
    letter-spacing: 0.5px;
    word-break: break-all;
}

.payment-holder {
    font-size: 0.75rem;
    color: #6b7280;
}

.payment-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* ── Image Preview (lightbox) ─────────────────────────────────────────── */

.menu-card-img img {
    cursor: zoom-in;
}

.image-preview-modal .modal-content {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.image-preview-modal .btn-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    filter: invert(1);
    opacity: 1;
    z-index: 2;
}

.image-preview-modal img {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
