/* Global Typography Refinement for SaaS-Grade UI */
body {
    font-size: 0.9rem !important; /* Slightly smaller base (14.4px) */
    line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 {
    font-weight: 700 !important;
    letter-spacing: -0.01em;
}
h6 { font-size: 0.875rem !important; }
h5 { font-size: 1rem !important; }
p { font-size: 0.875rem !important; }

.cart-toast-wrap {
    position: fixed;
    bottom: 50px;
    left: 0;
    width: 100%;
    z-index: 10000;
    color: #fff;
    padding: 12px 20px;
    display: none;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}
.cart-toast-wrap .toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cart-toast-wrap #toastTimer {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    background: rgba(255,255,255,0.2);
}

/* SaaS Grade Product Card v3.3 (INR Theme & Brand Sync) */
.card.product-card {
    border: none !important;
    border-radius: 12px !important; 
    background: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-thumbnail-wrap {
    position: relative;
    background: #fefefe;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 170px;
}
.product-thumbnail-wrap img {
    height: 140px !important;
    width: auto !important;
    object-fit: contain;
    transition: transform 0.5s ease;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.08));
}
.card.product-card:hover .product-thumbnail-wrap img {
    transform: scale(1.1);
}
.product-card .badge-left, .product-card .badge-right {
    position: absolute;
    top: 8px;
    z-index: 10;
    padding: 2px 8px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 6px;
}
.badge-left {
    left: 8px;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(4px);
    color: #475569 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.badge-right {
    right: 8px;
    background: #ff4757 !important;
    color: #fff !important;
}
.product-card .card-body {
    padding: 8px 10px !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.product-card .product-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 4px !important;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.product-card .price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.product-card .sale-price {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #00b894 !important; /* Brand Green */
}
.product-card .sale-price span {
    font-size: 9px !important;
    color: #94a3b8 !important;
}
.product-card .btn-add-cart {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    background: #00b894 !important; /* Matched to Price Color (Brand Green) */
    color: #ffffff !important; /* Switch to white for better contrast on solid green */
    border: none;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,184,148,0.2);
}
.product-card .btn-add-cart i {
    color: #ffffff !important;
}
.product-card .btn-add-cart:active {
    transform: scale(0.9);
}

/* --- Lush Glass Auth UX v4.1 --- */
.auth-wrapper-lush {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper-lush::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 184, 148, 0.1) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.auth-wrapper-lush::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 184, 148, 0.05) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    border-radius: 50%;
}

.glass-auth-card {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05) !important;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    z-index: 10;
}

.auth-brand-logo {
    width: 90px;
    height: 90px;
    background: #fff;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(0, 184, 148, 0.1);
}

.auth-brand-logo img {
    width: 60px;
}

.auth-title {
    font-size: 1.5rem !important;
    color: #1a202c !important;
    margin-bottom: 8px !important;
}

.auth-subtitle {
    font-size: 0.875rem !important;
    color: #718096 !important;
    margin-bottom: 30px !important;
}

.lush-form-group {
    margin-bottom: 18px;
    position: relative;
}

.lush-form-group .form-control {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1.5px solid #edf2f7 !important;
    border-radius: 14px !important;
    padding: 12px 16px 12px 45px !important;
    height: auto !important;
    font-size: 0.95rem !important;
    color: #2d3748 !important;
    transition: all 0.3s ease !important;
}

.lush-form-group .form-control:focus {
    background: #fff !important;
    border-color: #00b894 !important;
    box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.1) !important;
}

.lush-form-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.lush-form-group .form-control:focus + i {
    color: #00b894;
}


.btn-lush-submit {
    background: linear-gradient(135deg, #00b894 0%, #00a382 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 14px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 10px 20px rgba(0, 184, 148, 0.3) !important;
    transition: all 0.3s ease !important;
}

.btn-lush-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 184, 148, 0.4) !important;
}

.btn-lush-submit:active {
    transform: translateY(0);
}

.auth-footer {
    margin-top: 25px;
    text-align: center;
    border-top: 1px solid #edf2f7;
    padding-top: 20px;
}

.auth-footer p {
    color: #718096 !important;
    font-size: 0.875rem !important;
}

.auth-footer a {
    color: #00b894 !important;
    font-weight: 700 !important;
}

.auth-footer .guest-link {
    display: inline-block;
    margin-top: 12px;
    color: #a0aec0 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.animate-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Quantity Selection Bottom Sheet (Lush Glass) --- */
.qty-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: flex-end; /* Bottom alignment */
    justify-content: center;
}

