@media screen and (max-width: 1200px) and (min-width: 992px) {
    #product1 .pro-container .pro {
        width: 31%;
    }
    
    /* Fix cart counter for tablet screens */
    .cart-counter {
        top: -7px;
        right: -7px;
        width: 19px;
        height: 19px;
        font-size: 11px;
        min-width: 19px;
    }
}

@media screen and (max-width: 991px) and (min-width: 800px) {
    #product1 .pro-container .pro {
        width: 48%;
    }
    
    /* Fix cart counter for medium tablet screens */
    .cart-counter {
        top: -7px;
        right: -7px;
        width: 18px;
        height: 18px;
        font-size: 11px;
        min-width: 18px;
    }
}

/* IPAD */

@media screen and (max-width: 799px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }

    html {
        overflow-x: hidden;
    }

    .section-p1 {
        padding: 40px;
    }

    #navbar {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        height: 100vh;
        width: 300px;
        position: fixed;
        top: 0;
        right: -300px;
        padding: 80px 0 0 10px;
        box-shadow: 0 40px 60px rgba(0, 0, 0, 0.1);
        background-color: #e3e6f3;
        transition: all 0.4s ease;

    }

    #navbar.active {
        right: 0px;
    }

    #navbar li {
        margin-bottom: 25px;
    }

    #mobile {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    #mobile a {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #mobile i {
        color: #1a1a1a;
        font-size: 24px;
        padding-left: 20px;
    }

    /* Fix cart counter position on mobile and tablet */
    #mobile .cart-counter {
        position: absolute;
        top: -6px;
        right: -6px;
        width: 18px;
        height: 18px;
        font-size: 11px;
        min-width: 18px;
    }

    #navbar li a {
        position: relative;
        display: inline-block;
    }

    #navbar .cart-counter {
        position: absolute;
        top: -6px;
        right: -6px;
        width: 18px;
        height: 18px;
        font-size: 11px;
        min-width: 18px;
    }

    #Close {
        display: initial;
        font-size: 24px;
        color: #222;
        position: absolute;
        top: 30px;
        left: 30px;
    }

    .lg-bag {
        display: none;
    }

    #img-slider .slide .info {
        padding: 0 40px;
    }

    #img-slider .active img {
        object-position: top 30% right 30%;
    }

    #img-slider .slide .info h4 {
        padding-bottom: 10px;
    }

    #feature {
        justify-content: center;
    }

    #feature .fe-box {
        margin: 15px;
    }

    #product1 .pro-container {
        justify-content: center;
    }

    #product1 .pro-container .pro {
        width: 45%;
        margin: 15px;
    }


    #banner {
        height: 20vh;
    }

    #sm-banner .banner-box {
        min-width: 100%;
        height: 30vh;
        margin-bottom: 20px;
    }

    #sm-banner .banner-box:nth-child(2) {
        margin-bottom: 0;
    }

    #banner3 {
        padding: 0 40px;
    }

    #banner3 .banner-box {
        width: 28%;
    }

    #newsletter {
        padding: 40px;
    }

    #newsletter .form {
        width: 70%;
    }

    footer {
        margin: 0;
    }
}

/* Mobile */

