/**
 * Site-wide phone UX — Place / AFF
 * Loaded after theme CSS so phone layouts stay readable and full-width.
 */

/* ---------- Base phone safety ---------- */
@media (max-width: 991px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body,
    #page,
    .page-wrapper,
    #site-main,
    .site-main,
    .main-content,
    .content-area,
    .site-content {
        max-width: 100% !important;
        overflow-x: clip;
    }

    img,
    video,
    iframe,
    svg {
        max-width: 100%;
        height: auto;
    }

    /* Room for fixed bottom nav */
    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .section-container,
    .section-padding > .section-container,
    .p-l-r {
        padding-inline: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .page-title {
        padding: 36px 0 22px !important;
        text-align: center;
    }

    .page-title .text-title-heading {
        font-size: clamp(22px, 6.5vw, 30px) !important;
        line-height: 1.25 !important;
        margin-bottom: 8px !important;
    }

    .page-title .breadcrumbs {
        font-size: 12px !important;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 8px;
    }

    /* Forms — large taps, full width */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    select,
    textarea,
    .form-control,
    .input-text {
        min-height: 46px;
        font-size: 16px !important; /* avoids iOS zoom */
        border-radius: 10px !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    textarea {
        min-height: 120px;
    }

    button,
    .button,
    input[type="submit"],
    .btn {
        min-height: 46px;
        border-radius: 10px !important;
    }
}

@media (max-width: 767px) {
    /* ---------- Footer phone redesign ---------- */
    #site-footer.aff-footer.aff-footer-light,
    #site-footer.aff-footer-light {
        background:
            linear-gradient(180deg, #faf9f7 0%, #f3f1ec 55%, #ebe8e1 100%) !important;
        border-top: 1px solid rgba(195, 167, 134, 0.32);
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    #site-footer.aff-footer .footer .section-padding {
        padding: 22px 0 8px !important;
    }

    #site-footer.aff-footer .footer .section-container,
    #site-footer.aff-footer .footer-bottom .section-container {
        padding-inline: 14px !important;
        max-width: 100% !important;
    }

    #site-footer.aff-footer .footer .row {
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        gap: 12px !important;
    }

    #site-footer.aff-footer .footer .row > [class*="col-"],
    #site-footer.aff-footer .aff-footer-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding: 0 !important;
        float: none !important;
        margin: 0 !important;
    }

    /* Brand hero strip */
    #site-footer.aff-footer .aff-footer-col--brand .aff-footer-brand,
    #site-footer.aff-footer .aff-footer-brand {
        text-align: center !important;
        padding: 18px 16px 16px !important;
        margin: 0 !important;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.72);
        border: 1px solid rgba(195, 167, 134, 0.22);
        box-shadow: 0 8px 24px rgba(51, 51, 51, 0.04);
    }

    #site-footer.aff-footer .aff-footer-brand img {
        width: auto !important;
        max-width: 140px !important;
        max-height: 48px !important;
        margin: 0 auto 10px !important;
        display: block !important;
    }

    #site-footer.aff-footer .aff-footer-tagline {
        display: block !important;
        margin: 0 auto 14px !important;
        max-width: 26ch;
        font-size: 12.5px !important;
        line-height: 1.55 !important;
        color: #666 !important;
        text-align: center;
    }

    #site-footer.aff-footer .aff-footer-social-main {
        margin: 0 0 14px !important;
    }

    #site-footer.aff-footer .aff-social-link {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-wrap: wrap;
        gap: 10px !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    #site-footer.aff-footer .aff-social-link li {
        float: none !important;
        margin: 0 !important;
        list-style: none !important;
    }

    #site-footer.aff-footer .aff-social-link a,
    #site-footer.aff-footer .aff-social-link span {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 6px 14px rgba(51, 51, 51, 0.12) !important;
    }

    #site-footer.aff-footer .aff-social-link a:hover,
    #site-footer.aff-footer .aff-social-link a:focus-visible {
        transform: translateY(-2px) scale(1.04) !important;
    }

    /* Language switch */
    #site-footer .aff-footer-langs {
        display: flex !important;
        justify-content: center !important;
        align-items: stretch !important;
        gap: 8px !important;
        flex-wrap: nowrap;
        margin: 0 auto !important;
        width: 100%;
        max-width: 260px;
    }

    #site-footer .aff-footer-lang {
        flex: 1 1 0;
        min-width: 0;
        min-height: 42px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 8px 10px !important;
        border-radius: 11px !important;
        border: 1px solid rgba(195, 167, 134, 0.45) !important;
        background: #fff !important;
        color: #333 !important;
        -webkit-text-fill-color: #333 !important;
        text-decoration: none !important;
        font-size: 13px !important;
        font-weight: 700;
        line-height: 1.2;
        box-shadow: none !important;
    }

    #site-footer .aff-footer-lang.is-on,
    #site-footer .aff-footer-lang:hover {
        background: linear-gradient(160deg, #d4b896 0%, #c3a786 55%, #a88b66 100%) !important;
        border-color: #c3a786 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
    }

    /* Content panels */
    #site-footer.aff-footer .aff-footer-panel {
        margin: 0 !important;
        padding: 16px 14px 14px !important;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.78);
        border: 1px solid rgba(195, 167, 134, 0.2);
        box-shadow: 0 6px 18px rgba(51, 51, 51, 0.035);
    }

    #site-footer.aff-footer .block-title,
    #site-footer.aff-footer-light .block .block-title {
        font-size: 13px !important;
        letter-spacing: 0.04em;
        text-transform: none;
        margin: 0 0 12px !important;
        padding-bottom: 8px !important;
        text-align: start;
        font-weight: 800;
        color: #333 !important;
    }

    #site-footer.aff-footer-light .block .block-title::after {
        width: 22px;
        height: 2px;
        background: #c3a786;
    }

    /* Contact rows with icons */
    #site-footer.aff-footer .aff-footer-contact-list {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: grid !important;
        gap: 8px !important;
    }

    #site-footer.aff-footer .aff-footer-contact-list li {
        margin: 0 !important;
        border: 0 !important;
    }

    #site-footer.aff-footer .aff-footer-contact-link {
        display: flex !important;
        align-items: center;
        gap: 12px;
        min-height: 48px;
        padding: 11px 12px !important;
        border-radius: 12px;
        background: #faf9f7;
        border: 1px solid rgba(195, 167, 134, 0.16);
        text-decoration: none !important;
        color: #333 !important;
        transition: background 0.2s ease, border-color 0.2s ease;
        text-align: start;
    }

    #site-footer.aff-footer .aff-footer-contact-link:active,
    #site-footer.aff-footer .aff-footer-contact-link:hover {
        background: #fff;
        border-color: rgba(195, 167, 134, 0.45);
        padding-inline-start: 12px !important;
    }

    #site-footer.aff-footer .aff-footer-ico {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #333;
        color: #fff !important;
        margin-top: 0;
    }

    #site-footer.aff-footer .aff-footer-ico i {
        font-size: 14px;
        color: #fff !important;
        line-height: 1;
    }

    #site-footer.aff-footer .aff-footer-contact-text {
        flex: 1 1 auto;
        font-size: 13.5px !important;
        line-height: 1.45 !important;
        color: #444 !important;
        word-break: break-word;
        padding-top: 0;
        text-align: start !important;
    }

    #site-footer.aff-footer .aff-footer-contact-list,
    #site-footer.aff-footer .aff-footer-contact-list li,
    #site-footer.aff-footer .aff-footer-contact-link {
        text-align: start !important;
    }

    #site-footer.aff-footer .aff-footer-social-main {
        margin: 0 0 16px !important;
    }

    /* Product chips — compact wrap */
    #site-footer.aff-footer .aff-footer-product-list {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    #site-footer.aff-footer .aff-footer-product-list li {
        margin: 0 !important;
        border: 0 !important;
        float: none !important;
        width: auto !important;
    }

    #site-footer.aff-footer .aff-footer-product-list a {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 8px 14px !important;
        border-radius: 999px !important;
        background: #fff !important;
        border: 1px solid rgba(195, 167, 134, 0.35) !important;
        color: #333 !important;
        font-size: 13px !important;
        font-weight: 600;
        line-height: 1.3 !important;
        text-decoration: none !important;
        white-space: nowrap;
    }

    #site-footer.aff-footer .aff-footer-product-list a:hover,
    #site-footer.aff-footer .aff-footer-product-list a:active {
        background: #c3a786 !important;
        border-color: #c3a786 !important;
        color: #fff !important;
        padding-inline-start: 14px !important;
    }

    /* Newsletter */
    #site-footer.aff-footer .newsletter-text {
        font-size: 13px !important;
        line-height: 1.55 !important;
        margin-bottom: 12px !important;
        text-align: start;
        color: #666 !important;
    }

    #site-footer.aff-footer .newsletter-form,
    #site-footer.aff-footer .block-newsletter .newsletter-form {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        position: relative !important;
    }

    #site-footer.aff-footer .newsletter-form input[type="email"] {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        height: 48px !important;
        min-height: 48px !important;
        border-radius: 12px !important;
        padding: 10px 14px !important;
        font-size: 16px !important;
        border: 1px solid rgba(195, 167, 134, 0.4) !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    #site-footer.aff-footer .newsletter-form .btn-submit {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        display: block !important;
        margin: 0 !important;
        transform: none !important;
    }

    #site-footer.aff-footer .newsletter-form .btn-submit input,
    #site-footer.aff-footer .newsletter-form input[type="submit"] {
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        border-radius: 12px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        background: #333 !important;
        color: #fff !important;
        border: 0 !important;
        cursor: pointer;
        text-indent: 0 !important;
        background-image: none !important;
        letter-spacing: 0.02em;
    }

    #site-footer.aff-footer .footer-bottom {
        margin-top: 10px !important;
        padding: 14px 12px 18px !important;
        text-align: center;
        background: transparent !important;
        border-top: 1px solid rgba(195, 167, 134, 0.18) !important;
    }

    #site-footer.aff-footer .footer-bottom .copyright {
        font-size: 11px !important;
        line-height: 1.6 !important;
        margin: 0 !important;
        padding: 0 4px !important;
        color: #777 !important;
    }

    /* ---------- Contact page ---------- */
    .page-contact .section-padding {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    .page-contact .block-contact-info {
        padding-inline: 4px;
    }

    .page-contact .info-items .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 18px !important;
        text-align: center !important;
    }

    .page-contact .block-contact-map iframe {
        width: 100% !important;
        min-height: 220px;
        border-radius: 12px;
    }

    .page-contact .contact-us-form .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 12px;
    }

    .page-contact .form-button,
    .page-contact .form-button .button,
    .page-contact input[type="submit"] {
        width: 100% !important;
        min-height: 48px !important;
    }

    /* ---------- Products listing ---------- */
    body.is-products .content-product-list .products-list.grid,
    body.is-products .products-list.grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin: 0 !important;
    }

    body.is-products .products-list.grid .item-product,
    body.is-products .products-list.grid .slick-slide {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        float: none !important;
        padding: 0 !important;
    }

    body.is-products .products-entry.product-wapper {
        margin: 0 !important;
        height: 100%;
    }

    body.is-products .products-content .product-title {
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    body.is-products .left-sidebar {
        margin-bottom: 14px;
    }

    body.is-products .left-sidebar .block {
        border-radius: 12px;
        padding: 12px !important;
    }

    /* ---------- About / projects ---------- */
    body.is-about .block-widget-banner .row,
    body.is-about .block-widget-banner.layout-16 .row {
        display: flex !important;
        flex-direction: column !important;
    }

    body.is-about .block-widget-banner .banner-image img {
        width: 100% !important;
        min-height: 200px !important;
        max-height: 260px;
        object-fit: cover;
        border-radius: 12px;
    }

    body.is-about .block-widget-banner .banner-wrapper-infor {
        padding: 18px 14px !important;
    }

    body.is-projects .post-entry.post-wapper .row {
        display: flex !important;
        flex-direction: column !important;
    }

    body.is-projects .post-entry .post-image2,
    body.is-projects .post-entry img.post-image2 {
        width: 100% !important;
        height: 190px !important;
        object-fit: cover !important;
        border-radius: 12px;
    }

    /* ---------- Cart / auth ---------- */
    .cart-popup,
    .form-login-register .box-form-login {
        max-width: calc(100vw - 24px) !important;
    }

    .page-login-register .content,
    .page-cart .cart-form {
        padding-inline: 4px;
    }

    /* Floating widgets clear bottom bar */
    .back-top,
    .back-top.button-show {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
        inset-inline-end: 14px !important;
        width: 44px !important;
        height: 44px !important;
    }
}

