* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.shop-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cart-icon {
    position: relative;
}

.cart-icon img {
    height: 30px;
    width: auto;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
}

/* Products Grid */
.products-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 12px;
}

.product-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.add-to-cart-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    transition: background-color 0.3s ease;
}

.add-to-cart-btn:hover {
    background-color: #2980b9;
}

/* Cart Page */
.cart-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.cart-title {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.cart-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cart-table th,
.cart-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cart-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    font-size: 14px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
}

.remove-btn {
    color: #e74c3c;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
}

.cart-summary {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.total-row {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    border-bottom: none;
}

.checkout-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.checkout-btn:hover {
    background-color: #219653;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart h2 {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.continue-shopping {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 20px;
}

/* Checkout Page */
.checkout-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.checkout-form {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .cart-table {
        display: block;
        overflow-x: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
/* Product card link styling */
.product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card a:hover .product-title {
    color: #3498db;
}

/* Ensure the entire product card is clickable except the Add to Cart button */
.product-card {
    position: relative;
}

.product-card .add-to-cart-btn {
    margin-top: 10px;
    position: relative;
    z-index: 2;
}
/* Mobile Responsive Cart Styles */
@media (max-width: 768px) {
    .cart-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .cart-table table {
        min-width: 600px; /* Minimum width for table to scroll */
    }
    
    .cart-table th,
    .cart-table td {
        padding: 15px 10px;
        font-size: 14px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .cart-summary {
        padding: 20px;
    }
    
    /* Stack the action buttons on mobile */
    .cart-summary .checkout-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .cart-summary > div {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Adjust quantity controls for mobile */
    .quantity-control {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .quantity-input {
        width: 40px;
    }
    
    /* Make product info more compact on mobile */
    .cart-table td:first-child div {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cart-table td:first-child span {
        font-size: 14px;
        line-height: 1.3;
    }
    
    /* Center cart title on mobile */
    .cart-title {
        font-size: 24px;
        text-align: center;
    }
    
    /* Adjust cart container padding for mobile */
    .cart-container {
        padding: 0 15px;
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    .cart-table th,
    .cart-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .quantity-control {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .quantity-btn {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .quantity-input {
        width: 35px;
        font-size: 13px;
    }
    
    .cart-summary {
        padding: 15px;
    }
    
    .cart-title {
        font-size: 20px;
    }
    
    /* Hide table headers on very small screens and use data attributes */
    .cart-table thead {
        display: none;
    }
    
    .cart-table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .cart-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    
    .cart-table tbody td:last-child {
        border-bottom: none;
    }
    
    .cart-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #2c3e50;
        flex: 0 0 40%;
        text-transform: uppercase;
        font-size: 12px;
    }
    
    .cart-table tbody td:first-child div {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }
    
    .quantity-control {
        flex-direction: row;
        justify-content: space-between;
    }
}
/* Mobile cart summary */
@media (max-width: 768px) {
    .summary-row {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 0;
    }
    
    .summary-row span:first-child {
        margin-bottom: 5px;
        font-weight: 600;
    }
    
    .total-row {
        font-size: 18px;
        padding: 15px 0;
        border-top: 2px solid #ddd;
    }
}