:root {
    --walmart-blue: #0071dc;
    --walmart-yellow: #ffc220;
    --walmart-hover-blue: #004f9a;
    --text-color: #2e2f32;
    --light-grey: #f2f8fd;
    --border-color: #e3e4e5;
    --white: #ffffff;
    --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    /* Walmart uses Bogle, but Roboto is close */
    background-color: var(--light-grey);
    color: var(--text-color);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 140px;
    /* Account for fixed header if you make it fixed later, or just general offset */
}

/* Header */
.header {
    background-color: var(--walmart-blue);
    color: var(--white);
    padding: 0;
    /* Removing padding from header container */
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 1440px;
    margin: 0 auto;
}

.logo img {
    height: 48px;
    /* Slightly larger logo */
}

.search-bar {
    flex-grow: 1;
    margin: 0 32px;
    display: flex;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 12px 48px 12px 20px;
    border-radius: 24px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--walmart-yellow);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-btn svg {
    fill: var(--text-color);
    /* Search icon is dark */
    width: 20px;
    height: 20px;
}

.header-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.header-links div {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    cursor: pointer;
}

.cart-link {
    flex-direction: row !important;
    align-items: center;
    background: none;
    border: none;
    position: relative;
    padding: 8px 16px;
    /* Added padding */
    border: 1px solid white;
    /* Walmart style cart button often has white border */
    border-radius: 20px;
}

#cart-count {
    /* Now using inline styles in HTML, so keep this minimal or empty */
}

