* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #27ae60;
    --primary-dark: #219a52;
    --secondary: #f39c12;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background: var(--primary);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo i {
    font-size: 2rem;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-bar input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-cart {
    background: var(--secondary);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    position: relative;
}

.btn-cart:hover {
    background: #e67e22;
}

#cart-count {
    background: #e74c3c;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Categories */
.categories {
    background: white;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.categories-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
}

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

.category-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--border);
    border-radius: 25px;
    background: white;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.category-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.category-btn i {
    font-size: 1.2rem;
}

/* Products */
.main {
    padding: 30px 0;
}

.featured, .all-products {
    margin-bottom: 40px;
}

.featured h2, .all-products h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    cursor: pointer;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text);
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
}

.product-original-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 0.9rem;
}

.product-unit {
    color: var(--text-light);
    font-size: 0.85rem;
}

.btn-add-cart {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.btn-add-cart:hover {
    background: var(--primary-dark);
}

.btn-add-cart:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.checkout-modal {
    max-width: 600px;
}

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

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

/* Cart */
.cart-items {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
}

.cart-item-price {
    color: var(--primary);
    font-weight: bold;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-qty button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-checkout:hover {
    background: var(--primary-dark);
}

/* Checkout Form */
#checkout-form {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.form-row {
    display: flex;
    gap: 10px;
}

.flex-2 {
    flex: 2;
}

.payment-methods {
    margin: 20px 0;
}

.payment-methods h3 {
    margin-bottom: 10px;
}

.payment-options {
    display: flex;
    gap: 10px;
}

.payment-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-option.selected {
    border-color: var(--primary);
    background: rgba(39, 174, 96, 0.1);
}

.payment-option i {
    font-size: 2rem;
    margin-bottom: 5px;
}

.order-summary {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.order-summary h3 {
    margin-bottom: 10px;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

/* Success Modal */
.success-modal {
    text-align: center;
    padding: 40px;
}

.success-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.btn-primary {
    padding: 15px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 85vh;
    }
    
    .checkout-modal {
        max-width: 100%;
    }
    
    .cart-item {
        gap: 10px;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .btn-cart {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .categories {
        padding: 10px 0;
    }
    
    .category-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .category-btn i {
        font-size: 1rem;
    }
    
    .main {
        padding: 15px 0;
    }
    
    .featured h2, .all-products h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-card {
        border-radius: 10px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-name {
        font-size: 0.85rem;
        margin-bottom: 3px;
        line-height: 1.3;
        height: 2.6em;
        overflow: hidden;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .product-original-price {
        font-size: 0.75rem;
    }
    
    .product-unit {
        font-size: 0.7rem;
    }
    
    .btn-add-cart {
        padding: 8px;
        font-size: 0.85rem;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .cart-items {
        padding: 15px;
    }
    
    .cart-item-name {
        font-size: 0.9rem;
    }
    
    .cart-item-price {
        font-size: 0.9rem;
    }
    
    .cart-item-qty button {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .cart-footer {
        padding: 15px;
    }
    
    .cart-total {
        font-size: 1.1rem;
    }
    
    .btn-checkout {
        padding: 12px;
        font-size: 1rem;
    }
    
    #checkout-form {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-group input {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .payment-option {
        padding: 12px;
    }
    
    .payment-option i {
        font-size: 1.5rem;
    }
    
    .payment-option span {
        font-size: 0.85rem;
    }
    
    .order-summary {
        padding: 12px;
    }
    
    .order-summary h3 {
        font-size: 0.95rem;
    }
    
    .btn-submit {
        padding: 12px;
        font-size: 1rem;
    }
    
    .success-modal {
        padding: 25px;
    }
    
    .success-icon {
        font-size: 3rem;
    }
    
    .success-modal h2 {
        font-size: 1.2rem;
    }
    
    .success-modal p {
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
}