.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(33, 37, 41, 0.08);
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}
.product-card__media {
    height: 210px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}
.product-card__media img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.product-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #fff5eb 0%, #fdeee8 100%);
    color: #f4623a;
    font-size: 3rem;
}
.product-card__brand {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f4623a;
    margin-bottom: 0.35rem;
}
.product-card__brand.highlighted-brand {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 0.75rem;
}
.brand-pill-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem !important;
    margin: 0.35rem 0.5rem !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    border-color: rgba(244, 98, 58, 0.25) !important;
    background-color: #ffffff !important;
}
.brand-pill-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(244, 98, 58, 0.2) !important;
    background-color: #ffffff !important;
}
.brand-pill-logo {
    height: 42px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
    vertical-align: middle;
}
.product-card__name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.35rem;
    color: #212529;
}
.product-card__category {
    font-size: 0.82rem;
    color: #6c757d;
    margin-bottom: 1rem;
}
.product-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.product-card__price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #212529;
}
.shop-toolbar {
    margin-top: 1.5rem;
    padding: 1.25rem 1.25rem 1rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(33, 37, 41, 0.06);
    border: 1px solid rgba(33, 37, 41, 0.06);
}
.shop-search-wrap {
    position: relative;
}
.shop-search-wrap .bi-search {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
}
.shop-search-input {
    padding-left: 2.75rem;
    border-radius: 999px;
    border: 1px solid #dee2e6;
    min-height: 48px;
}
.shop-search-input:focus {
    border-color: #f4623a;
    box-shadow: 0 0 0 0.2rem rgba(244, 98, 58, 0.15);
}
.shop-results-meta {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
}
.shop-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}
.shop-category-btn {
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.shop-category-btn:hover {
    border-color: #f4623a;
    color: #f4623a;
}
.shop-category-btn.active {
    background: linear-gradient(135deg, #fcae1e 0%, #f4623a 100%);
    border-color: transparent;
    color: #fff;
}
.shop-empty-state__icon {
    font-size: 2.5rem;
    color: #ced4da;
    display: block;
    margin-bottom: 0.75rem;
}
.add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
    color: #f4623a;
}
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f4623a;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
}
.add-to-cart-btn {
    background-color: #f4623a;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.add-to-cart-btn:hover {
    background-color: #c34e2e;
}
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    padding: 20px;
    overflow-y: auto;
    border-radius: 45px 0 0 45px;
}
.cart-sidebar.open {
    right: 0;
}

/* Mobile specific adjustments for the cart close button */
.mobile-cart-close {
    display: none;
}

@media (max-width: 992px) {
    .mobile-cart-close {
        display: none;
        position: fixed;
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: #ffffff;
        border: 1px solid #dee2e6;
        font-size: 1.5rem;
        line-height: 1;
        color: #212529;
        z-index: 1102;
        cursor: pointer;
        padding: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        align-items: center;
        justify-content: center;
    }

    .cart-sidebar.open + .mobile-cart-close {
        display: flex;
    }

    /* Mobile menu close button */
    .mobile-menu-close {
        display: none;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: #fff;
        border: 1px solid #dee2e6;
        font-size: 1.15rem;
        color: #212529;
        z-index: 1103;
        cursor: pointer;
        padding: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-close i {
        font-size: 1.1rem;
    }

    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1040;
    }

    .nav-overlay.open {
        display: block;
    }

    /* Ensure navbar collapse is positioned relative to place the close button */
    #navbarResponsive {
        position: relative;
        z-index: 1106; /* keep the collapse above the nav overlay */
        pointer-events: auto;
    }
    /* Make the cart sidebar a bit narrower on smaller screens */
    .cart-sidebar {
        width: calc(100% - 28px);
        right: -100%;
        border-radius: 16px 0 0 16px;
        padding-top: 56px;
    }

    .cart-sidebar.open {
        right: 0;
    }
}
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}
.cart-overlay.open {
    display: block;
}
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.cart-item-remove {
    color: #dc3545;
    cursor: pointer;
    margin-left: 10px;
}

#mainNav {
    background-color: #fcae1e !important;
}

