/* =========================================
   ArogyaMart - Global Stylesheet
   style.css
   ========================================= */

/* ── Reset & base ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    color: #333;
}

a {
    text-decoration: none;
}

/* ── Navbar ── */
.navbar {
    background: #111;
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    color: #ffffff;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-links a {
    color: #ffffff;
    font-size: 16px;
    padding: 6px 14px;
    border-radius: 5px;
    transition: background 0.2s, color 0.2s;
}

.navbar-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #00bfff;
}

.nav-user {
    color: #5DCAA5;
    font-size: 15px;
    padding: 6px 10px;
}

.nav-logout {
    color: #ff6b6b !important;
    border: 1px solid #ff6b6b;
}

.nav-logout:hover {
    background: #ff6b6b !important;
    color: #fff !important;
}

/* ── Page title ── */
.page-title {
    text-align: center;
    padding: 22px 20px;
    background: #28a745;
    color: white;
    font-size: 26px;
    letter-spacing: 1px;
}

/* ── Search box ── */
.search-box {
    text-align: center;
    margin: 24px 20px;
}

.search-box form {
    display: inline-flex;
    gap: 8px;
}

.search-box input {
    padding: 10px 16px;
    width: 280px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    outline: none;
    transition: border 0.2s;
}

.search-box input:focus {
    border-color: #28a745;
}

.search-box button {
    padding: 10px 22px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}

.search-box button:hover {
    background: #218838;
}

/* ── Products grid ── */
.products {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
    padding: 20px 30px 40px;
}

/* ── Product card ── */
.card {
    background: white;
    width: 240px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.card-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 3px 10px;
    display: inline-block;
    align-self: center;
}

.card-name {
    font-size: 16px;
    color: #222;
    font-weight: 600;
}

.card-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.card-price {
    font-size: 20px;
    color: #28a745;
    font-weight: bold;
}

/* ── Cart button ── */
.btn-cart {
    background: #007bff;
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: background 0.2s;
}

.btn-cart:hover {
    background: #0056b3;
}

/* ── No results ── */
.no-results {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 16px;
    width: 100%;
}

/* ── Auth forms (login / register) ── */
.form-container {
    max-width: 420px;
    margin: 50px auto;
    background: white;
    padding: 36px 32px;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #222;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: #444;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    outline: none;
    transition: border 0.2s;
}

.form-group input:focus {
    border-color: #28a745;
}

.btn-submit {
    width: 100%;
    padding: 11px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #218838;
}

.form-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #555;
}

.form-footer a {
    color: #28a745;
    font-weight: 500;
}

/* ── Flash messages ── */
.flash {
    max-width: 600px;
    margin: 16px auto;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.flash.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash.danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash.info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Admin dashboard ── */
.admin-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 30px 20px 10px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px 36px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 160px;
}

.stat-card h3 {
    font-size: 36px;
    margin-bottom: 6px;
}

.stat-card p {
    font-size: 14px;
    color: #777;
}

.stat-card.blue   h3 { color: #007bff; }
.stat-card.green  h3 { color: #28a745; }
.stat-card.orange h3 { color: #fd7e14; }

.admin-table {
    max-width: 900px;
    margin: 30px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.admin-table h4 {
    padding: 18px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    color: #333;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #111;
    color: white;
    padding: 12px 16px;
    font-size: 13px;
    text-align: left;
}

.admin-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #444;
}

.admin-table tr:hover td {
    background: #f9f9f9;
}

.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-admin { background: #ffe0e0; color: #a00; }
.badge-user  { background: #e0f0ff; color: #005; }

/* ── Hero section ── */
.hero {
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(to right, #28a745, #00bfff);
    color: white;
}

.hero h2 {
    font-size: 46px;
    margin-bottom: 12px;
}

.hero p {
    font-size: 20px;
    margin-bottom: 24px;
}

.hero a {
    display: inline-block;
    padding: 12px 28px;
    background: white;
    color: #28a745;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 17px;
    transition: background 0.2s;
}

.hero a:hover {
    background: #f1f1f1;
}

/* ── Section title ── */
.section-title {
    text-align: center;
    margin: 40px 0 10px;
    color: #333;
    font-size: 24px;
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 20px;
    background: #111;
    color: #888;
    font-size: 13px;
    margin-top: 40px;
}
/* ── Cart ── */
.cart-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 1px 6px;
    font-size: 11px;
    margin-left: 4px;
}

.cart-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-table th {
    background: #111;
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
}

.cart-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #444;
    vertical-align: middle;
}

.cart-table tr:hover td {
    background: #f9f9f9;
}

.cart-desc {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    padding: 0;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #ddd;
}

.qty-num {
    font-size: 15px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.btn-remove {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-remove:hover {
    background: #c0392b;
}

.btn-clear {
    background: #f39c12;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-clear:hover {
    background: #d68910;
}

.btn-checkout {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-checkout:hover {
    background: #218838;
}

.cart-total {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.cart-total-box {
    background: white;
    border-radius: 12px;
    padding: 24px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: right;
    min-width: 300px;
}

.cart-total-box p {
    font-size: 15px;
    margin-bottom: 8px;
    color: #555;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    font-size: 20px;
    color: #888;
}
/* ── Edit button ── */
.btn-edit {
    background: #f39c12;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-edit:hover {
    background: #d68910;
}

.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.card-img-placeholder {
    width: 100%;
    height: 160px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 8px;
}