/* Responsive Fixes for bcosmic.co.il */

/* === GLOBAL === */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

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

/* Override for slider - must fill and use fixed height on desktop */
.mainSlider .owl-carousel .owl-item img {
    max-width: none;
    width: 100%;
    height: 690px;
    object-fit: cover;
}

/* Prevent horizontal overflow from any element */
.wrapper,
.container,
.container-fluid {
    overflow-x: hidden;
}

section:not(.mainSlider) {
    overflow-x: hidden;
}

/* === HEADER (mobile) === */
@media only screen and (max-width: 767px) {
    #header {
        height: auto;
        min-height: 60px;
        padding: 5px 0;
    }

    #header .container {
        width: 100%;
        padding: 0 10px;
    }

    .logoWrap {
        padding: 5px 0;
    }

    .logoWrap img {
        max-width: 90px;
        height: auto;
    }

    .headerSideMenu {
        margin-left: 10px;
    }

    .headerSideMenu li {
        padding: 15px 5px;
    }

    .headerSideMenu .menu-icon span {
        display: none;
    }

    .mobileMenuOpenBtn {
        margin-top: 15px;
        padding-right: 15px;
    }

    .searchBtn {
        margin-top: 18px;
    }

    /* Mobile menu full width */
    .mainNav {
        width: 85vw;
        max-width: 320px;
    }
}

/* === MAIN SLIDER === */
@media only screen and (max-width: 767px) {
    .mainSlider .owl-carousel .owl-item img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .mainSlider .owl-nav {
        bottom: 5px;
    }

    .mainSlider .owl-nav .owl-next,
    .mainSlider .owl-nav .owl-prev {
        width: 25px;
        height: 25px;
    }

    .bannerTxtWrapper {
        padding: 0 15px;
    }

    .bannerTxtWrapper .first h2 {
        font-size: 1.6rem;
    }

    .bannerTxtWrapper .second p {
        font-size: 1rem;
    }

    svg.bannerArrow {
        width: 28px;
        height: 28px;
    }
}

/* === PRODUCT CAROUSEL (homepage) === */
@media only screen and (max-width: 767px) {
    section.hp_products {
        padding: 15px 0;
    }

    section.hp_products h2 {
        font-size: 1.6rem;
        margin-bottom: 10px;
        padding: 0 15px;
    }

    .itemWrapper.hpItemWrapper {
        max-height: none;
        padding: 10px;
    }

    .itemWrapper.hpItemWrapper img {
        width: 100%;
        height: auto;
        max-height: 250px;
        object-fit: contain;
    }

    .itemWrapper h3 {
        font-size: 1.1rem;
        margin-top: 8px;
    }

    #hpProductCaru .owl-nav .owl-prev,
    #hpProductCaru .owl-nav .owl-next {
        width: 35px;
        height: 35px;
    }
}

/* === PRODUCT LISTING (category pages) === */
@media only screen and (max-width: 767px) {
    .itemsWrap .col-sm-6 {
        width: 50%;
        float: right;
    }

    .itemsWrap .itemWrapper {
        max-height: none;
        padding: 8px;
    }

    .itemsWrap .itemWrapper img {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: contain;
    }

    .itemsWrap .itemWrapper h3 {
        font-size: 0.95rem;
        line-height: 1.3;
        min-height: auto;
    }

    .itemsWrap .itemWrapper .price {
        font-size: 1rem;
    }

    .categories-choose {
        padding: 0 10px;
    }
}

@media only screen and (max-width: 479px) {
    .itemsWrap .col-sm-6 {
        width: 50%;
    }
}

/* === SINGLE PRODUCT PAGE === */
@media only screen and (max-width: 991px) {
    .productWrap .breadcrumb {
        padding: 20px 0;
        margin-right: 0;
        font-size: 0.9rem;
    }
}

@media only screen and (max-width: 767px) {
    .productWrap {
        padding: 0 10px 20px;
    }

    .productWrap .col-md-6 {
        width: 100%;
        float: none;
    }

    .imgSide {
        margin-bottom: 15px;
    }

    /* Product gallery */
    #prd-gallery .owl-carousel .owl-item img,
    .productImgWrp img {
        width: 100%;
        height: auto;
        max-height: 400px;
        object-fit: contain;
    }

    #prd-gallery .owl-prev,
    #prd-gallery .owl-next {
        width: 30px;
        height: 40px;
    }

    #prd-gallery-thumbs {
        margin-top: 10px;
    }

    #prd-gallery-thumbs .owl-item img {
        max-height: 60px;
        object-fit: contain;
    }

    /* Product info */
    .proInfoSide {
        padding: 0 10px;
    }

    .proInfoSide h1 {
        font-size: 1.6rem;
        padding-top: 10px;
        margin-bottom: 5px;
    }

    .proInfoSide .price {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .proInfoSide .form-group {
        margin-bottom: 10px;
    }

    .proInfoSide .form-group select {
        width: 100%;
        height: 40px;
    }

    /* Buy button */
    .addToCart.btnAddToCartItemCard {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 1.2rem;
        display: block;
    }

    /* Color swatches */
    .prd-color {
        width: 30px;
        height: 30px;
        margin: 3px;
    }

    /* Product tabs */
    .tab-content {
        padding: 10px 0;
    }

    .tab-content p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Drift zoom - disable on mobile */
    .drift-zoom-pane {
        display: none !important;
    }
}

