/* --- GLOBAL STYLES & VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-orange: #E85E2A;
    --text-dark: #212529;
    --text-light: #6c757d;
    --text-price: #D9534F;
    --bg-light-gray: #f8f9fa;
    --border-color: #EAEAEA;
    --placeholder-bg: #F0F0F0;
    --white: #fff;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --qty-bg: #F5F5F5;
    --checkbox-border-green: #91f7a3; /* Soft green for the border */
    --checkbox-checked-bg: #56c287;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--white);
    color: var(--text-dark);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* --- MAIN PAGE STYLES (Largely Unchanged) --- */
#page-container {
    max-width: 1440px;
    margin: 0 auto;
}
.top-banner {
    background-color: var(--text-dark);
    color: var(--white);
    text-align: center;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
}
.top-banner a { color: var(--white); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.main-header { border-bottom: 1px solid var(--border-color); padding: 16px 32px; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 40px; }
.search-container { position: relative; width: 40%; }
.search-container .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.search-container input { width: 100%; padding: 12px 12px 12px 45px; border-radius: 6px; border: 1px solid var(--border-color); background-color: var(--bg-light-gray); font-size: 16px; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.header-actions a { text-decoration: none; color: var(--text-dark); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.cart-button { position: relative; background: none; border: none; cursor: pointer; padding: 0; }
.cart-button .material-symbols-outlined { font-size: 28px; }
.cart-badge { position: absolute; top: -5px; right: -10px; background-color: var(--primary-orange); color: var(--white); border-radius: 50%; width: 20px; height: 20px; font-size: 12px; font-weight: bold; display: flex; justify-content: center; align-items: center; }
.main-content { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding: 32px; }
.sidebar nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar nav li a { display: block; padding: 12px 0; text-decoration: none; color: var(--text-dark); font-size: 16px; border-bottom: 1px solid var(--border-color); }
.sidebar nav li:first-child a { padding-top: 0; }
.sidebar nav li a.active, .sidebar nav li a:hover { font-weight: 700; color: var(--text-dark); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.product-card { border: 1px solid var(--border-color); padding: 16px; border-radius: 4px; }
.product-image-placeholder { position: relative; background-color: var(--placeholder-bg); height: 200px; display: flex; justify-content: center; align-items: center; margin-bottom: 12px; }
.product-image-placeholder img { width: 50%; opacity: 0.5; }
.favorite-btn { position: absolute; top: 10px; right: 10px; background: none; border: none; cursor: pointer; color: var(--text-light); }
.favorite-btn:hover .material-symbols-outlined, .favorite-btn .material-symbols-outlined.active { color: var(--text-price); font-variation-settings: 'FILL' 1; }
.quick-view-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.3); display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; }
.product-image-placeholder.has-quick-view:hover .quick-view-overlay { opacity: 1; }
.quick-view-btn { background-color: var(--white); color: var(--text-dark); border: 1px solid var(--text-dark); padding: 10px 20px; font-weight: bold; cursor: pointer; }
.product-price { font-size: 16px; color: var(--text-dark); font-weight: 500; margin: 0 0 8px 0; }
.product-title { font-size: 18px; margin: 0 0 8px 0; }
.product-description { font-size: 14px; color: var(--text-light); line-height: 1.5; margin: 0; }

/* --- MINI CART MODAL (REVISED) --- */
.mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mini-cart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mini-cart {
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: 90%;
    max-width: 450px;
    background-color: var(--white);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    transform: translateX(110%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.mini-cart-overlay.is-open .mini-cart {
    transform: translateX(0);
}

.mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.mini-cart-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}
.mini-cart-header .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    line-height: 1;
    color: var(--text-light);
}

.mini-cart-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 24px;
}
/* Custom Scrollbar */
.mini-cart-body::-webkit-scrollbar { width: 6px; }
.mini-cart-body::-webkit-scrollbar-track { background: transparent; }
.mini-cart-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.cart-summary-bar, .select-all-container {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.cart-summary-bar {
    font-size: 14px;
    color: var(--text-dark);
}

/* Custom Checkbox Container */
.custom-checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
}
.custom-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* The custom checkbox 'box' - The 'checkmark' class */
.checkmark {
    height: 22px;
    width: 22px;
    background-color: var(--white);
    /* CHANGE 1: Using the new green color for the border and making it thicker */
    border: 1.5px solid var(--checkbox-border-green);
    /* CHANGE 2: Increasing the border-radius to match the design */
    border-radius: 6px;
    display: inline-block;
    margin-right: 12px;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
}

/* The 'box' when the hidden input is checked */
.custom-checkbox-container input:checked ~ .checkmark {
    /* CHANGE 3: Using the new dark charcoal color for the background and border */
    background-color: var(--checkbox-checked-bg) ;
    border-color: var(--checkbox-checked-bg);
}

/* The checkmark symbol inside the box */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    /* Positioning and sizing of the white check symbol */
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* Show the checkmark symbol when the box is checked */
.custom-checkbox-container input:checked ~ .checkmark:after {
    display: block;
}
.cart-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cart-item {
    display: flex;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}
.cart-item-image {
    width: 90px;
    height: 90px;
    background-color: var(--placeholder-bg);
    border-radius: 8px;
    flex-shrink: 0;
}
.cart-item-details {
    flex-grow: 1;
}
.cart-item-details h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
.cart-item-price {
    color: var(--text-price);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
}
.cart-item-attributes {
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

/* New Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    background-color: var(--qty-bg);
    border-radius: 99px; /* Pill shape */
    padding: 4px;
    flex-shrink: 0;
}
.quantity-btn {
    background-color: var(--white);
    border: 1px solid #E0E0E0;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 22px;
    font-weight: 400;
    line-height: 0; /* Align symbol vertically */
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.quantity-btn:hover {
    background-color: #f0f0f0;
}
.quantity-input {
    width: 30px;
    text-align: center;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    -moz-appearance: textfield; /* Firefox */
}
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mini-cart-footer {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--white);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    flex-shrink: 0;
}
.footer-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.footer-label {
    font-size: 18px;
    font-weight: 500;
}
.footer-value {
    font-size: 18px;
    font-weight: 600;
}
.shipping-note {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
    text-align: right;
    max-width: 200px;
}
.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}
.cart-actions button {
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 48%;
}
.view-bag-btn {
    background: none;
    border: none;
    color: var(--text-dark);
    text-decoration: underline;
    padding: 0;
    width: auto;
    font-weight: 500;
}
.checkout-btn {
    background-color: var(--primary-orange);
    border: 1px solid var(--primary-orange);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(232, 94, 42, 0.3);
    transition: background-color 0.2s;
}
.checkout-btn:hover {
    background-color: #d15121;
}
/* --- EMPTY CART STATE --- */
.empty-cart-container {
    display: none; /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 24px;
    text-align: center;
}
.empty-cart-text {
    font-size: 18px;
    color: var(--text-light);
    margin-top: auto;
    margin-bottom: auto;
}
.shop-now-btn {
    width: 100%;
    height: 50px;
    margin-top: auto;
}

/* Logic to show/hide elements when cart is empty */
.mini-cart.is-empty .mini-cart-body,
.mini-cart.is-empty .mini-cart-footer {
    display: none;
}
.mini-cart.is-empty .empty-cart-container {
    display: flex;
}
