/*
    MyCarCare Custom Stylesheet
    ---
    Table of Contents (Updated):
    1.  Global Resets & Variables      - Root variables and global box-sizing.
    2.  General & Typography           - Body, headings, and link styles.
    3.  Header & Navigation            - Navbar, brand, links, and scroll behavior.
    4.  Hero Section                   - Homepage hero styles, including transparent cards.
    5.  Forms & Buttons                - Global styles for form inputs and buttons.
    6.  Cards & General Components     - Base card styles and specific product card designs.
    7.  Page-Specific Sections         - Styles for unique sections on various pages.
        - Car Selector                 - The vehicle filter on the homepage.
        - CTA Section                  - Call-to-action blocks.
        - Testimonials                 - Customer testimonial cards.
        - Product Categories           - Icon-based category links.
        - Brands                       - Grayscale brand logos.
    8.  Feature-Specific Components    - Styles for distinct application features.
        - Map                          - Responsive map container.
        - Autocomplete                 - Search and input autocomplete dropdowns.
        - Header Search                - The search bar in the main navigation.
        - Garage                       - 'My Garage' vehicle card styles.
        - Filters & Grid Switcher      - Product page filtering UI.
        - Cart (Page & Mini)           - Styles for the main cart page and the mini-cart drawer.
        - Checkout Page                - Address selection and other checkout UI.
        - Modals                       - Custom modal animations.
        - Undo Notification            - The "Undo" message after item removal.
    9.  Responsive & Mobile            - Media queries for various screen sizes.
*/

/* --- 1. Global Resets & Variables --- */
:root {
    --mycar-primary: #FFC107;
    /* Primary theme color, a vibrant gold */
    --mycar-primary-darker: #e0a800;
    /* For hover states on primary elements */
    --mycar-accent: #004A99;
    /* Accent color, a deep blue */
    --mycar-accent-darker: #003b7a;
    /* For hover states on accent elements */
    --mycar-dark-text: #333;
    --mycar-dark-bg: #343a40;
    --navbar-height: 70px;
    /* default navbar height for spacing */
    --navbar-height-desktop: 6rem;
    /* desktop top spacing used previously */

    /* Animation Variables */
    --duration-fast: 0.2s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
    --ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out-quad: cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--mycar-dark-text);
    padding-top: var(--navbar-height);
    /* Exact compensation for fixed navbar */
    /* Compensation for fixed navbar */
    /* --- Sticky Footer Fix --- */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* This makes the main content area grow to push the footer down */
main {
    flex: 1;
    /* --- Smooth Page Transition --- */
}

/* NEW: Target the #page-content wrapper for transitions */
#page-content {
    /* Use our new motion variables for a smoother feel */
    transition: opacity var(--duration-fast) var(--ease-out-quint), transform var(--duration-fast) var(--ease-out-quint);
}

/* Animate the wrapper for exit */
#page-content.is-exiting {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
}

/* Define the starting state for entry */
#page-content.is-entering {
    animation: fadeInPage 0.3s var(--ease-out-quint) forwards;
}

/* OVERRIDE: Global padding adjustment for inner pages (10px gap) */
#page-content,
#page-content>main,
#page-content>section,
#page-content .container {
    padding-top: 10px !important;
}

/* OVERRIDE: Remove specific padding from critical.css ONLY for the homepage */
body.homepage #page-content,
body.homepage #page-content>main,
body.homepage #page-content>section,
body.homepage #page-content .container {
    padding-top: 0 !important;
}

/* --- SPA Loading Bar --- */
#spa-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    /* Thinner for premium feel */
    background-color: var(--mycar-primary);
    z-index: 2000;
    transition: width 0.2s ease-out, opacity 0.2s ease-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Staggered Animations for Lists --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply this class to a parent container (like row or list-group) to animate its direct children */
.stagger-fade-in>* {
    opacity: 0;
    /* Start hidden */
    animation: fadeInUp 0.4s var(--ease-out-quint) forwards;
}