@media screen and (max-width: 477px) {
    /* Fix header padding on very small screens */
    #Header {
        padding: 10px 15px;
    }

    #Header .logo {
        max-width: 100px;
    }

    #navbar {
        width: 225px;
    }

    /* Add overlay when menu is open */
    body.navbar-open {
        overflow: hidden;
    }

    body.navbar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    /* Fix cart counter for very small screens */
    #mobile .cart-counter {
        top: -5px;
        right: -5px;
        width: 16px;
        height: 16px;
        font-size: 10px;
        min-width: 16px;
    }

    #mobile a {
        padding: 5px;
    }

    #navbar .cart-counter {
        top: -5px;
        right: -5px;
        width: 16px;
        height: 16px;
        font-size: 10px;
        min-width: 16px;
    }

    .section-p1 {
        padding: 20px;
    }

    #img-slider .slide .info {
        padding: 0 20px;
    }

    #img-slider .slide .info h4 {
        color: black;
        text-shadow: 2px 2px 2px white;
        transform: translateY(20px);
    }

    #img-slider .slide .info h2 {
        font-family: "cairo", sans-serif;
        font-size: 32px;
        color: white;
        text-shadow: 2px 2px 5px black;
        transform: translateY(5px);
    }

    #img-slider .slide .info h1 {
        font-family: "cairo", sans-serif;
        line-height: 1;
        font-size: 38px;
        text-shadow: 2px 2px 5px rgb(0, 255, 242);
    }

    #img-slider .slide .info p {
        font-weight: 700;
        color: black;
    }

    #img-slider .slide .info button {
        color: white;
        text-shadow: 2px 2px 2px black;
        font-size: 17px;
        font-weight: 700;
    }

    #img-slider .slide .info button:hover {
        color: black;
        text-shadow: 2px 2px 2px white;

    }

    #feature .fe-box {
        width: 150px;
        margin: 0 0 15px 0;
    }

    #feature {
        justify-content: space-around;
    }

    #product1 .pro-container .pro {
        width: 100%;
    }

    #banner {
        height: 40vh;
    }

    #sm-banner .banner-box {
        height: 40vh;
    }

    #sm-banner .banner-box:nth-child(2) {
        margin-top: 20px;
    }

    #banner3 {
        padding: 0 20px;
    }

    #banner3 .banner-box {
        width: 100%;
    }

    #newsletter {
        padding: 40px 20px;
    }

    #newsletter .form {
        width: 100%;
    }

    footer .copyright {
        text-align: start;
    }

    /* Fix header logo on mobile */
    #Header .logo {
        max-width: 120px;
        height: auto;
    }

    /* Fix header padding */
    #Header {
        padding: 15px 20px;
    }

    /* Fix product modal on mobile */
    .product-modal {
        padding: 20px 15px;
        max-height: 95vh;
    }

    .modal-content {
        flex-direction: column;
    }

    .modal-main-img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    /* Fix cart container on mobile */
    .cart-container {
        grid-template-columns: 1fr;
    }

    /* Fix newsletter form on mobile */
    #newsletter {
        flex-direction: column;
        text-align: center;
    }

    #newsletter .newstext {
        margin-bottom: 20px;
    }

    /* Fix banner3 on mobile */
    #banner3 .banner-box {
        margin-bottom: 15px;
    }

    /* Fix contact form on mobile */
    .contact-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Fix about content on mobile */
    .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Fix features grid on mobile */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Fix team grid on mobile */
    .team-grid {
        grid-template-columns: 1fr;
    }

    /* Fix FAQ grid on mobile */
    .faq-grid {
        grid-template-columns: 1fr;
    }

    /* Fix cart table on mobile */
    #cart {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #cart table {
        min-width: 600px;
    }

    /* Fix blog container on mobile */
    #blog {
        padding: 40px 20px 0 20px;
    }

    #blog .blog-box {
        flex-direction: column;
        padding-bottom: 40px;
    }

    #blog .blog-img {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }

    #blog .blog-details {
        width: 100%;
    }

    /* Fix page header on mobile */
    #page-header {
        height: 30vh;
        padding: 20px;
    }

    #page-header h2 {
        font-size: 2rem;
    }

    /* Fix banner3 spacing */
    #banner3 .banner-box:last-child {
        margin-bottom: 0;
    }

    /* Fix search bar on mobile */
    .search-products-bar {
        flex-direction: column;
        width: 100%;
    }

    .search-products-bar input {
        width: 100% !important;
        border-radius: 10px !important;
        margin-bottom: 10px;
    }

    .search-products-bar span {
        width: 100%;
        justify-content: center;
        border-radius: 10px !important;
    }

    /* Fix pagination on mobile */
    #pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    #pagination a {
        padding: 10px 15px;
        font-size: 14px;
    }

    /* Fix Load More button on mobile */
    .load-more-btn {
        padding: 12px 30px;
        font-size: 14px;
        width: 100%;
        max-width: 300px;
    }

    /* Fix header padding on very small screens */
    #Header {
        padding: 10px 15px;
    }

    /* Fix navbar z-index */
    #navbar {
        z-index: 1500;
    }

    #Header {
        z-index: 1400;
    }

    /* Fix overlay when navbar is open */
    body.navbar-open::before {
        z-index: 1300;
    }
}