/* ========================================
   Coger Enterprises - Main Stylesheet
   ======================================== */

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

:root {
    --primary: #4a7c2c;
    --primary-dark: #2d5016;
    --secondary: #d4af37;
    --accent: #7a5d3a;
    --bg-light: #f8f5f0;
    --text-dark: #2c1810;
    --text-gray: #666;
    --success: #5cb85c;
    --danger: #d9534f;
    --warning: #f0ad4e;
    --shadow: 0 4px 14px rgba(0,0,0,0.12);
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-dark);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-error { background: var(--danger); }
.toast-success { background: var(--success); }
.toast-warning { background: var(--warning); }

.toast button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

/* Navigation Header */
.main-nav {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
}

.nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--secondary);
    color: var(--primary-dark);
}

.cart-btn {
    position: relative;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.cart-btn:hover { background: rgba(255,255,255,0.3); }

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.product-card {
    background: white;
    border-radius: 14px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.2);
}

.product-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}

.product-info {
    padding: 18px;
}

.product-category {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-description {
    font-size: 0.95rem;
    color: var(--text-gray);
    margin-bottom: 15px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.product-stock {
    font-weight: 600;
    color: var(--text-gray);
}

.add-to-cart {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), #a0826d);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.add-to-cart:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
}

.add-to-cart:disabled {
    background: #bbb;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container { flex-direction: column; gap: 15px; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
    .logo { font-size: 1.4rem; }
}


/* ==========================================
   Cart Page Styles
   ========================================== */

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

.cart-table thead {
    background: var(--primary);
    color: white;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-controls button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.quantity-controls button:hover {
    background: var(--primary);
    color: white;
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

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

.cart-summary {
    max-width: 400px;
    margin-left: auto;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.summary-row.total {
    border-top: 2px solid var(--primary);
    padding-top: 10px;
    margin-top: 10px;
    font-size: 20px;
}

#emptyCart {
    text-align: center;
    padding: 60px 20px;
}

#emptyCart p {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 20px;
}

/* ==========================================
   Form Container Styles
   ========================================== */

.form-container {
    max-width: 500px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-container h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-gray);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ==========================================
   Product Details Page Styles
   ========================================== */

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

.product-image-container {
    text-align: center;
}

.product-detail-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-info-container h1 {
    color: var(--primary);
    margin-bottom: 15px;
}

.product-price {
    font-size: 28px;
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 20px;
}

.product-description {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.product-meta {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.product-meta p {
    margin: 8px 0;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-selector input {
    width: 80px;
    padding: 8px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 16px;
}

/* ==========================================
   Responsive Adjustments for New Pages
   ========================================== */

@media (max-width: 768px) {
    .cart-table {
        font-size: 14px;
    }
    
    .cart-table th,
    .cart-table td {
        padding: 10px 5px;
    }
    
    .cart-item-image {
        width: 40px;
        height: 40px;
    }
    
    .product-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-container {
        padding: 20px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .cart-table thead {
        display: none;
    }
    
    .cart-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 10px;
    }
    
    .cart-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
    }
    
    .cart-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--primary);
    }
}
