/* Import Google Fonts (if not already in style.css or prev.html) */
/* @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); */

/* Ensure the root variables from style.css are available, or redefine if this is a standalone file */
:root {
    --color-primary-dark: #222222;
    --color-text-light: #FFFFFF;
    --color-accent-sale: #84cc16; /* Tailwind lime-500 */
    --color-gray-background: #F8F8F8;
    --color-card-background: #FFFFFF;
    --color-border-light: #E0E0E0;
    --color-text-gray: #666666;
    --color-text-dark-gray: #333333;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-gray-background);
    color: var(--color-text-dark-gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 300;
}

/* Adjust main content padding to prevent overlap with fixed header */
main {
    padding-top: 2rem; /* Add some padding from the header */
    margin-top: 7rem; /* To push main content below the fixed header */
}

/* General section styling for consistency - Removed box-shadow and border-radius, added subtle border */
section {
    background-color: var(--color-card-background);
    padding: 1.5rem;
    border-radius: 0; /* Removed rounded corners */
    box-shadow: none; /* Removed box-shadow */
    border: 1px solid var(--color-border-light); /* Added a subtle border */
    margin-bottom: 0; /* Remove margin-bottom from sections (spacing handled by parent .space-y-4 or custom margin-top) */
}

/* Add margin top to sections that follow another section directly to create vertical spacing */
.lg\:col-span-2 > section + section,
.lg\:col-span-1 > section + section {
    margin-top: 1.5rem; /* Add consistent space between sections within columns */
}


h1, h2 {
    font-family: 'Poppins', sans-serif; /* Use Poppins for headings as per prev.html */
    color: var(--color-primary-dark);
}

/* Input and textarea styling */
input[type="text"],
input[type="tel"],
textarea {
    padding: 0.75rem;
    border: 1px solid var(--color-border-light);
    border-radius: 0.375rem; /* Rounded corners for inputs */
    width: 100%;
    box-sizing: border-box; /* Include padding in width */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

input[type="text"]:focus,
input[type="tel"]:focus,
textarea[type="text"]:focus, /* Ensure textarea also gets focus styles */
textarea:focus {
    outline: none;
    border-color: var(--color-lime-500); /* Highlight with lime color on focus */
    box-shadow: 0 0 0 2px rgba(132, 204, 22, 0.2); /* Soft shadow on focus */
}

/* Button styling - using Tailwind defaults where possible, but ensuring consistency */
button {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

button:hover {
    transform: translateY(-1px); /* Slight lift on hover */
}

/* Order Item Card Styles - Made smaller and removed boxes/shadows */
.order-item {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    padding: 0.75rem; /* Reduced padding */
    border-radius: 0; /* Removed rounded corners */
    box-shadow: none; /* Removed box-shadow */
    border: 1px solid var(--color-border-light); /* Subtle border for separation */
    margin-bottom: 0.5rem; /* Reduced margin between items */
}

.order-item img {
    width: 4rem; /* Smaller image size */
    height: 4rem;
    object-fit: cover;
    border-radius: 0.25rem; /* Slightly less rounded corners for images */
    margin-right: 0.75rem; /* Reduced margin */
    flex-shrink: 0;
}

.order-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Allow content to shrink if needed to prevent overflow */
}

.order-item-details h3 {
    font-size: 0.95rem; /* Slightly smaller text */
    font-weight: 600;
    margin-bottom: 0.15rem; /* Reduced margin */
    color: var(--color-primary-dark);
    white-space: nowrap; /* Prevent name from wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
}

.order-item-details p {
    font-size: 0.8rem; /* Smaller text */
    color: var(--color-text-gray);
    margin-bottom: 0.4rem; /* Reduced margin */
}

.order-item-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Reduced gap */
    margin-top: 0.25rem; /* Reduced margin */
}

.order-item-quantity-controls button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    width: 1.6rem; /* Smaller buttons */
    height: 1.6rem;
    border-radius: 0.2rem; /* Slightly less rounded */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem; /* Smaller font for buttons */
    color: var(--color-text-dark-gray);
}
.order-item-quantity-controls button:hover {
    background-color: #e0e0e0;
}

.order-item-remove-btn {
    background: none;
    border: none;
    color: #ef4444; /* Red color for remove */
    font-size: 0.75rem; /* Smaller font for remove button */
    font-weight: 500;
    margin-left: 0.75rem; /* Reduced margin */
    padding: 0.15rem 0.3rem; /* Reduced padding */
    border-radius: 0.2rem;
    white-space: nowrap; /* Prevent button text from wrapping */
}
.order-item-remove-btn:hover {
    text-decoration: underline;
    background-color: #fee2e2;
}

/* Price overflow fix and better alignment */
.order-item > span:last-child { /* Selects the price span */
    font-weight: bold;
    color: var(--color-primary-dark);
    margin-left: 0.75rem; /* Ensure enough space from controls */
    flex-shrink: 0; /* Prevent price from shrinking */
    white-space: nowrap; /* Keep price on one line */
    text-align: right; /* Align price to the right */
    min-width: 4rem; /* Give it a minimum width to prevent collapse */
}


/* Adjustments for the cart sidebar (if it's included) */
.cart-sidebar {
    right: -100%; /* Ensure it's hidden by default on checkout.html */
}

/* Message box adjustments for checkout page */
#message-box-overlay {
    background-color: rgba(0, 0, 0, 0.6);
}
#message-box-content {
    font-size: 1rem;
    color: var(--color-text-dark-gray);
}
#message-box-ok-btn {
    background-color: var(--color-lime-500);
}
#message-box-ok-btn:hover {
    background-color: var(--color-accent-sale);
}

/* Ensure the overall layout is responsive */
@media (max-width: 1023px) {
    .grid.lg\\:grid-cols-3 {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
}

/* Override fixed header for checkout */
.fixed-header {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-bottom: 1px solid #e0e0e0;
}

/* Ensure main content has horizontal padding */
main.container.mx-auto {
    padding-left: 1rem; /* Added default horizontal padding for mobile */
    padding-right: 1rem; /* Added default horizontal padding for mobile */
}

/* For larger screens, remove the main container's horizontal padding and let grid gaps define spacing */
@media (min-width: 1024px) {
    main.container.mx-auto {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Adjust gap between columns for desktop */
.grid.lg\:gap-x-8 {
    column-gap: 2rem; /* Add 2rem gap between columns on desktop */
}

/* Remove direct margins on sections, let parent container's space-y handle vertical spacing */
/* (Individual section horizontal margins are now controlled by main.container or by grid gaps) */
section {
    margin-left: 0;
    margin-right: 0;
}

/* Add top margin for the second column's section on mobile when stacked */
@media (max-width: 1023px) {
    .lg\:col-span-1 > section:first-child {
        margin-top: 1.5rem; /* Add top margin for the shipping info section on mobile */
    }
}