.stagger-fade-in>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-fade-in>*:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-fade-in>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger-fade-in>*:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger-fade-in>*:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger-fade-in>*:nth-child(6) {
    animation-delay: 0.3s;
}

.stagger-fade-in>*:nth-child(7) {
    animation-delay: 0.35s;
}

.stagger-fade-in>*:nth-child(8) {
    animation-delay: 0.4s;
}

.stagger-fade-in>*:nth-child(9) {
    animation-delay: 0.45s;
}

.stagger-fade-in>*:nth-child(10) {
    animation-delay: 0.5s;
}

/* Utility for single elements */
.animate-fade-in-up {
    animation: fadeInUp 0.4s var(--ease-out-quint) forwards;
}

a {
    /* Add a subtle transition to all links */
    transition: color 0.2s ease-in-out;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* NEW: Consistent Section Heading Style */
.section-heading {
    border-bottom: 2px solid var(--mycar-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem !important;
    /* Use !important to override Bootstrap's mb-4/mb-5 */
    display: inline-block;
    /* Ensures the border only spans the text length */
}

/* --- 2. Header & Navigation --- */
.navbar-brand {
    font-family: 'Racing Sans One', sans-serif;
    font-size: 2.3rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-decoration: underline;
}

.navbar .nav-link {
    font-weight: 500;
    transition: color 0.3s;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--mycar-primary) !important;
    /* Gold for nav highlights */
}

/* Make the default dark navbar pure black for consistency */
.navbar.bg-dark {
    background-color: #000 !important;
}

/* --- 3. Hero Section --- */
.hero-section {
    position: relative;
    /* Establishes a positioning context for the overlay */
    background: url('../img/hero-background.jpg') no-repeat center center;
    background-size: cover;
    background-color: var(--mycar-dark-bg);
    /* Fallback color */
    z-index: 1;
    min-height: 100vh;
    /* Set to full viewport height */
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center the content vertically */
    padding-top: 4rem;
    /* reduced padding since header is now fixed and opaque */
    padding-bottom: 4rem;
}

/* Prefer WebP background when supported */
.webp .hero-section {
    background-image: url('../img/hero-background.webp');
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    /* The dark overlay */
    z-index: -1;
    /* Places the overlay between the background image and the content */
}


.usp-content {
    margin-top: 4rem;
    /* Add space between hero text and USP cards */
}

/* Style for the transparent cards in the hero section */
.hero-section .card {
    background-color: rgba(255, 255, 255, 0.1);
    /* Semi-transparent white for a glassy look */
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Subtle light border */
    color: #fff;
    /* Make all text inside white */
    box-shadow: none;
    /* Remove the default shadow */
    backdrop-filter: blur(5px);
    /* Frosted glass effect (gracefully degrades on older browsers) */
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.hero-section .card .card-title {
    color: #fff;
}

.hero-section .card:hover {
    background-color: rgba(255, 255, 255, 0.2);
    /* Brighten slightly on hover */
    border-color: rgba(255, 255, 255, 0.4);
}

.hero-section .btn {
    /* Add a subtle shadow to lift them off the page */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border-width: 2px;
    background-color: #f0f0f0;
    /* Very light grey background */
    color: #000;
    /* Black text */
    border-color: #f0f0f0;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.hero-section .btn:hover {
    background-color: #302f2f;
    /* Switch to black on hover */
    color: #fff;
    /* Switch to white text on hover */
    border-color: #302f2f;
}

/* --- 4. Forms & Buttons --- */
/* A more modern, Apple-inspired aesthetic for all form inputs */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #d2d2d7;
    background-color: #f5f5f7;
    padding: 0.6rem 1rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: var(--mycar-primary);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
    /* A soft gold glow */
    outline: none;
}

/* Redefined button styles for a cleaner look */
.btn-primary {
    background-color: var(--mycar-primary);
    border-color: var(--mycar-primary);
    color: #212529;
    /* Dark text on gold for better contrast */
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    background-color: var(--mycar-primary-darker);
    border-color: var(--mycar-primary-darker);
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* NEW: Add to Cart button animation */
.btn.is-adding {
    background-color: #28a745;
    /* Success green */
    border-color: #28a745;
    color: #fff;
    transform: scale(1.05);
    pointer-events: none;
    /* Disable clicks during animation */
}

.btn.is-adding i {
    animation: spin 0.6s linear infinite;
}

/* --- PRIORITY 3: MICRO-ANIMATIONS --- */

/* Button Hover Effects - Lift and Scale */
.btn {
    transition: all var(--duration-fast) var(--ease-out-quint);
}

.btn:hover:not(:disabled):not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled):not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Disabled Button State */
.btn:disabled,
.btn.disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading State for Buttons */
.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

.btn-primary.is-loading::after,
.btn-warning.is-loading::after {
    border-color: #212529;
    border-top-color: transparent;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Card Hover Effects */
.card {
    transition: transform var(--duration-fast) var(--ease-out-quint),
        box-shadow var(--duration-fast) var(--ease-out-quint);
}

.card.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Link Smooth Transitions */
a {
    transition: color var(--duration-fast) ease-in-out,
        opacity var(--duration-fast) ease-in-out;
}

/* Form Input Focus Animation */
.form-control,
.form-select {
    transition: border-color var(--duration-fast) ease-in-out,
        box-shadow var(--duration-fast) ease-in-out,
        background-color var(--duration-fast) ease-in-out;
}

/* Smooth All Transitions */
* {
    transition-timing-function: var(--ease-out-quint);
}

/* List Stagger Animation - Already Present Above */
/* Enhanced with smoother easing */

.btn.is-adding i {
    animation: checkmark-pop 0.4s var(--ease-out-quint);
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-secondary {
    background-color: #e9ecef;
    border-color: #e9ecef;
    color: var(--mycar-dark-text);
}

.btn-secondary:hover {
    background-color: #dbe1e6;
    border-color: #dbe1e6;
}

.btn-accent {
    background-color: var(--mycar-accent);
    border-color: var(--mycar-accent);
    color: #fff;
}

.btn-accent:hover {
    background-color: var(--mycar-accent-darker);
    border-color: var(--mycar-accent-darker);
}

.btn {
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.card {
    border-radius: 12px;
    /* Softer, more modern radius */
    border: 1px solid #e9ecef;
    /* A subtle border for all cards */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* A softer, more diffused shadow */
    transition: transform var(--duration-fast) var(--ease-in-out-quad), box-shadow var(--duration-fast) var(--ease-in-out-quad), border-color var(--duration-fast) var(--ease-in-out-quad);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* --- Disabled Form States for Better UX --- */
.form-control:disabled,
.form-select:disabled,
.btn:disabled {
    background-color: #e9ecef;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Make disabled list group items for services more obvious */
.list-group-item input[type="checkbox"]:disabled+span,
.list-group-item input[type="checkbox"]:disabled~div {
    opacity: 0.5;
}

.list-group-item input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

label.list-group-item:has(input:disabled) {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* --- 5. Cards & Components --- */
.product-card {
    background-color: #f5f5f7;
    /* A very light, Apple-like grey */
    border: 1px solid transparent;
    /* Start with a transparent border */
    border-radius: 18px;
    /* Softer, more rounded corners */
    box-shadow: none;
    /* Remove default shadow */
    transition: border-color 0.25s ease-in-out, transform 0.25s ease-in-out;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: #d2d2d7;
    /* Add a subtle border on hover */
    box-shadow: none;
    /* Ensure no shadow appears on hover */
}

.product-card-new {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card .product-card-img-container {
    padding: 1.5rem;
    /* Give the image breathing room */
    background-color: #fff;
    /* White background for the image */
    border-radius: 18px 18px 0 0;
}

.product-card .card-img-top {
    aspect-ratio: 4 / 3;
    /* Maintain a consistent aspect ratio */
    object-fit: contain;
    /* Ensure the whole product is visible */
}

.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* --- 6. Page-Specific Sections --- */

.cta-section {
    background-color: var(--mycar-dark-bg);
    color: #fff;
}

.map-responsive {
    overflow: hidden;
    padding-bottom: 75%;
    /* Adjust this value for aspect ratio */
    position: relative;
    height: 0;
}

.map-responsive iframe {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    position: absolute;
}

/* ---/* 5. Live Search Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d2d2d7;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

.search-suggestions.visible {
    display: block;
}

.search-suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color var(--duration-fast);
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 60px;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background-color: #f8f9fa;
}

.search-suggestion-item img {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
    flex-shrink: 0;
}

.search-suggestion-content {
    flex: 1;
    overflow: hidden;
}

.search-suggestion-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #212529;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestion-price {
    font-size: 0.85rem;
    color: var(--mycar-primary-darker);
    font-weight: 600;
}

.search-suggestion-item mark {
    background-color: var(--mycar-primary);
    color: #212529;
    padding: 0 2px;
    font-weight: 600;
    border-radius: 2px;
}

/* --- 7. Components --- */
.autocomplete {
    position: relative;
    width: 100%;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-top: none;
    z-index: 2000;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    color: var(--mycar-dark-text);
    /* Ensure dropdown text is readable */
}

.autocomplete-item:hover {
    background-color: #f1f1f1;
}

.list-group-item {
    cursor: pointer;
    /* Make the whole row clickable */
}

/* Carousel image fixes: make all carousel images behave consistently regardless of original resolution */
.carousel .carousel-item .row.g-0 {
    align-items: stretch;
    /* ensure columns stretch to same height */
}

.carousel .carousel-item img {
    width: 100%;
    height: 220px;
    /* default height for medium screens */
    object-fit: cover;
    /* crop to fill without distortion */
    display: block;
}

/* Larger screens: increase carousel image height for better visuals */
@media (min-width: 992px) {
    .carousel .carousel-item img {
        height: 320px;
    }
}

/* Small screens: reduce height to keep the hero visible and avoid large scroll jumps */
@media (max-width: 575.98px) {
    .carousel .carousel-item img {
        height: 160px;
    }

    .carousel-caption {
        font-size: 0.95rem;
        padding: 0.5rem 0.75rem;
        background: rgba(0, 0, 0, 0.35);
        border-radius: 6px;
    }
}

/* Ensure carousel rows do not overflow their container */
.carousel .row.g-0 {
    margin: 0;
}


.list-group-item .form-check-input {
    pointer-events: none;
    /* The label handles the click, preventing double-firing */
}

/* Ensure form labels are white on dark backgrounds */
.bg-dark .form-label {
    color: #fff;
}

.product-category-card {
    border: 1px solid #eee;
}

.product-category-card .icon-circle {
    width: 70px;
    height: 70px;
    background-color: rgba(0, 74, 153, 0.1);
    /* Transparent version of the new blue */
    color: var(--mycar-blue);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.brands-section img {
    max-height: 40px;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.brands-section img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.cart-icon {
    position: relative;
    font-size: 1.2rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--mycar-accent);
    /* Blue for notifications provides good contrast */
    color: #fff;
    border-radius: 50%;
    padding: 0.1em 0.4em;
    font-size: 0.75rem;
    font-weight: 700;
}

.cart-icon.is-bouncing {
    animation: cart-bounce 0.6s ease;
}

@keyframes cart-bounce {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(0.9);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.header-search-container {
    position: relative;
    width: 250px;
    /* A good default width */
    transition: width 0.3s ease-in-out;
}

@media (min-width: 992px) {

    /* On larger screens, make it longer */
    .header-search-container {
        width: 350px;
    }
}

.header-search-container .form-control {
    padding-right: 2.5rem;
    /* Make space for the icon */
}

.header-search-container .search-btn {
    position: absolute;
    top: 50%;
    right: 0.1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    /* A subtle grey color */
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    z-index: 10;
    /* Ensure it's clickable */
}

.garage-car-img {
    height: 180px;
    width: 100%;
    object-fit: cover;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

footer.bg-dark {
    background-color: #000 !important;
}

/* --- 8. Responsive & Mobile Optimizations --- */
/* Mobile and small screens: some mobile-specific tweaks kept, but navbar styling
    will be enforced globally below. */
@media (max-width: 991.98px) {

    /* Mobile-first typography and spacing */
    body {
        font-size: 15px;
        /* slightly larger base font for readability on phones */
        line-height: 1.45;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Make header search full-width in collapsed menu */
    .header-search-container {
        width: 100%;
        margin-bottom: 1rem;
        /* Add space between search and nav links */
    }
}

@media (max-width: 991.98px) {

    /* Stack auth buttons horizontally with more breathing room */
    #header-right-container .navbar-nav {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        gap: 0.5rem;
    }

    /* Adjust hero section font size for smaller screens */
    .hero-section h1 {
        font-size: 2.2rem;
    }

    .hero-section p.lead {
        font-size: 1rem;
    }

    /* Make primary CTAs easier to tap */
    .hero-section .btn,
    .btn {
        padding: 0.65rem 1rem;
        font-size: 1rem;
        border-radius: 0.5rem;
        min-height: 48px;
        /* Large touch target */
    }

    /* Slightly larger form controls for mobile */
    .form-control,
    .form-select {
        padding: 0.6rem 0.75rem;
        font-size: 1rem;
        min-height: 44px;
        /* Touch friendly */
    }

    /* Product slider images */
    #product-slider-section .carousel-item img {
        max-height: 250px;
        object-fit: cover;
    }

    /* Navbar toggler touch target */
    .navbar-toggler {
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        min-width: 44px;
    }

    /* Mobile Menu - Professional Styling */
    .navbar-collapse {
        background-color: #000 !important;
        border-top: 1px solid #333;
        margin-top: 10px;
        padding: 0;
        max-height: 80vh;
        /* Scrollable if too long */
        overflow-y: auto;
    }

    /* Fix white flash animation glitch */
    .navbar-collapse.collapsing {
        background-color: #000 !important;
        transition: height 0.3s ease;
    }

    /* Nav Links as List Items */
    .navbar-nav .nav-item {
        border-bottom: 1px solid #1a1a1a;
    }

    .navbar-nav .nav-link {
        padding: 15px 20px !important;
        color: #fff !important;
        font-size: 1.1rem;
        transition: background-color 0.2s;
    }

    .navbar-nav .nav-link:active,
    .navbar-nav .nav-link:hover {
        background-color: #111;
        color: var(--mycar-primary) !important;
        padding-left: 25px !important;
        /* Subtle slide effect */
    }

    /* Separate Auth Section */
    #header-right-container {
        padding: 20px;
        background-color: #0a0a0a;
        margin-top: auto;
        /* Push to bottom */
    }

    /* Cards and Lists spacing */
    .card,
    .list-group-item,
    .product-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Interactive Icons */
    .icon-button,
    .qty-control .btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {

    /* Cart Layout Stacking */
    .cart-item-layout-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item-controls {
        width: 100%;
        justify-content: space-between !important;
        margin-top: 1rem;
    }

    .cart-page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    /* Footer Vertical Stacking */
    footer .col-md-4 {
        margin-bottom: 2rem;
        text-align: center;
    }

    footer h5 {
        text-decoration: underline;
        text-decoration-color: var(--mycar-primary);
        text-underline-offset: 4px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {

    /* Typography Scaling */
    .navbar-brand {
        font-size: 1.6rem;
    }

    h1,
    .h1 {
        font-size: 1.75rem;
    }

    h2,
    .h2 {
        font-size: 1.5rem;
    }

    h3,
    .h3 {
        font-size: 1.25rem;
    }

    p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* Full width buttons */
    .btn-primary,
    .btn-accent {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .form-group,
    .form-row {
        gap: 0.5rem;
    }

    /* Ensure modals fit */
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* --- Checkout Page Enhancements --- */
.list-group-item-action.active {
    border-color: var(--mycar-primary-darker) !important;
    background-color: rgba(255, 193, 7, 0.1) !important;
    color: var(--mycar-dark-text) !important;
    box-shadow: 0 0 0 2px var(--mycar-primary);
}

/* --- Gentle Modal Animation --- */
.modal.fade .modal-dialog {
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* --- Mini Cart Styles --- */
.mini-cart-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.mini-cart-item:last-child {
    border-bottom: none;
}

.mini-cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-right: 1rem;
}

.mini-cart-item-details {
    flex-grow: 1;
}

.mini-cart-item-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.mini-cart-item-price {
    color: #6c757d;
    font-size: 0.9rem;
}

.mini-cart-item-controls .btn-link {
    font-size: 0.9rem;
}

/* --- Undo Notification --- */
.list-group-item.text-center.text-muted {
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
}

/* --- Account Page Empty States --- */
.empty-state {
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Skeleton Loader Styles --- */
.skeleton {
    opacity: .7;
    animation: skeleton-loading 1s linear infinite alternate;
}

.skeleton-text {
    width: 100%;
    height: 0.7rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
}

.skeleton-text:last-child {
    margin-bottom: 0;
    width: 80%;
}

.skeleton-img {
    width: 100px;
    height: 100px;
}

@keyframes skeleton-loading {
    0% {
        background-color: hsl(200, 20%, 80%);
    }

    100% {
        background-color: hsl(200, 20%, 95%);
    }
}

/* --- Custom Pagination Styles --- */
.pagination .page-link {
    color: var(--mycar-dark-text);
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease-in-out;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    color: #000;
}

.pagination .page-item.active .page-link {
    background-color: var(--mycar-primary);
    border-color: var(--mycar-primary-darker);
    color: #000;
    /* Black text on yellow background */
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
}

/* --- Mobile Bottom Navigation (Deep Premium Style) --- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #000;
    /* Deep Black */
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.2);
    z-index: 1060;
    /* Above Bootstrap modal/offcanvas backdrops usually, but below offcanvas content */
    border-top: 1px solid #222;
    padding-bottom: env(safe-area-inset-bottom);
    /* iPhone Home Bar safe area */
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    text-decoration: none;
    font-size: 0.7rem;
    flex: 1;
    height: 100%;
    transition: all 0.2s ease;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:active {
    color: var(--mycar-primary);
}

.mobile-bottom-nav .nav-item:active i {
    transform: scale(1.1);
}

/* Add padding to body so content doesn't get hidden behind bottom bar on mobile */
/* Add padding to footer instead of body so the gap has the footer's dark background */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 0;
    }

    footer {
        padding-bottom: 80px !important;
        /* Clears the bottom nav with dark background */
    }
}

/* --- Mobile App Header --- */
.mobile-app-header {
    background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(20, 20, 20, 1) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    height: var(--navbar-height, 60px);
    /* Fallback to 60px */
    min-height: 60px;
    /* Ensure visibility even if var is 0 */
    display: flex;
    align-items: center;
    z-index: 1040;
    /* Above bootstrap default fixed-top */
}

/* Adjust page content to account for the mobile header height if it differs from desktop */
@media (max-width: 991.98px) {

    #page-content,
    #page-content>main,
    #page-content>section,
    #page-content .container {
        padding-top: 70px;
        /* Safe clearing for mobile header */
    }

    /* Fix Hero Section Text Overlap */
    .hero-section {
        padding-top: 80px !important;
        /* Push text down below the header */
        background-position: center top;
    }

    /* Tighten grid spacing */
    .g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }

    .product-card {
        border: none;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        overflow: hidden;
    }

    .product-card .product-card-img-container {
        padding: 0.5rem;
        border-radius: 8px 8px 0 0;
        height: 140px;
        /* Fixed height for consistency */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .product-card .card-img-top {
        max-height: 100%;
        width: auto;
    }

    .product-card .card-body {
        padding: 0.5rem;
        text-align: left !important;
        /* App style alignment */
    }

    .product-card .card-title {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .product-card .card-text.text-muted {
        font-size: 0.75rem;
        margin-bottom: 0.5rem !important;
    }

    .product-card .fw-bold.fs-5 {
        font-size: 1rem !important;
        /* Smaller price font */
        margin-bottom: 0.5rem !important;
        color: var(--mycar-primary-darker);
    }

    /* Transform Buttons to Icons on Mobile */
    .product-card .d-grid {
        display: flex !important;
        justify-content: space-between;
        /* Space them out */
        align-items: center;
        gap: 0.5rem !important;
    }

    .product-card .btn {
        padding: 0;
        width: 42px;
        /* Increased from 32px */
        height: 42px;
        /* Increased from 32px */
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0;
        /* Hide text */
        flex-shrink: 0;
    }

    /* Add Cart Icon */
    .product-card .add-to-cart-btn::after {
        content: '\f217';
        /* fa-cart-plus */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
    }
}

/* 4. Checkout Progress Indicator */
.checkout-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0 3rem 0;
    margin: 0 auto;
    max-width: 500px;
    position: relative;
}

.checkout-progress .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.checkout-progress .step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: white;
    border: 3px solid #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--duration-normal);
    position: relative;
    z-index: 2;
}

.checkout-progress .step-label {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
}

/* Blue connecting line - properly centered */
.checkout-progress::before {
    content: '';
    position: absolute;
    top: 2rem;
    left: 16.66%;
    right: 16.66%;
    height: 3px;
    background-color: #e9ecef;
    z-index: 1;
    transform: translateY(-50%);
}

/* Completed state - blue */
.checkout-progress .step.completed .step-circle {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.checkout-progress .step.completed .step-label {
    color: #007bff;
    font-weight: 600;
}

/* Active state - blue with pulse */
.checkout-progress .step.active .step-circle {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
}

.checkout-progress .step.active .step-label {
    color: #007bff;
    font-weight: 600;
}

/* Progress line for completed steps */
.checkout-progress.step-1-complete::before {
    background: linear-gradient(to right, #007bff 0%, #007bff 50%, #e9ecef 50%, #e9ecef 100%);
}

.checkout-progress.step-2-complete::before {
    background: #007bff;
}

@media (max-width: 576px) {
    .checkout-progress {
        padding: 1.5rem 0 2.5rem 0;
        max-width: 400px;
    }

    .checkout-progress .step-circle {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
        border-width: 2px;
    }

    .checkout-progress .step-label {
        font-size: 0.7rem;
    }

    .checkout-progress::before {
        top: 1.5rem;
        left: 15%;
        right: 15%;
    }
}

/* Ensure Mini Cart covers the bottom nav */
#miniCartOffcanvas {
    z-index: 2000 !important;
    /* Higher than .mobile-bottom-nav (1060) */
}

/* --- Mobile Splash Screen --- */
#app-splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#app-splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.splash-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
    animation: pulseLogo 2s infinite ease-in-out;
}

.splash-title {
    font-family: 'Racing Sans One', cursive;
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

.splash-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--mycar-primary);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

@keyframes pulseLogo {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===============================================
   PRIORITY 2 UX FEATURES
   ======================================= */

/* 1. Scroll to Top Button */
#scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--mycar-primary);
    color: #212529;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--duration-normal) var(--ease-out-quint);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scroll-to-top:hover {
    background-color: var(--mycar-primary-darker);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    #scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* 2. Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 0.5rem;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 200px;
}

/* 3. Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6c757d;
}

.empty-state i {
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.empty-state .btn {
    margin-top: 0.5rem;
}