.main-nav {
    background-color: var(--walmart-blue);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.main-nav ul {
    display: flex;
    list-style: none;
    padding: 12px 24px;
    max-width: 1440px;
    margin: 0 auto;
    gap: 24px;
}

.main-nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.main-nav a:hover {
    text-decoration: underline;
}

/* Dropdown Menu */
.cart-link {
    position: relative;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.cart-link.cart-pulse {
    background-color: var(--walmart-yellow) !important;
}

/* Ensure icons and text inside cart link stay readable against yellow */
.cart-link.cart-pulse svg {
    fill: #1a1a1a !important;
}

.cart-link.cart-pulse #cart-count,
.cart-link.cart-pulse #cart-total {
    color: #1a1a1a !important;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    /* Position below the link */
    left: 0;
    background-color: var(--white);
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    border-radius: 4px;
    padding: 8px 0;
    flex-direction: column;
}

.dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown:not(:hover) .dropdown-menu {
    display: none !important;
}

.dropdown-menu li {
    padding: 0;
    width: 100%;
}

.dropdown-menu a {
    color: var(--text-color);
    padding: 10px 16px;
    display: block;
    width: 100%;
}

.dropdown-menu a:hover {
    background-color: var(--light-grey);
    color: var(--walmart-blue);
    text-decoration: none;
}

/* Layout */
.content-container {
    display: flex;
    max-width: 1440px;
    margin: 24px auto;
    padding: 0 24px;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--white);
    padding: 16px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.sidebar-title {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h4 {
    font-size: 14px;
    margin-bottom: 12px;
}

.filter-group ul {
    list-style: none;
}

.filter-group li {
    margin-bottom: 8px;
    font-size: 14px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Products */
.product-listing {
    flex: 1;
    min-width: 0;
    /* Prevents flex items from overflowing */
}

.breadcrumbs {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--walmart-blue);
    display: inline-block;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.sort-controls select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--white);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
    display: flex;
    /* Flex container for card layout */
    flex-direction: column;
    /* Stack elements vertically */
    justify-content: space-between;
    /* Space out content */
    height: 100%;
    /* Ensure card takes full height */
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    margin-bottom: 12px;
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 8px;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: black;
    /* Walmart uses black for price, green for "rollback" */
    margin-bottom: 4px;
}

.product-old-price {
    font-size: 12px;
    text-decoration: line-through;
    color: #666;
    margin-left: 8px;
}

.product-title {
    font-size: 14px;
    /* Walmart titles are often smaller, dense */
    line-height: 1.4;
    color: var(--text-color);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    /* Standard property */
    overflow: hidden;
    flex-grow: 1;
}

/* Product Grid Color Dots */
.product-color-options {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.product-color-options .color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-color-options .color-dot:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-color-options .color-dot.active {
    border: 2px solid var(--walmart-blue);
    box-shadow: 0 0 0 2px rgba(0, 113, 220, 0.2);
}


.add-to-cart-btn {
    background-color: var(--walmart-blue);
    color: var(--white);
    border: none;
    padding: 10px 16px;
    border-radius: 24px;
    width: 100%;
    margin-top: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.2s;
}

.add-to-cart-btn:hover {
    background-color: var(--walmart-hover-blue);
}

.shipping-badge {
    display: inline-block;
    background-color: #e6f1fc;
    color: #004f9a;
    /* Darker blue for text */
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: white;
    border: 1px solid #e3e4e5;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.wishlist-btn:hover {
    background: #f2f2f2;
}


/* Footer */
.footer {
    background-color: #e6f1fc;
    /* Light blue footer background */
    padding: 40px 24px;
    margin-top: 48px;
    border-top: 1px solid #dcdcdc;
}

.footer-links {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 32px;
}

.footer-links h4 {
    margin-bottom: 16px;
    font-size: 14px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    font-size: 12px;
    margin-bottom: 8px;
    color: #46474a;
    cursor: pointer;
}

.footer-bottom {
    text-align: center;
    margin-top: 32px;
    font-size: 11px;
    color: #666;
}

/* ===== COMPREHENSIVE MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 768px) {

    /* --- HEADER --- */
    .header-top {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .logo {
        order: 1;
        flex: 0 0 auto;
    }

    .logo span {
        font-size: 15px !important;
    }

    .header-links {
        order: 2;
        gap: 8px;
    }

    .cart-link {
        padding: 6px 10px !important;
    }

    #cart-count {
        font-size: 12px !important;
    }

    #cart-total {
        font-size: 13px !important;
    }

    .search-bar {
        order: 3;
        flex: 1 1 100%;
        margin: 4px 0 0 0;
    }

    .search-bar input {
        padding: 10px 44px 10px 14px;
        font-size: 14px;
    }

    .search-btn {
        width: 28px;
        height: 28px;
    }

    /* --- NAVIGATION --- */
    .main-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav ul {
        flex-wrap: nowrap;
        gap: 12px;
        padding: 10px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .main-nav li {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .main-nav a {
        font-size: 13px;
    }

    /* --- DROPDOWN --- */
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        min-width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 50vh;
        overflow-y: auto;
        z-index: 10000;
    }

    /* --- MAIN LAYOUT --- */
    .content-container {
        flex-direction: column;
        padding: 0 10px;
        margin: 12px auto;
        gap: 12px;
    }

    .sidebar {
        width: 100%;
        display: none;
    }

    .breadcrumbs {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .section-title {
        font-size: 17px;
        margin-bottom: 12px;
    }

    /* --- PRODUCT GRID --- */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card {
        padding: 10px;
        border-radius: 8px;
    }

    .product-image {
        height: 160px;
        padding: 4px;
        margin-bottom: 8px;
    }

    .product-price {
        font-size: 16px;
        margin-bottom: 2px;
    }

    .product-old-price {
        font-size: 10px;
        display: block;
        margin-left: 0;
    }

    .product-title {
        font-size: 12px;
        line-height: 1.3;
        margin-bottom: 6px;
        -webkit-line-clamp: 2;
    }

    .delivery-badge {
        font-size: 9px;
        padding: 2px 6px;
        margin-bottom: 4px;
    }

    /* Color dots in product grid */
    .product-color-options {
        gap: 4px;
        margin-bottom: 8px;
    }

    .product-color-options .color-dot,
    .color-dots .color-dot {
        width: 16px;
        height: 16px;
    }

    .add-to-cart,
    .add-to-cart-btn {
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 20px;
        margin-top: 8px;
    }

    /* --- PRODUCT DETAIL MODAL --- */
    .product-modal-overlay {
        align-items: flex-start;
        padding: 0;
    }

    .product-modal {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 16px;
        max-height: 100vh;
        min-height: 100vh;
        overflow-y: auto;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        z-index: 20;
    }

    .detail-layout {
        flex-direction: column;
        gap: 20px;
    }

    .detail-image-section {
        flex: none;
        max-width: 100%;
    }

    .detail-main-image-wrap {
        padding: 12px;
        min-height: 240px;
    }

    .detail-main-image {
        max-height: 280px;
    }

    .gallery-nav {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .gallery-prev {
        left: 4px;
    }

    .gallery-next {
        right: 4px;
    }

    .gallery-thumbnails,
    .gallery-thumbs {
        gap: 6px;
        margin-top: 10px;
    }

    .gallery-thumb {
        width: 50px;
        height: 50px;
    }

    .detail-info-section {
        width: 100%;
    }

    .detail-title {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .detail-price-block {
        gap: 8px;
        margin-bottom: 6px;
    }

    .detail-price {
        font-size: 28px;
    }

    .detail-old-price {
        font-size: 16px;
    }

    .detail-savings {
        font-size: 12px;
        padding: 3px 8px;
    }

    .detail-msi {
        font-size: 12px;
        padding: 6px 10px;
        margin-bottom: 14px;
    }

    /* Color swatches in detail */
    .color-swatches,
    .swatches {
        gap: 8px;
    }

    .color-swatch {
        width: 32px;
        height: 32px;
    }

    .variant-selector h4 {
        font-size: 14px;
    }

    .detail-add-to-cart {
        padding: 12px 20px;
        font-size: 15px;
    }

    /* Tabs in detail */
    .tab-header {
        display: flex;
        gap: 0;
    }

    .tab-link,
    .detail-tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .tab-content {
        font-size: 13px;
    }

    .tab-content ul {
        padding-left: 16px;
    }

    .tab-content li {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .specs-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* --- CART MODAL --- */
    .cart-modal {
        max-width: 100%;
        width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .cart-items-container {
        max-height: 45vh;
        /* Limit to about 4 products */
        flex: 0 1 auto;
        /* Don't force push the footer to the bottom */
        overflow-y: auto;
    }

    .cart-header {
        font-size: 20px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .cart-item {
        gap: 10px;
        padding: 12px 0;
    }

    .cart-item-image {
        width: 60px !important;
        height: 60px !important;
        max-width: 60px;
    }

    .cart-item-title {
        font-size: 13px;
    }

    .cart-item-price {
        font-size: 14px;
    }

    .cart-subtotal {
        font-size: 16px;
    }

    .checkout-btn {
        font-size: 16px;
        padding: 14px;
    }

    /* --- CHECKOUT MODAL --- */
    .checkout-modal-overlay {
        padding: 0;
        align-items: flex-start;
    }

    .checkout-modal {
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        padding: 20px 16px;
        max-height: 100vh;
        min-height: 100vh;
    }

    .checkout-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .checkout-header h3 {
        font-size: 20px;
    }

    .checkout-form-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .form-group input {
        padding: 14px;
        font-size: 14px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .checkout-legal {
        padding: 14px;
        margin-bottom: 16px;
        grid-column: 1 / -1;
    }

    .checkout-summary-section {
        grid-column: 1 / -1;
    }

    .checkout-submit-btn {
        grid-column: 1 / -1;
        border-radius: 8px;
    }

    .checkout-legal h4 {
        font-size: 14px;
    }

    .legal-checkbox span {
        font-size: 12px;
    }

    .legal-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .checkout-summary-section h4 {
        font-size: 16px;
    }

    .checkout-summary-item {
        gap: 10px;
        padding: 10px 0;
    }

    .checkout-summary-image {
        width: 40px;
        height: 40px;
    }

    .checkout-summary-title {
        font-size: 12px;
    }

    .checkout-summary-price {
        font-size: 12px;
    }

    .checkout-summary-total {
        font-size: 16px;
    }

    .checkout-submit-btn {
        font-size: 16px;
        padding: 16px;
    }

    /* --- LEGAL MODAL --- */
    .legal-modal-overlay {
        padding: 10px;
    }

    .legal-modal {
        max-width: 100%;
        max-height: 85vh;
        padding: 18px;
    }

    .legal-header h3 {
        font-size: 18px;
    }

    .legal-content {
        font-size: 13px;
    }

    /* --- FOOTER --- */
    .footer {
        padding: 24px 12px;
        margin-top: 24px;
    }

    .footer-links {
        flex-direction: column;
        gap: 20px;
    }

    .footer-links h4 {
        font-size: 13px;
    }

    .footer-links li {
        font-size: 11px;
    }

    .footer-bottom {
        font-size: 10px;
    }

    /* --- FLOATING CONTACT BUTTON --- */
    .floating-contact-btn {
        bottom: 14px;
        right: 14px;
        left: auto !important;
        padding: 10px 14px;
        font-size: 12px;
        gap: 6px;
    }

    .floating-contact-btn svg {
        width: 16px;
        height: 16px;
    }

    /* --- GALLERY CONTAINER (used in modal) --- */
    .gallery-container {
        display: flex;
        flex-direction: column-reverse;
    }

    .main-image-wrapper {
        position: relative;
    }
}

/* Extra small devices (iPhone SE, 320px) */
@media (max-width: 400px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-image {
        height: 130px;
    }

    .product-price {
        font-size: 14px;
    }

    .product-title {
        font-size: 11px;
    }

    .detail-price {
        font-size: 24px;
    }

    .detail-title {
        font-size: 16px;
    }

    .floating-contact-btn span,
    .floating-contact-btn {
        font-size: 11px;
        padding: 8px 12px;
        right: 10px;
        left: auto !important;
    }
}

/* ===== PRODUCT DETAIL MODAL ===== */
.product-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

.product-modal-overlay.active {
    display: flex;
}

.product-modal {
    background: var(--white);
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
    border-radius: 12px;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: #e0e0e0;
}

/* Breadcrumbs */
.detail-breadcrumbs {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

.detail-breadcrumbs a {
    color: var(--walmart-blue);
    text-decoration: none;
}

.detail-breadcrumbs a:hover {
    text-decoration: underline;
}

/* Two Column Layout */
.detail-layout {
    display: flex;
    gap: 40px;
    margin-bottom: 32px;
}

/* Image Section */
.detail-image-section {
    flex: 0 0 45%;
    max-width: 45%;
}

.detail-main-image-wrap {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    position: relative;
    min-height: 350px;
}

.detail-main-image {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    transition: transform 0.3s, opacity 0.3s;
}

.detail-main-image:hover {
    transform: scale(1.05);
}

/* Gallery Navigation Arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.2s;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-nav:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--walmart-blue);
}

.gallery-prev {
    left: 8px;
}

.gallery-next {
    right: 8px;
}

/* Thumbnails */
.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border: 2px solid #e3e4e5;
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
    background: white;
    transition: all 0.2s;
}

.gallery-thumb:hover {
    border-color: var(--walmart-blue);
    transform: scale(1.05);
}

.gallery-thumb.active {
    border-color: var(--walmart-blue);
    box-shadow: 0 0 0 2px rgba(0, 113, 220, 0.3);
}

/* Color Swatches */
.detail-color-section {
    margin-bottom: 20px;
}

.color-label {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.color-swatches {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-swatch.active {
    border-color: var(--walmart-blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 220, 0.3);
}

.color-swatch.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Info Section */
.detail-info-section {
    flex: 1;
}

.detail-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.3;
    margin-bottom: 8px;
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.stars {
    color: #f5a623;
    font-size: 18px;
    letter-spacing: 2px;
}

.rating-count {
    font-size: 13px;
    color: var(--walmart-blue);
    cursor: pointer;
}

/* Pricing */
.detail-price-block {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.detail-price {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
}

.detail-old-price {
    font-size: 18px;
    text-decoration: line-through;
    color: #888;
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    /* For scrollbar */
}

.cart-item {
    display: flex !important;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px;
    object-fit: contain;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 4px;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.detail-savings {
    font-size: 14px;
    color: #1a8c1a;
    font-weight: 600;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 4px;
}

.detail-msi {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--walmart-blue);
    font-weight: 500;
    margin-bottom: 20px;
    padding: 8px 12px;
    background: #e6f1fc;
    border-radius: 8px;
    width: fit-content;
}

/* Delivery */
.detail-delivery {
    border: 1px solid #e3e4e5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.delivery-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.delivery-option+.delivery-option {
    border-top: 1px solid #eee;
    padding-top: 12px;
    margin-top: 4px;
}

.delivery-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e6f1fc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delivery-sub {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* Quantity & Cart */
.detail-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.qty-selector {
    display: flex;
    align-items: center;
    border: 2px solid #e3e4e5;
    border-radius: 24px;
    overflow: hidden;
}

.qty-btn {
    background: none;
    border: none;
    width: 40px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    color: var(--walmart-blue);
    font-weight: 700;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #e6f1fc;
}

#detail-qty {
    font-size: 16px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.detail-add-to-cart {
    flex: 1;
    background: var(--walmart-blue);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
}

.detail-add-to-cart:hover {
    background: var(--walmart-hover-blue);
}

.detail-add-to-cart:active {
    transform: scale(0.98);
}

/* Tabs */
.detail-tabs-container {
    border-top: 1px solid #eee;
    padding-top: 24px;
}

.detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.detail-tab {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.detail-tab:hover {
    color: var(--walmart-blue);
}

.detail-tab.active {
    color: var(--walmart-blue);
    border-bottom-color: var(--walmart-blue);
    font-weight: 700;
}

.detail-tab-content {
    display: none;
}

.detail-tab-content.active {
    display: block;
}

.detail-tab-content p {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

/* Specs Table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.specs-table tr:nth-child(even) {
    background: #fafafa;
}

.specs-table td {
    padding: 12px 16px;
    font-size: 14px;
}

.specs-table td:first-child {
    font-weight: 600;
    color: #555;
    width: 40%;
}

.specs-table td:last-child {
    color: #333;
}

/* Features List */
.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 10px 0;
    font-size: 14px;
    color: #444;
    border-bottom: 1px solid #f0f0f0;
    padding-left: 24px;
    position: relative;
}

.features-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--walmart-blue);
    font-weight: 700;
}

/* ===== CART MODAL ===== */
.cart-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: flex-end;
    /* Slide in from the right */
    align-items: flex-start;
    overflow-y: hidden;
    backdrop-filter: blur(4px);
}

.cart-modal-overlay.active {
    display: flex;
}

.cart-modal {
    background: var(--white);
    width: 100%;
    max-width: 450px;
    height: 100vh;
    height: 100dvh;
    /* Keep strictly to the dynamic viewport */
    padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 24px));
    /* Extra padding at bottom for mobile safetyness */
    position: relative;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    animation: slideLeft 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes slideLeft {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.cart-header {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items-container {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 8px;
    /* For scrollbar */
    min-height: 0;
}

.cart-item {
    display: flex !important;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px;
    object-fit: contain;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 4px;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.3;
}

.cart-item-price {
    font-weight: 700;
    font-size: 16px;
    color: #1a1a1a;
}

.cart-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
    flex-shrink: 0;
    padding-bottom: 24px;
    /* Move the button up even more on touch devices */
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.checkout-btn {
    background-color: var(--walmart-yellow);
    color: var(--text-color);
    border: none;
    padding: 16px;
    border-radius: 24px;
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.checkout-btn:hover {
    background-color: #ffb100;
    /* Darker yellow */
}

.empty-cart-message {
    text-align: center;
    color: #666;
    margin-top: 40px;
    font-size: 16px;
}

/* Override modal-close for the right drawer styling */
.cart-modal-close {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.cart-modal-close:hover {
    background: #e0e0e0;
}

.cart-item-remove {
    background: none;
    border: none;
    font-size: 24px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.cart-item-remove:hover {
    color: #e02020;
    /* Red on hover to indicate danger/removal */
}

/* ===== CHECKOUT MODAL ===== */
.checkout-modal-overlay,
.legal-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
}

.checkout-modal-overlay.active,
.legal-modal-overlay.active {
    display: flex;
}

.checkout-modal {
    background: var(--white);
    width: 100%;
    max-width: 650px;
    border-radius: 16px;
    padding: 32px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: scaleUp 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.checkout-header h3 {
    font-size: 24px;
    color: #1a1a1a;
}

.checkout-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 16px;
    margin-bottom: 28px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--walmart-blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 220, 0.15);
}

/* Legal Checkboxes */
.checkout-legal {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #eee;
}

.checkout-legal h4 {
    margin-bottom: 12px;
    font-size: 16px;
    color: #333;
}

.legal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
}

.legal-checkbox input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.legal-checkbox span {
    font-size: 14px;
    line-height: 1.4;
    color: #555;
}

.legal-checkbox a {
    color: var(--walmart-blue);
    text-decoration: underline;
}

/* Visual Order Summary in Checkout */
.checkout-summary-section {
    margin-bottom: 32px;
}

.checkout-summary-section h4 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.checkout-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.checkout-summary-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 2px;
}

.checkout-summary-details {
    flex: 1;
}

.checkout-summary-title {
    font-size: 14px;
    color: #333;
    line-height: 1.3;
}

.checkout-summary-price {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    margin-top: 4px;
}

.checkout-summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 18px;
    padding-top: 16px;
    margin-top: 8px;
}

/* Submit Button */
.checkout-submit-btn {
    background-color: #25D366;
    /* WhatsApp Green */
    color: white;
    border: none;
    padding: 18px;
    border-radius: 8px;
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-submit-btn:hover {
    background-color: #1ebe57;
}

.checkout-submit-btn:active {
    transform: scale(0.98);
}

/* ===== LEGAL MODAL ===== */
.legal-modal {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.legal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.legal-header h3 {
    font-size: 20px;
}

.legal-content {
    flex: 1;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    padding-right: 8px;
}

.legal-content h3 {
    font-size: 16px;
    color: #222;
    margin-top: 16px;
    margin-bottom: 8px;
}

.legal-content p {
    margin-bottom: 12px;
}




/* Floating Contact Button */
.floating-contact-btn {
    position: fixed !important;
    bottom: 24px;
    right: 24px;
    left: auto;
    background-color: #25d366;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 99999 !important;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    visibility: visible !important;
    opacity: 1 !important;
}

.floating-contact-btn:hover {
    transform: translateY(-3px);
    background-color: #128c4e;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.floating-contact-btn:active {
    transform: translateY(0);
}