/* ==========================================================================
   1. BASE STYLES & UTILITIES (FOR CART.HTML ONLY)
   ========================================================================== */

:root {
    --primary-color: #b78d65; /* Gold/Bronze */
    --secondary-color: #222; /* Dark Grey/Black */
    --light-bg: #f9f6f2; /* Creamy light background */
    --text-color: #333;
    --light-text: #f0f0f0;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;

    /* Corrected RGB values for transparent colors */
    --primary-color-rgb-r: 183;
    --primary-color-rgb-g: 141;
    --primary-color-rgb-b: 101;
}

/* Universal Box-Sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body and Global Typography */
body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--light-bg);
    overflow-x: hidden; /* Prevent horizontal scroll due to animations or overflow */
    padding-top: 80px; /* Space for fixed navbar */
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Global Container for Content Width */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Global Button Style */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    letter-spacing: 1px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(var(--primary-color-rgb-r), var(--primary-color-rgb-g), var(--primary-color-rgb-b), 0.2);
    text-decoration: none;
    font-weight: 600;
}

.btn:hover {
    background: #a57a50; /* Darker primary */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb-r), var(--primary-color-rgb-g), var(--primary-color-rgb-b), 0.3);
}

.btn-small {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
}

/* Utility Class for hidden elements (for JS toggle) */
.hidden {
    display: none !important;
}

/* Price Display (used in cart items) */
.price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.3rem; /* Base size */
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.price del {
    color: #999;
    font-size: 1rem;
}

/* ==========================================================================
   2. LAYOUT & GLOBAL COMPONENTS (FOR CART.HTML ONLY)
   ========================================================================== */

/* --- Navbar --- */
.luxury-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: 80px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo with gradient shine */
.logo {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--secondary-color);
    position: relative;
    background: linear-gradient(90deg, var(--primary-color), #e0c9b1, var(--primary-color));
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    text-decoration: none;
}

@keyframes shine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Animated navigation links */
.main-nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    position: relative;
    text-decoration: none;
    padding: 10px 0;
    overflow: hidden;
}

.nav-text {
    position: relative;
    color: #555;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.nav-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover .nav-text,
.nav-link.active .nav-text {
    color: var(--primary-color);
}

.nav-link:hover .nav-hover {
    transform: scaleX(1);
    transform-origin: left;
}

/* Icons with subtle effects */
.nav-actions {
    display: flex;
    gap: 25px;
    align-items: center;
}

.search-icon, 
.cart-icon {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    color: #555;
}

.nav-actions i { /* Apply to Font Awesome icons */
    font-size: 20px;
}

.search-icon:hover i, 
.cart-icon:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.cart-icon {
    display: flex;
    align-items: center;
    text-decoration: none; /* Remove underline from cart icon link */
}

.cart-count {
    font-size: 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    transform: translateY(-5px);
}

/* Mobile Menu Toggle (Hidden by default on desktop) */
.menu-toggle {
    display: none; 
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001; /* Above nav links when active */
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--secondary-color);
    transition: all 0.3s ease-in-out;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* NEW: Wrapper for nav actions and toggle on mobile */
.nav-actions-and-toggle {
    display: flex; /* Always flex this container */
    align-items: center;
    gap: 25px; /* Default gap for desktop */
}

/* --- Footer --- */
.luxury-footer {
    background: var(--secondary-color);
    color: var(--light-text);
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%; /* Add padding to footer container */
}

.footer-column h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.footer-column p {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #ccc;
}

.footer-column.about-us .social-icons a {
    color: var(--light-text);
    font-size: 20px;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.footer-column.about-us .social-icons a:hover {
    color: var(--primary-color);
}

.footer-column.links ul {
    list-style: none;
}

.footer-column.links ul li {
    margin-bottom: 10px;
}

.footer-column.links ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column.links ul li a:hover {
    color: var(--primary-color);
}

.newsletter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #444;
    border-radius: 5px;
    background: #333;
    color: white;
    font-family: var(--font-body);
}

.newsletter-form input[type="email"]::placeholder {
    color: #888;
}

.newsletter-form button {
    padding: 12px 25px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.newsletter-form button:hover {
    background: #a57a50;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 40px;
    border-top: 1px solid #333;
    color: #888;
}

/* --- Toast Notification --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-message {
    background-color: var(--secondary-color);
    color: var(--light-text);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    animation: fadeInOut 3s forwards;
    opacity: 0; /* Start hidden for animation */
}

.toast-message i {
    color: #4CAF50; /* Green checkmark */
    font-size: 1.2rem;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* --- Back to Top Button --- */
#backToTopBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.3s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

#backToTopBtn:hover {
    background-color: #a57a50;
    transform: translateY(-3px);
    opacity: 1;
}

/* --- Exit Popup --- */
.exit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.exit-popup.show {
    visibility: visible;
    opacity: 1;
}

.popup-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    max-width: 500px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
}