.products-title-container {
    display: inline-block;
    padding: 20px 40px;
    background: linear-gradient(135deg, #fcae1e 0%, #f4623a 100%);
    border-radius: 45px;
    margin-bottom: 20px;
}

.products-title-container h2 {
    color: white;
    margin: 0;
}

footer {
    animation: fadeIn 1.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Ensure masthead background stays covered and doesn't 'zoom out' on small screens */
header.masthead {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

@media (max-width: 768px) {
    header.masthead {
        min-height: 50vh !important;
        padding-top: 120px !important;
    }
}

/* Mobile responsive optimizations */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 85%;
        right: -85%;
        border-radius: 20px 0 0 20px;
    }
    
    .cart-sidebar.open {
        right: 0;
    }
    
    .cart-icon {
        font-size: 1.3rem;
    }
    
    .cart-count {
        top: -6px;
        right: -6px;
        padding: 1px 6px;
        font-size: 0.7rem;
    }
    
    .products-title-container {
        padding: 15px 30px;
        border-radius: 30px;
    }
    
    .products-title-container h2 {
        font-size: 1.5rem;
    }
    
    .product-card__media {
        height: 160px;
    }
    
    .add-to-cart-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    /* Shop page header */
    header.masthead h1 {
        font-size: 2.5rem !important;
    }
    
    header.masthead {
        padding-top: 120px !important;
        min-height: 40vh !important;
    }
    
    #mainNav .navbar-brand img {
        max-height: 100px;
        margin-top: -15px;
        margin-left: -15px;
    }
    
    #mainNav {
        max-height: 70px;
    }
    
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
        position: relative;
    }
    
    * {
        box-sizing: border-box;
    }
    
    .container, .container-fluid {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Mobile menu sidebar styling */
    #navbarResponsive {
        position: fixed;
        top: 70px;
        right: -280px;
        width: 280px;
        height: calc(100vh - 70px);
        background: linear-gradient(135deg, #fcae1e 0%, #f4623a 100%);
        padding: 2rem 1rem;
        border-radius: 20px 0 0 20px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 1106; /* sit above the nav-overlay (1040) so menu items are clickable */
        pointer-events: auto; /* ensure it receives pointer events */
    }
    
    #navbarResponsive.show {
        right: 0;
    }
    
    #navbarResponsive .navbar-nav {
        flex-direction: column;
        width: 100%;
    }
    
    #navbarResponsive .nav-link {
        color: white !important;
        font-size: 1.1rem;
        padding: 12px 15px;
        border-radius: 10px;
        margin-bottom: 8px;
        transition: background-color 0.3s ease;
    }
    
    #navbarResponsive .nav-link:hover {
        background-color: rgba(255,255,255,0.2);
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    /* Mobile contact info styling */
    .mobile-contact-info {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .contact-divider {
        height: 1px;
        background: rgba(255,255,255,0.3);
        margin-bottom: 1.5rem;
    }
    
    .contact-item {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 1rem;
        color: white;
        font-size: 0.9rem;
    }
    
    .contact-item i {
        font-size: 1.2rem;
        opacity: 0.9;
    }
    
    .contact-item div {
        flex: 1;
    }
}

/* Extra small screens (iPhone SE, etc) */
@media (max-width: 375px) {
    #mainNav .navbar-brand img {
        max-height: 80px;
        margin-top: -10px;
        margin-left: -10px;
    }
    
    #mainNav {
        max-height: 60px;
    }
    
    #navbarResponsive {
        top: 60px;
        height: calc(100vh - 60px);
        width: 260px;
        right: -260px;
    }
    
    header.masthead h1 {
        font-size: 2rem !important;
    }
    
    .products-title-container h2 {
        font-size: 1.3rem;
    }
}

/* Small phones (360px) */
@media (max-width: 360px) {
    #mainNav .navbar-brand img {
        max-height: 70px;
    }
    
    #navbarResponsive {
        width: 250px;
        right: -250px;
    }
    
    header.masthead h1 {
        font-size: 1.8rem !important;
    }
    
    .products-title-container h2 {
        font-size: 1.2rem;
    }
}

/* Medium phones (390px - iPhone 12, iPhone 13, iPhone 14) */
@media (max-width: 390px) and (min-width: 376px) {
    #navbarResponsive {
        width: 270px;
        right: -270px;
    }
    
    header.masthead h1 {
        font-size: 2.2rem !important;
    }
    
    .products-title-container h2 {
        font-size: 1.4rem;
    }
}

/* Large phones (414px - iPhone XR, iPhone 14 Pro Max) */
@media (max-width: 414px) and (min-width: 391px) {
    #navbarResponsive {
        width: 275px;
        right: -275px;
    }
    
    header.masthead h1 {
        font-size: 2.3rem !important;
    }
    
    .products-title-container h2 {
        font-size: 1.5rem;
    }
}

/* Extra large phones (480px) */
@media (max-width: 480px) and (min-width: 415px) {
    #navbarResponsive {
        width: 280px;
        right: -280px;
    }
    
    header.masthead h1 {
        font-size: 2.4rem !important;
    }
    
    .products-title-container h2 {
        font-size: 1.6rem;
    }

    /* Product modal styles */
    .product-modal {
        position: fixed;
        inset: 0;
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 2000;
    }
    .product-modal.open {
        display: flex;
    }
    .product-modal__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.5);
    }
    .product-modal__dialog {
        position: relative;
        background: #fff;
        border-radius: 12px;
        max-width: 720px;
        width: 94%;
        max-height: 90vh;
        overflow: auto;
        z-index: 2001;
        padding: 1rem;
    }
    .product-modal__close {
        position: absolute;
        top: 8px;
        right: 10px;
        background: transparent;
        border: none;
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
    }
    .product-modal__body {
        display: flex;
        gap: 1rem;
        align-items: flex-start;
    }
    .product-modal__media img {
        max-width: 220px;
        max-height: 220px;
        width: auto;
        height: auto;
        object-fit: contain;
        border-radius: 8px;
    }
    .product-modal__info {
        flex: 1;
    }
    .product-modal__price {
        font-size: 1.3rem;
        font-weight: 700;
        margin-top: 0.5rem;
    }
    .product-modal__actions {
        margin-top: 1rem;
        display: flex;
        gap: 0.5rem;
    }

    @media (max-width: 576px) {
        .product-modal__body {
            flex-direction: column;
            align-items: center;
        }
        .product-modal__media img {
            width: 100%;
            height: auto;
            max-height: 320px;
        }
        .product-modal__info {
            width: 100%;
            text-align: center;
        }
    }
}