/* === CART MODAL === */
@media only screen and (max-width: 767px) {
    .cartWrapper {
        padding: 15px;
        width: 100%;
        max-width: 100vw;
    }

    .cartItemsWrapper {
        max-height: 50vh;
        overflow-y: auto;
    }

    .cartItem {
        height: auto;
        min-height: auto;
        padding: 10px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .cartItem .imgWrap {
        width: 80px;
        float: right;
    }

    .cartItem .imgWrap img {
        width: 80px;
        height: auto;
    }

    .cartItem .info1Wrap {
        width: calc(100% - 100px);
        float: right;
        padding: 0 10px;
        height: auto;
    }

    .cartItem .info2Wrap {
        width: 100%;
        float: none;
        padding: 10px 0 0;
        height: auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .cartItem .info1Wrap .innerInfoWrap,
    .cartItem .info2Wrap .innerInfoWrap {
        position: static;
        transform: none;
    }

    .continuePay,
    .continueShop {
        font-size: 1.1rem;
        height: 44px;
        line-height: 44px;
    }
}

/* === SEARCH OVERLAY === */
@media only screen and (max-width: 767px) {
    .searchWrapper {
        padding: 20px 15px;
    }

    .searchWrapper h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .searchWrapper input[type="text"],
    .searchWrapper input[type="search"] {
        font-size: 1.1rem;
        padding: 10px;
        width: 100%;
    }
}

/* === MAGAZINE / BLOG SECTION === */
@media only screen and (max-width: 767px) {
    .magazinItemWrap {
        margin-bottom: 15px;
    }

    .magazinItemWrap img {
        width: 100%;
        height: auto;
    }

    .hp_magazin h2 {
        font-size: 1.5rem;
    }

    .hp_news {
        height: auto;
        padding: 15px 0;
    }

    .news_wrap h2 {
        font-size: 1.5rem;
        width: 100%;
        margin: 10px 0;
    }

    .newsTxt p {
        font-size: 1.2rem;
    }
}

/* === VIDEO SECTION === */
@media only screen and (max-width: 599px) {
    section.videoWrp {
        min-height: 200px;
        height: 200px;
    }

    .videoStrip {
        height: 150px;
    }

    .videoStrip a h2 {
        font-size: 1.4rem;
    }

    .videoStrip a svg.videoPlay {
        width: 35px;
        height: 35px;
    }
}

/* === CONTACT FORM === */
@media only screen and (max-width: 767px) {
    #hpContactForm {
        padding: 15px;
    }

    #hpContactForm h3 {
        font-size: 1.5rem;
    }

    #hpContactForm .inputWrap {
        margin-bottom: 15px;
    }

    #hpContactForm .inputWrap input,
    #hpContactForm .inputWrap textarea {
        width: 100%;
        font-size: 1rem;
    }

    #contactForm .inputWrap input,
    #contactForm .inputWrap textarea {
        width: 100%;
    }
}

/* === FOOTER === */
@media only screen and (max-width: 767px) {
    footer {
        padding: 20px 15px;
    }

    .footerInnerWrap {
        flex-direction: column;
        align-items: center;
    }

    .footerMenu {
        text-align: center;
        margin-bottom: 15px;
    }

    .footerMenu li {
        display: inline-block;
        padding: 3px 8px;
    }

    .footerMenu li a {
        font-size: 0.9rem;
    }

    footer .socialWrapper {
        width: 100%;
        text-align: center;
        margin: 10px 0;
        padding: 10px;
    }

    footer .socialWrapper ul {
        justify-content: center;
    }

    .newsletterWrap {
        width: 100%;
        padding: 0;
        margin: 10px 0;
    }

    .newsletterWrap .inputWrap {
        width: 100%;
    }

    .newsletterWrap .inputWrap input {
        width: 100%;
    }

    .creditWrap {
        text-align: center;
        padding: 10px 0;
    }

    .bottomFooter {
        text-align: center;
    }
}

/* === INNER PAGES (About, Policy, etc.) === */
@media only screen and (max-width: 767px) {
    .innerHeader {
        height: 150px;
    }

    .innerHeader h1 {
        font-size: 2rem;
    }

    .innerHeader + .wrapper {
        padding: 0 15px;
    }

    .innerContent {
        padding: 15px 0;
    }

    .innerContent p,
    .innerContent li {
        font-size: 1rem;
        line-height: 1.7;
    }
}

/* === MODALS === */
@media only screen and (max-width: 767px) {
    .modal-dialog {
        margin: 20px auto;
        max-width: 95vw;
        width: auto;
    }

    .modal-content {
        padding: 15px;
    }

    .modal-header {
        height: auto;
        padding: 15px;
    }

    .modal-title {
        line-height: 1.4;
        font-size: 1.3rem;
    }

    button.close {
        right: 10px;
        top: 10px;
    }

    #colorPickerModal .modal-content {
        padding: 15px;
    }
}

/* === SCROLL TO TOP === */
@media only screen and (max-width: 767px) {
    .scrollToTop {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 10px;
        top: auto;
    }

    .scrollToTop svg {
        width: 40%;
        height: 40px;
    }
}

/* === ACCESSIBILITY FIXES === */
@media only screen and (max-width: 767px) {
    /* Ensure tap targets are at least 44px */
    a, button, input[type="submit"], .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Fix text readability */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* === LANDSCAPE PHONE === */
@media only screen and (max-height: 500px) and (orientation: landscape) {
    .mainSlider .owl-carousel .owl-item img {
        max-height: 50vh;
        object-fit: contain;
    }

    section.videoWrp {
        min-height: 200px;
        height: 200px;
    }

    .innerHeader {
        height: 120px;
    }
}

/* === VERY SMALL SCREENS (320px) === */
@media only screen and (max-width: 359px) {
    .headerSideMenu li {
        padding: 15px 3px;
    }

    .proInfoSide h1 {
        font-size: 1.3rem;
    }

    .itemsWrap .col-sm-6 {
        width: 100%;
    }

    footer {
        padding: 15px 10px;
    }
}