.qty-modal-card {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(25px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 32px 32px 0 0 !important; /* Top rounded only */
    width: 100%;
    max-width: 500px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1);
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.qty-modal-overlay.active {
    display: flex;
}

.qty-modal-overlay.active .qty-modal-card {
    transform: translateY(0);
}

.qty-drag-handle {
    width: 40px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    margin: 12px auto 0;
}

.qty-header {
    background: transparent;
    padding: 20px 20px 10px;
    text-align: center;
}

.qty-header h5 {
    color: #1e293b !important;
    margin: 0;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
}

.qty-header p {
    color: #64748b !important;
    font-size: 0.85rem;
    margin: 4px 0 0;
    font-weight: 600;
}


/* --- Magnetic Fluid Stepper UX v5.0 --- */
.qty-ticker-wrapper {
    text-align: center;
    padding: 10px 20px 25px;
}

.qty-display-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    margin-top: 10px;
}

.step-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    user-select: none;
}

.step-btn:hover {
    border-color: #00b894;
    color: #00b894;
}

.step-btn:active {
    transform: scale(0.9);
}

.qty-display-main {
    background: rgba(0, 184, 148, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px solid #00b894;
    box-shadow: 0 15px 35px rgba(0, 184, 148, 0.15);
    position: relative;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 15px 35px rgba(0, 184, 148, 0.15); }
    50% { box-shadow: 0 15px 45px rgba(0, 184, 148, 0.25); }
    100% { box-shadow: 0 15px 35px rgba(0, 184, 148, 0.15); }
}

.qty-display-main #mainQtyVal {
    font-size: 2.1rem;
    font-weight: 900;
    color: #00b894;
    line-height: 1;
}

.qty-display-main #mainQtyUnit {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 800;
    color: #64748b;
    margin-top: 4px;
}

.qty-display-main .price-tag-badge {
    position: absolute;
    bottom: -15px;
    background: #1e293b;
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.preset-ticker-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.preset-ticker {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.preset-ticker::-webkit-scrollbar { display: none; }

.preset-pill {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.preset-pill.active {
    background: #00b894 !important;
    color: #fff !important;
    border-color: #00b894 !important;
    box-shadow: 0 4px 10px rgba(0, 184, 148, 0.25);
}

.qty-footer {
    padding: 15px 25px 25px;
    background: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.btn-confirm-qty {
    background: #00b894 !important; /* Brand Green from product.php */
    color: #fff !important;
    width: 100%;
    border-radius: 0.5rem !important; /* Consistency: Same as product.php */
    padding: 12px 16px !important;
    font-weight: 700 !important;
    font-size: 13px !important; /* Consistency: Same as product.php */
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.2) !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.2px;
    transition: all 0.25s ease !important;
    text-transform: capitalize; /* More natural like product.php */
}

.btn-confirm-qty i {
    font-size: 16px;
    color: #fff; /* White icon for better contrast on green */
}

.btn-confirm-qty:active {
    transform: scale(0.98);
}

/* ===== PHASE B: DISTANCE-BASED DELIVERY UI ===== */

/* Distance Badge Color Coding System */
.distance-badge {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 5px 10px !important;
    display: inline-block !important;
    border-radius: 20px !important;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Free Delivery Tier (0-5km) - Green */
.distance-badge-free {
    background-color: #00b894 !important;
    color: white !important;
}

/* Economy Tier (5-10km) - Golden Yellow */
.distance-badge-economy {
    background-color: #fdcb6e !important;
    color: #333 !important;
    font-weight: 700 !important;
}

/* Standard Tier (10-15km) - Warm Orange */
.distance-badge-standard {
    background-color: #e17055 !important;
    color: white !important;
}

/* Out of Range (>15km) - Red */
.distance-badge-outofrange {
    background-color: #d63031 !important;
    color: white !important;
}

/* Error/Invalid Location - Gray */
.distance-badge-error {
    background-color: #636e72 !important;
    color: white !important;
}

/* Delivery Fee Display */
.delivery-fee-line {
    display: block;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #2d3436;
    margin-top: 6px;
    letter-spacing: 0.3px;
}

.delivery-fee-free {
    color: #00b894 !important;
}

.delivery-fee-economy {
    color: #e17055 !important;
}

.delivery-fee-standard {
    color: #d63031 !important;
}

/* Address Out of Range Warning */
.address-distance-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
    margin-top: 8px;
    font-size: 11px;
    color: #856404;
    font-weight: 600;
    border-radius: 4px;
    line-height: 1.3;
}

.address-distance-warning i {
    font-size: 13px;
    flex-shrink: 0;
}

/* Distance Badge Animation */
.distance-badge {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive adjustments for mobile */
@media (max-width: 576px) {
    .distance-badge {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }
    
    .delivery-fee-line {
        font-size: 11px !important;
    }
    
    .address-distance-warning {
        font-size: 10px !important;
        padding: 6px 8px;
    }
}
