/* Main Stylesheet for Vaayunim Snacks */

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --dark-color: #292f36;
    --light-color: #f7fff7;
    --gray-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary-color);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.header-main {
    padding: 20px 0;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
}

.logo h1 a {
    color: var(--primary-color);
    text-decoration: none;
}

.logo p {
    font-size: 14px;
    color: var(--gray-color);
    margin-top: 5px;
}

.search-bar {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 5px 0 0 5px;
    font-size: 16px;
}

.search-bar button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #ff5252;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

.header-actions a {
    color: var(--dark-color);
    text-decoration: none;
    position: relative;
}

.cart-icon {
    font-size: 24px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation */
.nav {
    background: white;
    border-top: 1px solid #e9ecef;
}

.nav-menu {
    list-style: none;
    display: flex;
    padding: 15px 0;
    gap: 30px;
}

.nav-menu a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.product-title a {
    color: var(--dark-color);
    text-decoration: none;
}

.product-category {
    color: var(--gray-color);
    font-size: 14px;
    margin-bottom: 10px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.current-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.old-price {
    color: var(--gray-color);
    text-decoration: line-through;
    font-size: 14px;
}

.discount {
    background: var(--success-color);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.product-unit {
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 15px;
}

.add-to-cart {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart:hover {
    background: #ff5252;
}

/* Price Display */
.price-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.price-row.total {
    font-weight: 700;
    font-size: 18px;
    border-bottom: none;
}

.savings {
    color: var(--success-color);
    font-weight: 600;
}

/* Cart Page */
.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin: 40px 0;
}

.cart-items {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.cart-item-details h3 {
    margin-bottom: 10px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    cursor: pointer;
}

.quantity-input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
}

.cart-summary {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

.cart-summary h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.summary-row.total {
    font-weight: 700;
    font-size: 18px;
    border-top: 2px solid #e9ecef;
    margin-top: 10px;
    padding-top: 15px;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #ff5252;
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: #3db9b1;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-main .row {
        flex-direction: column;
        gap: 20px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .cart-container {
        grid-template-columns: 1fr;
    }
    
    .hero h2 {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        grid-template-columns: 80px 1fr;
    }
    
    .cart-item-actions {
        grid-column: span 2;
    }
}