.exit-popup.show .popup-content {
    transform: translateY(0);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.popup-close:hover {
    color: var(--primary-color);
}

.popup-content h3 {
    font-family: var(--font-heading);
    font-size: 30px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.popup-content p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 25px;
}

.popup-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popup-newsletter-form input[type="email"] {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
}

.popup-cta {
    background: var(--secondary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s ease;
}

.popup-cta:hover {
    background: var(--primary-color);
}

/* --- Search Overlay/Modal --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align closer to top */
    padding-top: 100px; /* Space for nav */
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.search-overlay.active {
    visibility: visible;
    opacity: 1;
}

.search-box {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px 20px;
}

.search-box input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 1.5rem;
    padding: 10px 0;
    font-family: var(--font-body);
    color: var(--text-color);
}

.search-box input::placeholder {
    color: #bbb;
}

.search-box .fas.fa-search {
    font-size: 1.5rem;
    color: #999;
    margin-right: 10px;
}

.search-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.search-close-btn:hover {
    color: var(--primary-color);
}


/* ==========================================================================
   3. CART PAGE SPECIFIC STYLES (Desktop-First)
   ========================================================================== */

.cart-page {
    padding: 80px 0; /* Adjust for fixed header */
    background-color: var(--light-bg);
}

.cart-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Cart items on left, summary on right */
    gap: 40px;
    align-items: flex-start; /* Align items to the top */
    padding: 0 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.cart-items-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 30px;
}

#empty-cart-message {
    text-align: center;
    font-size: 1.2rem;
    color: #777;
    padding: 50px 20px;
}

#empty-cart-message a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

/* Individual Cart Item Styling */
.cart-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.cart-item-details {
    flex-grow: 1; /* Allow details to take up available space */
}

.cart-item-details h3 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 5px;
}

.cart-item-quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ccc; /* Border on the parent */
    border-radius: 8px; /* Rounded corners on the parent, but children will handle their own */
    /* REMOVED: overflow: hidden; */
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 40px;
}

.cart-item-quantity-controls button {
    background: #f8f8f8;
    border: none; /* Ensure no border */
    outline: none; /* Remove focus outline */
    padding: 0 15px;
    font-size: 1.2rem;
    color: var(--secondary-color);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    vertical-align: top; /* Crucial: Align to top to prevent tiny gaps */
}

/* NEW: Apply border-radius directly to the first and last buttons */
.cart-item-quantity-controls button:first-of-type {
    border-top-left-radius: 7px; /* Slightly less than parent to fit inside */
    border-bottom-left-radius: 7px;
}
.cart-item-quantity-controls button:last-of-type {
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
}

.cart-item-quantity-controls button:hover {
    background: var(--primary-color);
    color: white;
}

.cart-item-quantity-controls button:hover {
    background: var(--primary-color); /* Primary color on hover */
    color: white; /* White text on hover */
}
.cart-item-quantity-controls input {
    width: 60px;
    text-align: center;
    border: none; /* Ensure no border */
    outline: none; /* Remove focus outline */
    font-size: 1.1rem;
    color: var(--text-color);
    background-color: white;
    -moz-appearance: textfield;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    height: 100%;
    line-height: 40px; /* Match parent height for vertical centering */
    vertical-align: top; /* Crucial: Align to top to prevent tiny gaps */
    flex-grow: 1; /* Allow it to take up available space */
}
.cart-item-quantity-controls input::-webkit-outer-spin-button,
.cart-item-quantity-controls input::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Chrome, Safari, Edge spinner removal */
    margin: 0;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 15px;
    transition: color 0.2s;
    flex-shrink: 0; /* Prevent shrinking */
}

