/*
* Mobile Responsiveness Enhancements
* Woodlog Interiors
*/

/* ========================================
   GLOBAL MOBILE FIXES
======================================== */

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
}

/* Better touch targets for mobile - only for nav items and buttons */
@media (max-width: 991px) {
    .custom-navbar-nav a,
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ========================================
   NAVIGATION / HEADER
======================================== */

/* Mobile Navigation */
@media (max-width: 991px) {
    .custom-navbar {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .custom-navbar .navbar-brand {
        font-size: 24px;
    }

    .custom-navbar .navbar-toggler {
        padding: 8px 10px;
        font-size: 1.2rem;
    }

    .custom-navbar .navbar-collapse {
        margin-top: 15px;
    }

    .custom-navbar .custom-navbar-nav li {
        margin: 8px 0;
        text-align: center;
    }

    .custom-navbar .custom-navbar-nav li a {
        padding: 10px 15px;
        display: block;
    }

    /* Dropdown in mobile */
    .dropdown-menu {
        background: #2b2018;
        border: none;
        margin-top: 10px;
        width: 100%;
        position: relative !important;
        transform: none !important;
    }

    .dropdown-item {
        padding: 12px 20px;
        text-align: center;
    }

    /* Make dropdown toggle work properly */
    .nav-item.dropdown .nav-link.dropdown-toggle {
        pointer-events: auto;
    }

    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
    }
}

/* Desktop - ensure dropdown works */
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu {
        margin-top: 0;
    }
}

/* ========================================
   HERO SECTION
======================================== */

@media (max-width: 991px) {
    .hero {
        padding: 2rem 0 0 0;
        overflow: hidden;
    }

    .hero .intro-excerpt {
        margin-bottom: 30px;
        text-align: left;
    }

    .hero h1 {
        font-size: 32px;
        margin-bottom: 20px;
        line-height: 1.2;
    }

    .hero p {
        font-size: 15px;
        margin-bottom: 20px;
    }

    .hero .btn {
        margin-bottom: 10px;
        width: auto;
        min-width: 120px;
        display: inline-block;
    }

    .hero .hero-img-wrap {
        display: none !important;
    }
}

