:root {
    --blue-darkest: #04203e; 
    --blue-dark: #0a4472;    
    --blue-medium: #00669b;  
    --blue-light: #76a3bd;   
    --blue-lightest: #bed1df; 
    
    --bg-color: #f4f7f9;
    --text-main: #1c1e21;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0 0 30px 0;
    color: var(--text-main);
}

/* New Header Styles */
.main-header {
    background-color: var(--blue-darkest);
    color: var(--blue-lightest);
    padding: 30px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
}

.container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.products-section {
    flex: 2;
    background-color: transparent;
}

.cart-section {
    flex: 1;
    background-color: white;
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 30px;
    border-top: 5px solid var(--blue-medium);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--blue-darkest);
}

.section-header p {
    margin: 0;
    color: var(--blue-light);
    font-size: 14px;
    font-weight: 500;
}

#product-parent {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border: 1px solid var(--blue-lightest);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(10, 68, 114, 0.1);
}

.product-image {
    background: var(--blue-lightest);
    border-radius: 12px;
    padding: 15px 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease;
}

.product-card:hover .product-image {
    background: var(--blue-light);
}

.product-image span {
    font-size: 48px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.product-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--blue-darkest);
}

.product-price {
    margin: 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--blue-medium);
}

.product-stock {
    margin: 0 0 5px 0;
    font-size: 13px;
    color: var(--blue-light);
}

.product-availability {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.product-availability.available {
    color: var(--blue-dark);
    background-color: var(--blue-lightest);
}

.product-availability.not-available {
    color: #d93025;
    background-color: #fce8e6;
}

.add-button {
    background-color: var(--blue-medium);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    width: 100%;
    margin-top: auto;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.add-button:hover {
    background-color: var(--blue-dark);
}

.add-button:active {
    transform: scale(0.98);
}

#cart-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

#empty-cart-message {
    margin: 20px 0;
    text-align: center;
    color: var(--blue-dark);
    background: var(--blue-lightest);
    padding: 30px 20px;
    border-radius: 12px;
    font-weight: 500;
}

#cart-item-count {
    background: var(--blue-dark);
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
}

#cart-items {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 20px;
}

#cart-items::-webkit-scrollbar {
    width: 6px;
}
#cart-items::-webkit-scrollbar-thumb {
    background: var(--blue-light);
    border-radius: 10px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid var(--blue-lightest);
    border-radius: 12px;
    gap: 15px;
    transition: border-color 0.2s ease;
}

.cart-item:hover {
    border-color: var(--blue-light);
}

.cart-item-image {
    background: var(--blue-lightest);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image span {
    font-size: 24px;
}

.cart-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-info .item-name {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    color: var(--blue-darkest);
}

.cart-item-info .item-price {
    margin: 0;
    color: var(--blue-light);
    font-size: 13px;
    font-weight: 500;
}

.cart-item-info .item-subtotal {
    margin: 0;
    color: var(--blue-medium);
    font-weight: 700;
    font-size: 14px;
}

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

.qty-controls {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--blue-lightest);
    border-radius: 8px;
    overflow: hidden;
}

.qty-controls button {
    background: none;
    border: none;
    color: var(--blue-darkest);
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.qty-controls button:hover {
    background: var(--blue-lightest);
}

.qty-controls span {
    font-size: 14px;
    font-weight: 600;
    width: 24px;
    text-align: center;
    color: var(--blue-darkest);
}

.remove-from-cart-button {
    background: none;
    color: #d93025;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.remove-from-cart-button:hover {
    text-decoration: underline;
}

.cart-footer {
    margin-top: auto;
    border-top: 2px dashed var(--blue-lightest);
    padding-top: 20px;
}

.grand-total-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--blue-darkest);
}

#checkout-button {
    background-color: var(--blue-dark);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 10px rgba(10, 68, 114, 0.2);
}

#checkout-button:hover {
    background-color: var(--blue-darkest);
}

#checkout-button:active {
    transform: scale(0.98);
}
@media (max-width: 850px) {
    .container {
        flex-direction: column; 
    }

    .cart-section {
        position: static; 
        margin-top: 20px;
    }
}
@media (orientation: landscape) {
    #product-parent {
        grid-template-columns: repeat(3, 1fr);
    }
}

.product-img-tag {
    max-width: 100%;
    height: 160px;
    object-fit: contain;
}

.cart-img-tag {
    width: 60px; 
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.add-button:disabled {
    background-color: var(--blue-lightest);
    color: var(--blue-light);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.add-button:disabled:hover {
    background-color: var(--blue-lightest);
}


.cart-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.cart-actions button {
    flex: 1; 
}


#clear-cart-button {
    background-color: transparent;
    color: #d93025;
    border: 2px solid #fce8e6;
    padding: 15px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s ease;
}

#clear-cart-button:hover {
    background-color: #fce8e6;
    border-color: #fce8e6;
}

#clear-cart-button:active {
    transform: scale(0.98);
}