.remove-item-btn:hover {
    color: #d10000; /* Red for delete */
}


/* Cart Summary Styling */
.cart-summary {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 30px;
    position: sticky; /* Make it stick while scrolling */
    top: 100px; /* Adjust based on header height */
}

.cart-summary h3 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 25px;
    text-align: center;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #555;
}

.summary-line span:first-child {
    font-weight: 500;
}

.total-line {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.proceed-to-checkout-btn {
    width: 100%;
    margin-top: 30px;
    padding: 1rem;
}

.continue-shopping {
    text-align: center;
    margin-top: 20px;
}

.continue-shopping-btn {
    background: none;
    color: var(--secondary-color);
    border: 1px solid #ddd;
    box-shadow: none;
    font-size: 0.95rem;
    padding: 0.8rem 1.8rem;
}

.continue-shopping-btn:hover {
    background: #f0f0f0;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* ==========================================================================
   4. RESPONSIVE STYLES (ALL MEDIA QUERIES FOR CART.HTML)
   ========================================================================== */

/* --- Tablets and small laptops (max-width: 992px) --- */
@media (max-width: 992px) {
    /* Navbar */
    .nav-container {
        padding: 0 4%;
    }
    .main-nav {
        gap: 10px;
    }
    .nav-text {
        font-size: 13px;
    }
    .nav-actions-and-toggle {
        gap: 20px; /* Slightly reduced gap */
    }

    /* Cart Page adjustments */
    .cart-content-grid {
        gap: 30px;
    }
    .cart-summary {
        padding: 25px;
    }
    .cart-summary h3 {
        font-size: 1.6rem;
    }
}

/* --- Mobile Devices (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Base Body Padding */
    body {
        padding-top: 70px; /* Adjust for smaller fixed header */
    }

    /* Navbar adjustments */
    .nav-container {
        height: 70px;
        padding: 0 3%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    /* Logo, main-nav, nav-actions-and-toggle order for mobile */
    .nav-container .logo { order: 1; }
    .nav-container .main-nav { order: 2; flex-grow: 0; flex-shrink: 0; display: none; } /* Hide main nav links on mobile */
    .nav-actions-and-toggle { 
        order: 3; /* Ensure this group comes after logo and main-nav */
        gap: 15px; /* Adjust gap between icons and hamburger */
    }
    .menu-toggle {
        display: flex !important; /* Force display flex for hamburger */
    }

    .logo {
        font-size: 24px;
    }
    .main-nav.active { /* Mobile menu overlay when active */
        display: flex; /* Show when active */
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 5px 30px rgba(0, 0, 0, 0.05);
        border-top: 1px solid rgba(0,0,0,0.03);
        padding: 20px 0;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    }
    .main-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .nav-link {
        width: 80%;
        text-align: center;
        padding: 12px 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    .nav-link:last-child {
        border-bottom: none;
    }
    .nav-text {
        font-size: 16px;
    }
    .nav-actions {
        gap: 15px;
    }
    .nav-actions i {
        font-size: 18px;
    }

    /* Cart Page Mobile Improvements */
    .cart-content-grid {
        grid-template-columns: 1fr !important; /* Force single column to stack */
        padding: 0 3%;
        gap: 30px;
    }

    .cart-items-container {
        padding: 20px;
        width: 100%; /* Ensure it takes full width */
    }

    .cart-item {
        flex-direction: column; /* Stack image and details */
        align-items: center; /* Center items within the stacked column */
        text-align: center; /* Center text within the item */
        gap: 15px;
        position: relative; /* For absolute positioning of remove button */
        padding: 20px 0 30px; /* Add bottom padding to make space for remove button */
    }

    .cart-item-image {
        width: 100px; /* Slightly larger image for better visibility */
        height: 100px;
    }

    .cart-item-details {
        flex-grow: 1;
        width: 100%; /* Ensure details take full width */
        text-align: center; /* Center align text within details */
    }

    .cart-item-details h3 {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }

    .cart-item-price {
        font-size: 1.1rem;
        margin-top: 5px;
    }

    .cart-item-quantity-controls {
        margin: 10px 0;
        width: 150px;
        justify-content: center;
        height: 38px;
        border-radius: 6px; /* Keep parent border-radius */
    }
    /* Adjust buttons and input for this breakpoint */
    .cart-item-quantity-controls button {
        font-size: 1.1rem;
        padding: 0 12px;
        vertical-align: top; /* Ensure vertical alignment */
    }
    .cart-item-quantity-controls input {
        width: 50px;
        font-size: 1rem;
        line-height: 38px;
        vertical-align: top; /* Ensure vertical alignment */
    }
    /* Re-apply border-radius for buttons in media query if needed for consistency */
    .cart-item-quantity-controls button:first-of-type {
        border-top-left-radius: 5px; /* Slightly less than parent */
        border-bottom-left-radius: 5px;
    }
    .cart-item-quantity-controls button:last-of-type {
        border-top-right-radius: 5px;
        border-bottom-right-radius: 5px;
    }
    /* Adjust buttons and input for this breakpoint */
    .cart-item-quantity-controls button {
        font-size: 1.1rem; /* Slightly smaller font */
        padding: 0 12px; /* Adjusted padding */
    }
    .cart-item-quantity-controls input {
        width: 50px; /* Adjusted width */
        font-size: 1rem;
        line-height: 38px; /* Match new height */
    }

    .remove-item-btn {
        position: absolute; /* Position absolutely */
        bottom: 5px; /* Place at the bottom */
        right: 5px; /* Align to the right */
        margin-left: 0; /* Remove default margin */
        font-size: 1.4rem; /* Make it more prominent */
        padding: 5px; /* Add padding for easier tapping */
    }

    .cart-summary {
        margin-top: 30px;
        padding: 20px;
        top: auto;
        position: static; /* Remove sticky behavior on mobile */
        width: 100%; /* Ensure summary takes full width */
    }

    .summary-line {
        font-size: 1rem;
    }

    .total-line {
        font-size: 1.2rem;
    }
}

/* --- Very small mobile devices (max-width: 480px) --- */
@media (max-width: 480px) {
    /* Base Body Padding */
    body {
        padding-top: 60px; /* Slightly less padding for very small screens */
    }

    /* Navbar */
    .nav-container {
        height: 60px; /* Shorter header */
    }
    .logo {
        font-size: 22px; /* Even smaller logo */
    }
    .nav-actions {
        gap: 10px; /* Smaller gap for icons */
    }
    .nav-actions i {
        font-size: 16px; /* Smaller icons */
    }
    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    .main-nav {
        top: 60px; /* Adjust mobile menu position */
    }
    .nav-actions-and-toggle {
        gap: 10px; /* Adjust gap for very small screens */
    }

    /* Cart Page adjustments for very small mobiles */
    .cart-items-container {
        padding: 15px;
    }

    .cart-item {
        gap: 10px;
        padding: 15px 0 25px; /* Adjust padding for very small screens */
    }

    .cart-item-image {
        width: 80px; /* Smaller image on very small screens */
        height: 80px;
    }
    .cart-item-details h3 {
        font-size: 1.1rem;
    }
    .cart-item-price {
        font-size: 0.95rem;
    }
    .cart-item-quantity-controls {
        width: 120px;
        height: 34px;
        border-radius: 5px; /* Keep parent border-radius */
    }
    /* Adjust buttons and input for this breakpoint */
    .cart-item-quantity-controls button {
        font-size: 1rem;
        padding: 0 10px;
        vertical-align: top; /* Ensure vertical alignment */
    }
    .cart-item-quantity-controls input {
        width: 40px;
        font-size: 0.9rem;
        line-height: 34px;
        vertical-align: top; /* Ensure vertical alignment */
    }
    /* Re-apply border-radius for buttons in media query if needed for consistency */
    .cart-item-quantity-controls button:first-of-type {
        border-top-left-radius: 4px; /* Slightly less than parent */
        border-bottom-left-radius: 4px;
    }
    .cart-item-quantity-controls button:last-of-type {
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
    }
    .remove-item-btn {
        font-size: 1.2rem;
    }
    .cart-summary h3 {
        font-size: 1.4rem;
    }
    .proceed-to-checkout-btn {
        font-size: 1rem;
        padding: 0.8rem;
    }
}
