/* CityKirana Custom Styles */

:root {
    --primary-color: #198754;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Mobile-first: Large touch-friendly buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 350px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Category Cards */
.category-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.category-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.category-card .card-body {
    padding: 1rem;
}

.category-card h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--dark-color);
}

/* Product Cards */
.product-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card .card-body {
    padding: 1.25rem;
}

.product-card .product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    min-height: 2.5rem;
}

.product-card .product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-card .product-unit {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.product-card .stock-badge {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* Search and Filter Section */
.search-filter-section {
    background: var(--light-color);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
    border-radius: 25px;
    border: 2px solid #dee2e6;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

/* Cart Page */
.cart-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-summary {
    background: var(--light-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky;
    top: 80px;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-control button {
    background: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: background 0.2s;
}

.quantity-control button:hover {
    background: var(--light-color);
}

.quantity-control input {
    border: none;
    width: 60px;
    text-align: center;
    font-weight: 600;
    padding: 0.5rem;
}

/* Order Status Badge */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-confirmed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-out_for_delivery {
    background: #cce5ff;
    color: #004085;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Payment Method Cards */
.payment-method {
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.payment-method:hover {
    border-color: var(--primary-color);
    background: #f0f9f4;
}

.payment-method.active {
    border-color: var(--primary-color);
    background: #f0f9f4;
}

.payment-method input[type="radio"] {
    width: 20px;
    height: 20px;
}

/* Address Card */
.address-card {
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.address-card:hover {
    border-color: var(--primary-color);
    background: #f0f9f4;
}

.address-card.active {
    border-color: var(--primary-color);
    background: #f0f9f4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .product-card img {
        height: 180px;
    }

    .cart-item {
        flex-direction: column;
    }

    .cart-item img {
        width: 100%;
        height: 150px;
        margin-bottom: 1rem;
    }

    .cart-summary {
        position: static;
        margin-top: 2rem;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

/* Navbar adjustments for mobile */
@media (max-width: 991px) {
    .navbar-nav {
        padding: 1rem 0;
    }

    .navbar-nav .nav-item {
        padding: 0.5rem 0;
    }
}

/* Admin Panel Styles */
.admin-sidebar {
    background: var(--dark-color);
    min-height: calc(100vh - 56px);
    padding: 1.5rem 0;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link i {
    margin-right: 0.5rem;
}

/* Mobile admin sidebar */
@media (max-width: 767.98px) {
    .admin-sidebar {
        min-height: auto;
        width: 100%;
        position: relative;
        z-index: 100;
    }

    .admin-sidebar .nav-link {
        padding: 1rem 1.5rem;
        font-size: 1.05rem;
    }

    /* Dashboard stats cards - 2 per row on mobile */
    .stats-card {
        padding: 1rem;
    }

    .stats-card h3 {
        font-size: 1.5rem;
    }

    /* Page titles */
    h1.mb-4,
    h1 {
        font-size: 1.5rem;
    }

    /* Tables - make scrollable and readable */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    /* Order cards on mobile */
    .order-card .card-header .row {
        flex-direction: column;
    }

    .order-card .card-header .col-md-6.text-md-end {
        text-align: left !important;
        margin-top: 0.25rem;
    }

    /* Forms on mobile */
    .form-select,
    .form-control {
        font-size: 16px;
        /* Prevent iOS zoom on input focus */
    }

    /* Status update form on mobile */
    .d-flex.gap-2.align-items-center {
        flex-wrap: wrap;
    }

    /* Cards */
    .card-body {
        padding: 1rem;
    }

    /* Search bar */
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .d-flex.gap-2 .input-group {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Admin navbar buttons */
    .navbar .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Container fluid padding */
    .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Stats Cards */
.stats-card {
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
}

/* Table Responsive */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: var(--light-color);
}