/* Zorbas Grocery Store - Main Stylesheet */
/* Green and White Theme inspired by Checkers/Pick n Pay */

:root {
    --primary-green: #00923f;
    --primary-green-dark: #007533;
    --primary-green-light: #4CAF50;
    --secondary-green: #7CB342;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #666666;
    --text-dark: #333333;
    --text-light: #757575;
    --border-color: #dddddd;
    --error: #f44336;
    --success: #4CAF50;
    --warning: #ff9800;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-gray);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
}

.logo a {
    text-decoration: none;
    color: var(--primary-green);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.logo .tagline {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-green);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-icon {
    position: relative;
    color: var(--text-dark);
    text-decoration: none;
    padding: 8px;
    transition: color 0.3s;
}

.cart-icon:hover {
    color: var(--primary-green);
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--error);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.user-menu {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    padding: 8px;
    transition: color 0.3s;
}

.user-btn:hover {
    color: var(--primary-green);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white);
    box-shadow: var(--shadow-hover);
    border-radius: 8px;
    min-width: 180px;
    margin-top: 8px;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color 0.3s;
}

.user-dropdown a:hover {
    background-color: var(--light-gray);
}

.btn-login {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: var(--primary-green-dark);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 2px;
    transition: 0.3s;
}

.mobile-menu {
    display: none;
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    transition: left 0.3s;
    z-index: 1001;
}

.mobile-menu.show {
    left: 0;
}

.mobile-menu nav {
    padding: 80px 20px 20px;
}

.mobile-menu ul {
    list-style: none;
}

.mobile-menu a {
    display: block;
    padding: 15px 0;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s;
}

.mobile-menu a:hover {
    color: var(--primary-green);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 30px 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-green-dark);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-secondary:hover {
    background-color: var(--primary-green);
    color: var(--white);
}

.btn-danger {
    background-color: var(--error);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.product-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--light-gray);
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-green);
}

.btn-add-cart {
    background-color: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-add-cart:hover {
    background-color: var(--primary-green-dark);
}

/* Categories */
.categories-section {
    margin-bottom: 40px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.category-card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
}

.form-control.error {
    border-color: var(--error);
}

.form-error {
    color: var(--error);
    font-size: 14px;
    margin-top: 5px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4CAF50;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.alert-warning {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ff9800;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196F3;
}

/* Footer */
.site-footer {
    background-color: var(--text-dark);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--primary-green-light);
    margin-bottom: 15px;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 15px;
}

.footer-section p {
    color: #cccccc;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #cccccc;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-green-light);
}

.footer-bottom {
    border-top: 1px solid #555555;
    padding-top: 20px;
    text-align: center;
    color: #cccccc;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-content {
        padding: 10px 0;
    }

    .logo h1 {
        font-size: 24px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .product-image {
        height: 150px;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 14px;
    }

    .product-price {
        font-size: 16px;
    }

    .btn-add-cart {
        padding: 6px 12px;
        font-size: 12px;
    }
}