/* Large phones / small tablets in portrait */
@media (min-width: 576px) and (max-width: 991px) {
    #site-footer.aff-footer .footer .row {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px !important;
        margin: 0 !important;
    }

    #site-footer.aff-footer .aff-footer-col--brand {
        grid-column: 1 / -1;
    }

    #site-footer.aff-footer .aff-footer-col--news {
        grid-column: 1 / -1;
    }

    #site-footer.aff-footer .footer .row > [class*="col-"],
    #site-footer.aff-footer .aff-footer-col {
        width: auto !important;
        max-width: none !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }

    #site-footer.aff-footer .aff-footer-panel,
    #site-footer.aff-footer .aff-footer-brand {
        height: 100%;
    }
}

@media (max-width: 420px) {
    body.is-products .content-product-list .products-list.grid,
    body.is-products .products-list.grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .page-title .text-title-heading {
        font-size: 22px !important;
    }

    #site-footer.aff-footer .aff-footer-brand img {
        max-width: 128px !important;
    }

    #site-footer.aff-footer .aff-footer-panel {
        padding: 14px 12px 12px !important;
        border-radius: 14px;
    }

    #site-footer.aff-footer .aff-footer-product-list a {
        min-height: 38px;
        padding: 7px 12px !important;
        font-size: 12.5px !important;
    }

    #site-footer.aff-footer .aff-footer-contact-text {
        font-size: 13px !important;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .section-container,
    .section-padding > .section-container {
        padding-inline: 10px !important;
    }

    #site-footer .aff-footer-lang {
        font-size: 12px !important;
        min-height: 40px;
    }

    #site-footer.aff-footer .aff-social-link {
        gap: 8px !important;
    }

    #site-footer.aff-footer .aff-social-link a,
    #site-footer.aff-footer .aff-social-link span {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    #site-footer.aff-footer .aff-footer-tagline {
        font-size: 12px !important;
    }
}

