/* Color Palette & Base Styles */
:root {
    --primary-color: #ff6a00;
    --primary-hover: #e05d00;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #111111;
    --text-muted: #666666;
    --border-color: #eeeeee;
    --danger-color: #d9534f;
    --danger-hover: #c9302c;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Full-Screen Loader */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-gif {
    max-width: 120px;
    height: auto;
}

.hidden {
    display: none !important;
}

/* Header Styles */
.main-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.home-btn {
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.home-btn:hover {
    background-color: #f0f0f0;
}

/* Main Layout */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    width: 100%;
    flex: 1;
}

/* Page Title Section */
.page-title-section {
    margin-bottom: 24px;
}

.title-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-heading h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.title-subtext {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

.cart-count {
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Product Cards Grid */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Individual Product Card */
.product-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-free-delivery {
    align-self: flex-start;
    background-color: #e6f7ed;
    color: #0d8a43;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.product-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-color);
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Quantity Controller Styles */
.quantity-controller {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    background-color: #f5f5f5;
    padding: 4px 8px;
    border-radius: 8px;
    width: fit-content;
}

.btn-qty {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-qty:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.btn-qty:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qty-value {
    font-size: 1rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.meta-details {
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
    margin-bottom: 16px;
}

.meta-item {
    margin-bottom: 4px;
}

/* Remove Button */
.btn-remove {
    background-color: #fff0f0;
    color: var(--danger-color);
    border: 1px solid #fcdada;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    transition: background-color 0.2s, color 0.2s;
}

.btn-remove:hover {
    background-color: var(--danger-color);
    color: #ffffff;
}

.btn-remove:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty Cart View */
.empty-cart {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    margin: 20px 0;
}

.empty-cart h2 {
    font-size: 1.5rem;
    margin: 16px 0 8px;
}

.empty-cart p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Checkout Section */
.checkout-container {
    margin-top: 20px;
}

.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(255, 106, 0, 0.3);
    transition: background-color 0.2s, transform 0.1s;
}

.btn-checkout:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.modal-card p {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--text-color);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-danger {
    background-color: var(--danger-color);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}
