/* ==========================================================================
   Хасан Баракат — Mobile Fast Food Design System
   Color Palette: White, Clean Neutral Grays, Calm Emerald Green
   ========================================================================== */

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Green Accent Palette */
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --accent-green-dark: #047857;
    --accent-green-light: #ecfdf5;
    --accent-green-subtle: #d1fae5;
    
    --border-color: #f1f5f9;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.1), 0 10px 20px -5px rgba(15, 23, 42, 0.04);
    --shadow-sheet: 0 -10px 40px rgba(15, 23, 42, 0.12);
    
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Base Settings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
    background-color: #0f172a;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

/* Mobile-only Viewport Wrapper */
.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background-color: var(--bg-main);
    position: relative;
    padding-bottom: 95px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

/* Ripple Effect Styles */
.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Header Component */
.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 18px 12px 18px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo-icon {
    width: 40px;
    height: 40px;
    background-color: var(--accent-green-light);
    color: var(--accent-green);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.15);
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

/* Search Bar */
.search-container {
    margin-bottom: 14px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    height: 46px;
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 40px 0 44px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.search-input-wrapper input:focus {
    border-color: var(--accent-green);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    background: #e2e8f0;
    border: none;
    color: var(--text-secondary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-input-wrapper input:not(:placeholder-shown) + .search-clear-btn {
    display: flex;
}

/* Categories Horizontal Drag Navigation */
.categories-nav {
    margin: 0 -18px;
    padding: 0 18px;
}

.categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.categories-scroll:active,
.categories-scroll.dragging {
    cursor: grabbing;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-pill {
    flex-shrink: 0;
    height: 38px;
    padding: 0 18px;
    border-radius: var(--radius-full);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.category-pill:active {
    transform: scale(0.95);
}

.category-pill.active {
    background: var(--accent-green);
    color: #ffffff;
    border-color: var(--accent-green);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Main Content Layout */
.app-main {
    padding: 16px;
    flex: 1;
}

.section-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.active-category-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.product-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

/* 2-Column Grid Layout for Square / Vertical Product Cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Slightly Taller Vertical Product Card */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    user-select: none;
    min-height: 310px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(16, 185, 129, 0.2);
}

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

.product-card.clicked-flash {
    animation: cardPulse 0.3s ease;
}

@keyframes cardPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15); }
    100% { box-shadow: var(--shadow-sm); }
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    height: 140px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: #f1f5f9;
    margin-bottom: 10px;
    flex-shrink: 0;
}

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

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

.card-qty-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--accent-green);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    animation: popBadge 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popBadge {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.card-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    min-height: 28px;
}

.card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--accent-green-dark);
}

/* Card Bottom Quantity Controls (- Count + Capsule Bar) */
.card-control-wrapper {
    margin-top: auto;
    width: 100%;
}

.card-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 42px;
    background: #f8fafc;
    border-radius: 14px;
    padding: 4px;
    border: 1.5px solid #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: var(--transition-fast);
}

.card-ctrl-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.card-btn-minus {
    background: #fee2e2;
    color: #ef4444;
}

.card-btn-minus:hover:not(:disabled) {
    background: #fca5a5;
    color: #dc2626;
}

.card-btn-minus:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
    color: #cbd5e1;
}

.card-btn-plus {
    background: #ecfdf5;
    color: #10b981;
}

.card-btn-plus:hover {
    background: #d1fae5;
    color: #059669;
}

.card-btn-plus:active,
.card-btn-minus:active:not(:disabled) {
    transform: scale(0.92);
}

.card-count-num {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    flex: 1;
}

.card-count-num.muted {
    color: #94a3b8;
}

/* Empty Search State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    grid-column: 1 / -1;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 260px;
    margin: 0 auto;
}

/* Round Floating Cart Button (Bottom Right Corner Only - Badge NOT Clipped) */
.cart-fab-round {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--accent-green);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
    z-index: 60;
    transition: var(--transition-bounce);
    overflow: visible !important; /* Ensures badge overlays without clipping */
}

.cart-fab-round:hover {
    background: var(--accent-green-hover);
}

.cart-fab-round:active {
    transform: scale(0.92);
}

.cart-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444; /* Bright Red badge */
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2.5px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    z-index: 10;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-fab-badge.pop {
    transform: scale(1.3);
}

/* Bottom Sheet Modal */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sheet-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 100%);
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 28px 28px 0 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sheet);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}

.bottom-sheet.active {
    transform: translate(-50%, 0);
}

.sheet-drag-handle {
    width: 100%;
    padding: 10px 0 4px 0;
    display: flex;
    justify-content: center;
}

