
/* General Body and Font Styles */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8fafc; /* Light gray background */
    color: #334155; /* Slate 700 */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #e2e8f0; /* Lighter track */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8; /* Gray thumb */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b; /* Darker gray on hover */
}

/* Container for main content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Section Styling */
.section {
    padding: 60px 20px;
    margin-bottom: 40px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 2.5rem; /* 40px */
    font-weight: 700; /* Bold */
    color: #1e293b; /* Slate 900 */
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #4f46e5; /* Indigo 600 */
    border-radius: 2px;
}

/* Header */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.75rem; /* 28px */
    font-weight: 700;
    color: #4f46e5; /* Indigo 600 */
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.logo:hover {
    background-color: #e0e7ff; /* Indigo 100 */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px; /* 1.5rem */
}

.nav-links a {
    color: #475569; /* Slate 600 */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #4f46e5; /* Indigo 600 */
}

.cart-icon-link {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-icon {
    height: 24px;
    width: 24px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ef4444; /* Red 500 */
    color: white;
    font-size: 0.75rem; /* 12px */
    font-weight: 700;
    border-radius: 9999px; /* Full rounded */
    height: 20px;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem; /* 12px 24px */
    border-radius: 0.5rem; /* 8px */
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: none;
}

.button:active {
    transform: translateY(1px);
}

.button-primary {
    background-color: #4f46e5; /* Indigo 600 */
    color: white;
}

.button-primary:hover {
    background-color: #4338ca; /* Indigo 700 */
}

.button-secondary {
    background-color: #e2e8f0; /* Slate 200 */
    color: #475569; /* Slate 600 */
}

.button-secondary:hover {
    background-color: #cbd5e1; /* Slate 300 */
}

.button-white {
    background-color: #ffffff;
    color: #4f46e5; /* Indigo 600 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.button-white:hover {
    background-color: #f1f5f9; /* Slate 100 */
}

.full-width-button {
    width: 100%;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(to right, #4f46e5, #8b5cf6); /* Indigo to Purple */
    color: white;
    padding: 80px 20px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 60px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem; /* 56px */
    font-weight: 800; /* Extra bold */
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.25rem; /* 20px */
    margin-bottom: 32px;
    opacity: 0.9;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px; /* 2rem */
}

.product-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.product-card-content {
    padding: 20px;
}

.product-card-content h3 {
    font-size: 1.25rem; /* 20px */
    font-weight: 600;
    color: #1e293b; /* Slate 900 */
    margin-bottom: 8px;
}

.product-card-content p {
    color: #475569; /* Slate 600 */
    font-size: 0.9rem;
    margin-bottom: 16px;
    min-height: 40px; /* Ensure consistent height for description snippet */
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    color: #4f46e5; /* Indigo 600 */
}

/* Products Section Specific */
.products-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 32px;
}

.sort-dropdown {
    padding: 10px 15px;
    border: 1px solid #cbd5e1; /* Slate 300 */
    border-radius: 8px;
    background-color: #ffffff;
    font-size: 1rem;
    color: #475569;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sort-dropdown:focus {
    border-color: #4f46e5; /* Indigo 600 */
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); /* Indigo 600 with opacity */
}

/* Product Detail Section */
.product-detail-section {
    padding-top: 20px; /* Adjust padding as it's not a full page */
    padding-bottom: 20px;
    margin-top: 0;
    margin-bottom: 60px; /* Space from next section */
}

.product-detail-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.product-detail-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-detail-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-detail-info {
    flex: 1;
}

.product-detail-info h2 {
    font-size: 2.5rem; /* 40px */
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}

.product-detail-info p {
    color: #475569;
    font-size: 1.125rem; /* 18px */
    margin-bottom: 24px;
}

.product-detail-price {
    font-size: 3rem; /* 48px */
    font-weight: 800;
    color: #4f46e5;
    margin-right: 16px;
}

.product-category {
    font-size: 0.875rem; /* 14px */
    color: #475569;
    background-color: #e2e8f0; /* Slate 200 */
    padding: 6px 12px;
    border-radius: 9999px; /* Full rounded */
    display: inline-block;
}

.product-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