@media (max-width: 575px) {
    .hero {
        padding: 1.5rem 0 1.5rem 0;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero .btn {
        font-size: 14px;
        padding: 10px 20px;
    }
}

/* ========================================
   PRODUCT SECTION
======================================== */

@media (max-width: 991px) {
    .product-section {
        padding: 3rem 0;
    }

    .product-section .product-item {
        margin-bottom: 30px;
    }
}

@media (max-width: 767px) {
    .product-section .product-item {
        padding-bottom: 30px;
    }

    .product-section .product-item .product-thumbnail {
        margin-bottom: 20px;
    }

    .product-section .product-item h3 {
        font-size: 15px;
    }

    .product-section .product-item strong {
        font-size: 16px !important;
    }
}

/* ========================================
   CATEGORY FILTERS (SHOP PAGE)
======================================== */

@media (max-width: 767px) {
    .category-filters {
        padding: 15px;
        margin-bottom: 20px;
    }

    .category-filters h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .category-filters .btn-filter {
        font-size: 13px;
        padding: 6px 15px;
        margin: 4px;
    }

    .product-count {
        font-size: 13px;
        margin-top: 8px;
    }
}

@media (max-width: 575px) {
    .category-filters .btn-filter {
        font-size: 12px;
        padding: 5px 12px;
        margin: 3px;
    }
}

/* ========================================
   WHY CHOOSE US SECTION
======================================== */

@media (max-width: 991px) {
    .why-choose-section {
        padding: 3rem 0;
    }

    .why-choose-section .img-wrap {
        margin-top: 30px;
        margin-bottom: 30px;
    }

    .why-choose-section .img-wrap:before {
        width: 180px;
        height: 150px;
    }

    .why-choose-section .feature {
        margin-bottom: 25px;
    }
}

@media (max-width: 767px) {
    .why-choose-section .col-6 {
        width: 100%;
    }

    .why-choose-section .feature {
        margin-bottom: 20px;
    }

    .why-choose-section .section-title {
        font-size: 28px;
    }
}

/* ========================================
   WE HELP SECTION
======================================== */

@media (max-width: 991px) {
    .we-help-section {
        padding: 3rem 0;
    }

    .we-help-section .imgs-grid {
        margin-bottom: 30px;
    }

    .we-help-section .imgs-grid:before {
        width: 150px;
        height: 130px;
    }

    .we-help-section .section-title {
        font-size: 28px;
    }
}

@media (max-width: 767px) {
    .we-help-section .custom-list li {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* ========================================
   POPULAR PRODUCTS
======================================== */

@media (max-width: 767px) {
    .popular-product {
        padding: 0 0 3rem 0;
    }

    .popular-product .product-item-sm {
        margin-bottom: 20px;
    }

    .popular-product .product-item-sm .thumbnail {
        flex: 0 0 100px;
    }

    .popular-product .product-item-sm h3 {
        font-size: 13px;
    }

    .popular-product .product-item-sm p {
        font-size: 13px;
    }
}

/* ========================================
   TESTIMONIALS
======================================== */

@media (max-width: 991px) {
    .testimonial-section {
        padding: 3rem 0 4rem 0;
    }

    .testimonial-slider-wrap .item .testimonial-block blockquote {
        font-size: 16px;
        line-height: 28px;
        padding: 0 20px;
    }

    .testimonial-slider-wrap #testimonial-nav {
        display: none !important;
    }

    .testimonial-slider-wrap .tns-nav {
        bottom: -50px;
    }

    .testimonial-slider-wrap .item .testimonial-block .author-pic img {
        max-width: 70px;
    }
}

@media (max-width: 575px) {
    .testimonial-section {
        padding: 2rem 0 3.5rem 0;
    }

    .testimonial-slider-wrap .item .testimonial-block blockquote {
        font-size: 15px;
        line-height: 26px;
        padding: 0 15px;
    }

    .testimonial-slider-wrap .item .testimonial-block .author-info h3 {
        font-size: 14px;
    }

    .testimonial-slider-wrap .item .testimonial-block .author-info .position {
        font-size: 13px;
    }

    .testimonial-slider-wrap .item .testimonial-block .author-pic img {
        max-width: 60px;
    }
}

/* ========================================
   FOOTER
======================================== */

@media (max-width: 991px) {
    .footer-section {
        padding: 40px 0;
    }

    .footer-section .subscription-form {
        margin-top: 40px;
        margin-bottom: 40px;
    }

    .footer-section .subscription-form h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .footer-section .subscription-form .form-control {
        height: 45px;
        font-size: 14px;
        margin-bottom: 10px;
    }

    .footer-section .subscription-form .btn {
        height: 45px;
        width: 100%;
    }

    .footer-section .sofa-img {
        display: none !important;
    }

    .footer-section .links-wrap {
        margin-top: 30px;
    }

    .footer-section .footer-logo-wrap .footer-logo {
        font-size: 24px;
    }

    .footer-section .copyright {
        margin-top: 20px;
    }

    .footer-section .row.g-5 {
        margin-top: 0 !important;
    }
}

@media (max-width: 575px) {
    .footer-section .links-wrap ul {
        margin-bottom: 20px;
    }

    .footer-section .custom-social {
        text-align: center;
        margin-bottom: 20px;
    }

    .footer-section .copyright p,
    .footer-section .copyright ul {
        text-align: center !important;
    }

    .footer-section .copyright ul {
        justify-content: center;
        margin-top: 10px;
    }
}

/* ========================================
   CONTACT PAGE
======================================== */

@media (max-width: 991px) {
    .untree_co-section {
        padding: 3rem 0;
    }

    .service {
        margin-bottom: 25px;
    }

    .service .service-icon {
        margin-right: 15px;
        flex: 0 0 45px;
        height: 45px;
        line-height: 45px;
        min-width: 45px;
    }

    .service .service-contents {
        flex: 1;
    }

    .service .service-contents p {
        font-size: 14px;
        line-height: 1.5;
        word-break: break-word;
    }
}

@media (max-width: 767px) {
    .service .horizontal {
        flex-direction: column;
        align-items: flex-start !important;
        text-align: left;
    }

    .service .service-icon {
        margin-bottom: 10px;
        margin-right: 0;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-control {
        height: 45px;
        font-size: 14px;
    }

    textarea.form-control {
        height: auto !important;
        min-height: 120px;
    }

    .btn-primary-hover-outline {
        width: 100%;
        padding: 12px 20px;
    }

    /* Contact form - make inputs full width */
    .col-6 {
        width: 100%;
        max-width: 100%;
    }
}

/* ========================================
   ABOUT PAGE - TEAM SECTION
======================================== */

@media (max-width: 991px) {
    .team-row {
        gap: 20px;
    }

    .team-card {
        max-width: 100%;
        margin-bottom: 20px;
    }

    .team-card .img-box {
        height: 200px;
    }

    .team-card h3 {
        font-size: 20px;
    }

    .team-card .bio {
        min-height: auto;
        margin-bottom: 10px;
    }
}

@media (max-width: 575px) {
    .team-card {
        padding: 15px;
    }

    .team-card .img-box {
        height: 180px;
    }

    .team-card h3 {
        font-size: 18px;
    }

    .team-card .position {
        font-size: 13px;
    }
}

/* ========================================
   GRID SYSTEM FIXES
======================================== */

@media (max-width: 767px) {
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .row > * {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Ensure full width on mobile for form elements */
    .col-auto {
        width: 100%;
        max-width: 100%;
    }

    .g-3 > * {
        margin-bottom: 10px;
    }
}

/* ========================================
   BUTTONS & FORMS
======================================== */

@media (max-width: 575px) {
    .hero .btn,
    .contact .btn {
        padding: 10px 20px;
        font-size: 14px;
        display: inline-block;
        width: auto;
        margin-right: 8px;
        margin-bottom: 8px;
    }

    .footer-section .btn,
    form .btn[type="submit"] {
        width: 100%;
    }
}

/* ========================================
   SPACING UTILITIES
======================================== */

@media (max-width: 767px) {
    .mb-5 {
        margin-bottom: 2rem !important;
    }

    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }

    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* ========================================
   TEXT & TYPOGRAPHY
======================================== */

@media (max-width: 767px) {
    h1 {
        font-size: 28px;
    }

    h2, .section-title {
        font-size: 24px;
    }

    h3 {
        font-size: 18px;
    }

    p {
        font-size: 14px;
        line-height: 24px;
    }
}

@media (max-width: 575px) {
    h1 {
        font-size: 24px;
    }

    h2, .section-title {
        font-size: 20px;
    }

    h3 {
        font-size: 16px;
    }
}

/* ========================================
   PREVENT OVERFLOW
======================================== */

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

/* NOTE: do not set overflow-x:hidden on .container — per the CSS spec, pairing
   overflow-x:hidden with the default overflow-y:visible forces overflow-y to
   compute as "auto", which turned every .container into a nested vertical
   scroll box (a stray scrollbar/"slider" inside the hero). Horizontal overflow
   is already clipped at the body/html level above. */

.hero-img-wrap img,
.img-wrap img,
.product-thumbnail {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* ========================================
   SHOP PAGE SPECIFIC
======================================== */

@media (max-width: 767px) {
    .product-card {
        margin-bottom: 20px;
    }

    /* Make shop items 2 columns on tablets */
    .col-md-4.col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 575px) {
    /* Make shop items 1 column on phones */
    .col-md-4.col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ========================================
   PERFORMANCE & ACCESSIBILITY
======================================== */

/* Optimize animations on mobile for performance */
@media (max-width: 767px) {
    * {
        -webkit-transition-duration: 0.2s !important;
        -o-transition-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
}

/* Ensure tappable elements have good spacing */
@media (hover: none) and (pointer: coarse) {
    a, button, input, select, textarea {
        -webkit-tap-highlight-color: rgba(107, 68, 35, 0.2);
    }
}