.drag-bar {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background-color: #cbd5e1;
}

.sheet-header {
    padding: 12px 20px 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.sheet-header-title h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.sheet-items-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.sheet-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sheet-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cart Items inside Bottom Sheet */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.cart-item-img {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.cart-item-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-green-dark);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.cart-item-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.cart-item-btn:hover {
    background: var(--accent-green-subtle);
    color: var(--accent-green-dark);
}

.cart-item-count {
    font-size: 13px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

/* Empty Cart View in Sheet */
.empty-cart-view {
    text-align: center;
    padding: 30px 10px;
}

.empty-cart-view.hidden {
    display: none;
}

.empty-cart-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-green-light);
    color: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.empty-cart-view h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-cart-view p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Checkout Form Section */
.order-form-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.form-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

#checkoutForm {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.field-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 46px;
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 12px 0 38px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.input-wrapper input:focus {
    border-color: var(--accent-green);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* Location Action Buttons Row */
.location-buttons-row {
    display: flex;
    gap: 8px;
    margin-top: -2px;
}

.loc-btn {
    flex: 1;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.loc-btn-geo {
    background: var(--accent-green-light);
    color: var(--accent-green-dark);
    border-color: rgba(16, 185, 129, 0.2);
}

.loc-btn-geo:hover {
    background: var(--accent-green-subtle);
}

.loc-btn-map {
    background: #f1f5f9;
    color: var(--text-primary);
}

.loc-btn-map:hover {
    background: #e2e8f0;
}

/* Price Summary Box */
.price-summary-box {
    background: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.free-delivery {
    color: var(--accent-green-dark);
    font-weight: 700;
}

.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 2px 0;
}

.total-line {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.total-price {
    color: var(--accent-green-dark);
}

/* Submit Button */
.submit-order-btn {
    width: 100%;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--accent-green);
    color: #ffffff;
    border: none;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
    transition: var(--transition-normal);
    margin-top: 6px;
}

.submit-order-btn:hover {
    background: var(--accent-green-hover);
}

.submit-order-btn:active {
    transform: scale(0.98);
}

/* Success Modal Overlay */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.success-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.success-card {
    background: #ffffff;
    width: 100%;
    max-width: 360px;
    border-radius: 28px;
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalBounce {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px auto;
}

.checkmark-svg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--accent-green);
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px var(--accent-green);
    animation: fill 0.4s ease-in-out .4s forwards, scale 0.3s ease-in-out .9s alternate forwards;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--accent-green);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

.success-card h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.success-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 22px;
}

.success-close-btn {
    width: 100%;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--accent-green);
    color: #ffffff;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
    transition: var(--transition-fast);
}

.success-close-btn:hover {
    background: var(--accent-green-hover);
}

/* ==========================================
   APP PRELOADER SPLASH SCREEN
   ========================================== */
.app-preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.app-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.preloader-logo-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35);
    animation: preloaderPulse 1.8s ease-in-out infinite;
}

@keyframes preloaderPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35); }
    50% { transform: scale(1.08); box-shadow: 0 16px 40px rgba(16, 185, 129, 0.5); }
}

.preloader-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.preloader-spinner {
    width: 32px;
    height: 32px;
    border: 3.5px solid #e2e8f0;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spinPreloader 0.8s linear infinite;
}

@keyframes spinPreloader {
    to { transform: rotate(360deg); }
}

/* ==========================================
   INTERACTIVE MAP MODAL OVERLAY
   ========================================== */
.map-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.map-modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.map-modal-card {
    width: 100%;
    max-width: 480px;
    height: 85vh;
    max-height: 620px;
    background: var(--bg-card);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.map-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.map-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-green-dark);
}

.map-modal-title h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.map-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: var(--text-secondary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.map-modal-close:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.map-view-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
}

#leafletMap {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
}

/* Center Marker Pin Overlay */
.map-center-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 500;
    pointer-events: none;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
    animation: pinBounce 1.5s ease-in-out infinite alternate;
}

@keyframes pinBounce {
    0% { transform: translate(-50%, -100%); }
    100% { transform: translate(-50%, -112%); }
}

.map-locate-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 500;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--accent-green-dark);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.map-locate-btn:hover {
    background: var(--accent-green-light);
}

.map-modal-footer {
    padding: 16px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-address-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.map-address-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-address-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    min-height: 36px;
}

.confirm-location-btn {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    background: var(--accent-green);
    color: #ffffff;
    border: none;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
    transition: var(--transition-fast);
}

.confirm-location-btn:hover {
    background: var(--accent-green-hover);
}
