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

:root {
    --primary-green: #10b981;
    --light-bg: #f9fafb;
    --white: #ffffff;
    --gray-dark: #374151;
    --gray-light: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
}

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

/* Header */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary-green);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--gray-dark);
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

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

.logo-text {
    color: var(--primary-green);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-dark);
    font-weight: 500;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-green);
    border-bottom: 2px solid var(--primary-green);
}

.header-right {
    display: flex;
    align-items: center;
}

.cart-link {
    position: relative;
    text-decoration: none;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.cart-link:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-green);
    color: var(--white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Main Content */
.cart-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.cart-container {
    background-color: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.cart-container h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--gray-dark);
}

.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

/* Cart Items */
.cart-items-section {
    min-height: 300px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.empty-cart {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--light-bg);
    border-radius: 12px;
}

.empty-cart p {
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.continue-shopping-btn {
    display: inline-block;
    background-color: var(--primary-green);
    color: var(--white);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.continue-shopping-btn:hover {
    background-color: #059669;
    transform: scale(1.05);
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    background-color: var(--light-bg);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.cart-item:hover {
    background-color: rgba(16, 185, 129, 0.05);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    background-color: var(--white);
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-dark);
}

.cart-item-price {
    color: var(--primary-green);
    font-weight: 600;
    font-size: 1rem;
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
}

.qty-btn {
    background-color: transparent;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    color: var(--primary-green);
}

.qty-btn:hover {
    background-color: var(--light-bg);
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.remove-btn {
    background-color: #ef4444;
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.remove-btn:hover {
    background-color: #dc2626;
}

.item-total {
    font-weight: 600;
    color: var(--gray-dark);
}

/* Cart Summary */
.cart-summary {
    background-color: var(--light-bg);
    padding: 2rem;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 120px;
}

.cart-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--gray-dark);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #6b7280;
}

.summary-item.total {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--gray-dark);
}

.summary-divider {
    height: 1px;
    background-color: var(--gray-light);
    margin: 1rem 0;
}

.place-order-btn {
    width: 100%;
    background-color: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.place-order-btn:hover {
    background-color: #059669;
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.place-order-btn:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
    transform: scale(1);
}

.empty-cart-btn {
    width: 100%;
    background-color: #ef4444;
    color: var(--white);
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.empty-cart-btn:hover {
    background-color: #dc2626;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--gray-dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray-dark);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ef4444;
}

.checkout-form {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--gray-dark);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group h3 {
    color: var(--gray-dark);
}

.submit-order-btn {
    background-color: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.submit-order-btn:hover {
    background-color: #059669;
    transform: scale(1.02);
}

.cancel-btn {
    background-color: var(--gray-light);
    color: var(--gray-dark);
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background-color: #d1d5db;
}

/* Footer */
.footer {
    background-color: var(--gray-dark);
    color: var(--white);
    padding: 3rem 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-green);
}

.footer-section p {
    font-size: 0.95rem;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-green);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4b5563;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.9rem;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-green);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: #059669;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: relative;
        top: auto;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-controls {
        grid-column: 2;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cart-container {
        padding: 1.5rem;
    }

    .cart-container h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.75rem;
    }

    .logo-text {
        display: none;
    }

    .cart-container {
        padding: 1rem;
    }

    .cart-container h1 {
        font-size: 1.5rem;
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .modal-content {
        width: 95%;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