/* ---------- Header + shared chrome (phones) ---------- */
@media (max-width: 991px) {
    #site-header .header-mobile {
        padding-inline: 10px !important;
    }

    #site-header .header-mobile .header-logo img {
        max-height: 40px !important;
        width: auto !important;
    }

    #site-header .header-mobile .header-right {
        gap: 10px !important;
    }

    #site-header .header-mobile .header-right a,
    #site-header .header-mobile .header-right button {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Product details */
    body.is-product-details .product-top-info .row {
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
    }

    body.is-product-details .product-top-info .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        padding-inline: 0 !important;
        float: none !important;
    }

    body.is-product-details .product-images img,
    body.is-product-details .products-thumb img {
        width: 100% !important;
        border-radius: 12px;
    }

    body.is-product-details .product-info {
        padding-top: 16px !important;
    }

    body.is-product-details .product-info .title,
    body.is-product-details h1.product_title,
    body.is-product-details h1.title {
        font-size: clamp(20px, 5.8vw, 26px) !important;
        line-height: 1.3 !important;
    }

    body.is-product-details .single_add_to_cart_button,
    body.is-product-details .button,
    body.is-product-details .btn-cart {
        width: 100% !important;
        min-height: 48px !important;
    }

    /* Cart / wishlist / auth */
    body.is-cart .cart-form table,
    body.is-wishlist .wishlist-table,
    .shop_table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .page-login-register .box-form-login {
        padding: 18px 14px !important;
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .page-login-register .button,
    .page-login-register input[type="submit"] {
        width: 100% !important;
        min-height: 48px !important;
    }

    /* Homepage product strip */
    body.home.is-homepage .aff-products-section .products-list,
    body.home.is-homepage .aff-products-section .slick-list {
        margin-inline: 0 !important;
    }

    body.home.is-homepage .aff-products-section .products-entry {
        border-radius: 10px;
        overflow: hidden;
    }

    body.home.is-homepage .aff-services {
        padding: 24px 12px 32px !important;
    }

    body.home.is-homepage .aff-services .row {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 0 !important;
    }

    body.home.is-homepage .aff-services .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.home.is-homepage .aff-services .box {
        border-radius: 12px;
        padding: 18px 14px !important;
        margin: 0 !important;
        text-align: start;
    }
}

@media (max-width: 767px) {
    /* Newsletter: kill theme max-width + icon-only submit */
    #site-footer.aff-footer .block-newsletter .newsletter-form,
    #site-footer .block-newsletter .newsletter-form {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        position: relative !important;
    }

    #site-footer.aff-footer .newsletter-form input[type="email"],
    #site-footer .newsletter-form input[type="email"] {
        width: 100% !important;
        max-width: 100% !important;
        padding-inline-end: 12px !important;
        height: 48px !important;
        min-height: 48px !important;
    }

    #site-footer.aff-footer .newsletter-form .btn-submit {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        display: block !important;
        margin: 0 !important;
        transform: none !important;
    }

    #site-footer.aff-footer .newsletter-form .btn-submit input,
    #site-footer.aff-footer .newsletter-form input[type="submit"] {
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
        font-weight: 700;
        background: #333 !important;
        color: #fff !important;
        border: 0 !important;
        cursor: pointer;
        text-indent: 0 !important;
        background-image: none !important;
    }

    /* Contact / about content breathing room above bottom nav */
    #site-main,
    .site-main {
        padding-bottom: 12px;
    }

    .footer .section-container {
        padding-inline: 16px !important;
    }
}