/* Cart Section */
.cart-items-container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 24px;
    margin-bottom: 32px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0; /* Slate 200 */
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-details {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-item-details img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cart-item-details h3 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.cart-item-details p {
    color: #475569;
    font-size: 0.9rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quantity-control {
    display: flex;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-control button {
    background-color: #f1f5f9; /* Slate 100 */
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    color: #475569;
    transition: background-color 0.2s ease;
}

.quantity-control button:hover {
    background-color: #e2e8f0; /* Slate 200 */
}

.quantity-control span {
    padding: 8px 12px;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    font-weight: 500;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-total {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
    min-width: 80px; /* Ensure consistent width */
    text-align: right;
}

.remove-item-button {
    background: none;
    border: none;
    color: #ef4444; /* Red 500 */
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.remove-item-button:hover {
    color: #dc2626; /* Red 600 */
}

.remove-item-button svg {
    height: 24px;
    width: 24px;
}

.empty-cart-message {
    text-align: center;
    color: #64748b; /* Slate 500 */
    font-style: italic;
    padding: 20px;
}

.cart-summary {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total {
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    color: #1e293b;
}

/* Forms (Checkout and Contact) */
.checkout-form-container,
.contact-form-container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
}

.form-group-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (min-width: 768px) { /* Medium screens and up */
    .form-group-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-group-grid.triple { /* For 3-column layouts like city/state/zip */
        grid-template-columns: repeat(3, 1fr);
    }
}


.form-field {
    margin-bottom: 24px;
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-field label {
    display: block;
    color: #334155; /* Slate 700 */
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1; /* Slate 300 */
    border-radius: 8px;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input[type="text"]::placeholder,
.form-field input[type="email"]::placeholder,
.form-field textarea::placeholder {
    color: #94a3b8; /* Slate 400 */
}

.form-field input[type="text"]:focus,
.form-field input[type="email"]:focus,
.form-field textarea:focus {
    border-color: #4f46e5; /* Indigo 600 */
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); /* Indigo 600 with opacity */
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* About Section */
.about-section .about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: #475569;
    font-size: 1.1rem;
}

.about-section .about-content p {
    margin-bottom: 16px;
}

/* Contact Section */
.contact-section .contact-form-container p {
    text-align: center;
    margin-bottom: 32px;
    color: #475569;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background-color: #1e293b; /* Slate 900 */
    color: white;
    padding: 40px 20px;
    text-align: center;
    margin-top: auto; /* Pushes footer to bottom */
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #cbd5e1; /* Slate 300 */
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    color: #94a3b8; /* Slate 400 */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

/* Alert Message (instead of alert()) */
.alert-message {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    color: white;
    z-index: 1000;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.alert-message.success {
    background-color: #22c55e; /* Green 500 */
}

.alert-message.info {
    background-color: #3b82f6; /* Blue 500 */
}

.alert-message.error {
    background-color: #ef4444; /* Red 500 */
}

.alert-message.hide {
    opacity: 0;
    transform: translateY(100%);
}

/* Utility classes for JS toggling */
.hidden {
    display: none !important;
}

/* Responsive Adjustments */
@media (max-width: 1024px) { /* Large screens */
    .section-title {
        font-size: 2rem;
    }
    .hero-title {
        font-size: 2.8rem;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 24px;
    }
    .product-detail-content {
        flex-direction: column;
        padding: 30px;
    }
}

@media (max-width: 768px) { /* Medium screens (tablets) */
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    .nav-links {
        gap: 15px;
    }
    .section {
        padding: 40px 15px;
        margin-bottom: 30px;
    }
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
    }
    .product-detail-content {
        padding: 20px;
    }
    .product-detail-info h2 {
        font-size: 2rem;
    }
    .product-detail-price {
        font-size: 2.5rem;
    }
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .cart-item-actions {
        width: 100%;
        justify-content: space-between;
    }
    .cart-item-total {
        min-width: unset;
        text-align: left;
    }
    .checkout-form-container,
    .contact-form-container {
        padding: 30px;
    }
    .form-group-grid {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
    .form-group-grid.triple {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) { /* Small screens (phones) */
    .header {
        padding: 0.75rem 0;
    }
    .navbar {
        padding: 0 10px;
    }
    .logo {
        font-size: 1.5rem;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .nav-links a {
        font-size: 0.9rem;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .hero-subtitle {
        font-size: 0.9rem;
    }
    .button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    .product-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
        gap: 16px;
    }
    .product-card-content p {
        min-height: unset; /* Allow description to collapse */
    }
    .product-detail-info h2 {
        font-size: 1.8rem;
    }
    .product-detail-price {
        font-size: 2rem;
    }
    .checkout-form-container,
    .contact-form-container {
        padding: 20px;
    }
}
