/* WooCommerce layout corrections. Keep content inside its grid track rather
   than hiding overflow at the page level. */
.woocommerce :is(.checkout-flow__customer, .checkout-flow__review, .cart-collaterals,
    .account-dashboard__content, .woocommerce-MyAccount-navigation),
.yooz-shop :is(.search-box, .product-card),
.yooz-product-grid > * {
    min-width: 0;
}

.yooz-shop .yooz-shop-categories {
    width: calc(100% - 120px);
    margin-inline: 60px;
}

.yooz-shop-newsletter .bouncing {
    display: inline-block;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) > .character img {
    transform-origin: left top;
}

body.single-product > .character {
    margin-inline: 24px;
}

.woocommerce :is(.checkout-flow, .account-auth, .account-dashboard, .woocommerce-ResetPassword) {
    overflow-wrap: anywhere;
}

.woocommerce :is(.checkout-flow, .account-auth, .account-dashboard, .woocommerce-ResetPassword) form .form-row input.input-text,
.woocommerce :is(.checkout-flow, .account-auth, .account-dashboard) form .form-row textarea,
.woocommerce form.woocommerce-ResetPassword .form-row input.input-text {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #e2d6da;
    border-radius: 12px;
    background: #fff;
    font-family: IRANYekanXFaNum, sans-serif;
    line-height: 1.6;
}

.woocommerce :is(.checkout-flow, .account-auth, .account-dashboard) form .form-row input.input-text:focus,
.woocommerce :is(.checkout-flow, .account-auth, .account-dashboard) form .form-row textarea:focus,
.woocommerce form.woocommerce-ResetPassword input.input-text:focus {
    border-color: #e96f7c;
    outline: 2px solid rgba(233, 111, 124, .2);
    outline-offset: 2px;
}

.woocommerce :is(.checkout-flow, .account-dashboard) .select2-container {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
}

.woocommerce :is(.checkout-flow, .account-dashboard) .select2-selection--single {
    height: 48px;
    border: 1px solid #e2d6da;
    border-radius: 12px;
}

.woocommerce :is(.checkout-flow, .account-dashboard) .select2-selection__rendered {
    padding-inline: 13px 30px;
    font-family: IRANYekanXFaNum, sans-serif;
    line-height: 46px !important;
}

.woocommerce :is(.checkout-flow, .account-dashboard) .select2-selection__arrow {
    height: 46px;
}

.woocommerce form .password-input {
    width: 100%;
    min-width: 0;
}

.woocommerce :is(.account-auth, .account-dashboard) form .password-input input.input-text {
    padding-inline-end: 48px;
}

.woocommerce :is(.account-auth, .account-dashboard) form .show-password-input {
    top: 50%;
    inset-inline-end: 2px;
    width: 44px;
    height: 44px;
}

.woocommerce .account-auth form .woocommerce-form-login__submit {
    margin: 0;
}

/* Password recovery also appears outside the account dashboard wrapper. */
.woocommerce form.woocommerce-ResetPassword {
    box-sizing: border-box;
    width: min(620px, calc(100% - 32px));
    margin: 40px auto;
    padding: 24px;
    border: 1px solid #eee2e6;
    border-radius: 20px;
    background: #fff;
    line-height: 1.9;
}

.woocommerce form.woocommerce-ResetPassword .button {
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 12px;
    background: #e96f7c;
    color: #fff;
}

@media (max-width: 1024px) {
    body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .single-product) > .character {
        display: none;
    }

    body.woocommerce-page .site-header__inner > nav {
        display: none !important;
    }

    body.woocommerce-page .site-header__toggle {
        display: inline-flex !important;
        flex: 0 0 42px;
        color: #d95d6b;
        border-color: #e2d6da;
    }

    body.woocommerce-page .site-mobile-menu {
        display: flex !important;
        background: #ff2056;
        border-radius: 12px;
    }

    body.woocommerce-page .site-header__brand {
        min-width: 0;
    }

    body.woocommerce-page .site-header__tagline {
        min-width: 0;
        max-width: 320px;
    }

    .yooz-shop .yooz-shop-categories {
        min-width: 0;
        width: 100%;
        margin-inline: 0;
    }

    .yooz-shop .categorySwiper {
        overflow: hidden;
    }

    .yooz-shop :is(.category-swiper-button-next, .category-swiper-button-prev) {
        display: none;
    }

    .checkout-flow__grid,
    .account-dashboard__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .woocommerce .account-dashboard .woocommerce-MyAccount-navigation ul {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 6px;
    }

    .woocommerce .account-dashboard .woocommerce-MyAccount-navigation li {
        flex: 1 1 auto;
        text-align: center;
    }

    /* Bring the purchase card immediately after the gallery on stacked pages. */
    .yooz-product .yooz-product-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .yooz-product .yooz-product-details {
        display: contents;
    }

    .yooz-product .yooz-product-gallery {
        order: 1;
        margin-bottom: 0;
    }

    .yooz-product .yooz-product-purchase {
        order: 2;
    }

    .yooz-product .yooz-product-details > .content-section {
        order: 3;
        margin-bottom: 0;
    }

    .yooz-product .sticky-order {
        position: static;
    }
}

@media (max-width: 768px) {
    .woocommerce .account-auth #customer_login {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-columns: minmax(0, 1fr);
        align-items: start;
        gap: 16px;
    }

    .woocommerce .account-auth #customer_login .account-auth__card {
        box-sizing: border-box;
        width: 100%;
        padding: 22px 18px;
        border-radius: 18px;
    }

    body.woocommerce-page .site-header {
        background: #ff2056;
    }

    body.woocommerce-page .site-header__toggle {
        color: #fff;
        border-color: rgba(255, 255, 255, .38);
    }
    /* Match WooCommerce's responsive table breakpoint, including 768px. */
    .woocommerce .checkout-flow,
    .woocommerce .account-auth,
    .woocommerce .account-dashboard {
        padding: 28px 12px 40px;
    }

    .woocommerce .checkout-flow :is(.checkout-flow__customer, .checkout-flow__review, .cart_totals),
    .woocommerce .account-dashboard__content {
        padding: 18px 14px;
        border-radius: 18px;
    }

    .woocommerce .checkout-flow .woocommerce-notices-wrapper:empty {
        display: none;
    }

    .woocommerce .checkout-flow--cart .checkout-flow__heading {
        margin-bottom: 0;
    }

    .woocommerce .checkout-flow form .form-row-first,
    .woocommerce .checkout-flow form .form-row-last,
    .woocommerce .account-dashboard form .form-row-first,
    .woocommerce .account-dashboard form .form-row-last,
    .woocommerce form.woocommerce-ResetPassword .form-row-first,
    .woocommerce form.woocommerce-ResetPassword .form-row-last {
        float: none;
        width: 100%;
    }

    .woocommerce :is(.checkout-flow, .account-auth, .account-dashboard) form .form-row input.input-text,
    .woocommerce :is(.checkout-flow, .account-auth, .account-dashboard) form .form-row textarea,
    .woocommerce form.woocommerce-ResetPassword .form-row input.input-text,
    .woocommerce :is(.checkout-flow, .account-dashboard) .select2-selection__rendered,
    .select2-search input.select2-search__field {
        font-size: 16px;
    }

    .woocommerce :is(.checkout-flow, .account-dashboard, .account-auth) .button,
    .woocommerce .checkout-flow #place_order {
        min-height: 48px;
        line-height: 1.6;
        text-align: center;
        white-space: normal;
    }

    .woocommerce .checkout-flow #place_order,
    .woocommerce .account-dashboard form > p > .button,
    .woocommerce .account-auth form .button,
    .woocommerce form.woocommerce-ResetPassword .button {
        float: none;
        width: 100%;
    }

    .woocommerce .account-dashboard__content fieldset {
        min-width: 0;
        margin-top: 20px;
        padding: 16px 12px;
    }

    .woocommerce .account-dashboard__content .account-address-card .woocommerce-Address-title {
        flex-wrap: wrap;
        gap: 10px;
    }

    .woocommerce :is(.account-dashboard__content, .checkout-flow__review, .woocommerce-order) table.shop_table {
        width: 100%;
        table-layout: fixed;
        overflow-wrap: anywhere;
    }

    .woocommerce :is(.account-dashboard__content, .checkout-flow__review) table.shop_table :is(th, td) {
        padding: 12px 10px;
    }

    /* WooCommerce hides all th cells on mobile, including the order number. */
    .woocommerce .account-dashboard table.shop_table_responsive tbody th[data-title] {
        display: block;
        text-align: end !important;
        background: #fff1f3;
    }

    .woocommerce .account-dashboard table.shop_table_responsive tbody th[data-title]::before {
        float: inline-start;
        content: attr(data-title) ": ";
        font-weight: 600;
    }

    .woocommerce .account-dashboard table.shop_table_responsive .woocommerce-orders-table__cell-order-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
    }

    .woocommerce .account-dashboard .woocommerce-orders-table__cell-order-actions::before {
        margin-inline-end: auto;
    }

    .woocommerce .account-dashboard .woocommerce-orders-table .button {
        min-height: 44px;
        padding: 9px 14px !important;
        font-size: 12px;
    }

    .woocommerce .checkout-flow table.cart td.actions .coupon {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        float: none;
        gap: 8px;
        width: 100%;
        margin: 0 0 12px;
    }

    .woocommerce .checkout-flow table.cart td.actions .coupon label.screen-reader-text {
        position: absolute;
    }

    .woocommerce .checkout-flow table.cart td.actions .coupon input.input-text {
        grid-area: 1 / 1;
    }

    .woocommerce .checkout-flow table.cart td.actions .coupon .button {
        grid-area: 1 / 2;
        white-space: nowrap;
    }

    .woocommerce .checkout-flow table.cart td.actions .coupon :is(input.input-text, .button) {
        float: none;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        margin: 0;
        min-height: 48px;
    }

    .woocommerce .checkout-flow table.cart td.actions .coupon input.input-text {
        text-align: start;
        font-size: 16px;
    }

    .woocommerce .checkout-flow table.cart .product-remove a.remove {
        width: 44px;
        height: 44px;
    }

    .woocommerce .checkout-flow .quantity .qty {
        width: 76px;
        height: 48px;
        font-size: 16px;
    }

    .woocommerce .checkout-flow #payment :is(ul.payment_methods, div.form-row) {
        padding: 14px 12px;
    }

    .woocommerce .checkout-flow #payment div.payment_box {
        padding: 12px;
        line-height: 1.9;
    }

    .woocommerce :is(.checkout-receipt-card, .woocommerce-order-overview) {
        grid-template-columns: minmax(0, 1fr);
    }

    .woocommerce :is(.checkout-receipt-card, .woocommerce-order-overview) li {
        border-inline: 0 !important;
        white-space: normal;
    }

    .woocommerce form.woocommerce-ResetPassword {
        margin: 28px auto 40px;
        padding: 20px 16px;
    }

    .site-header__brand {
        min-width: 0;
        flex: 1;
    }

    .site-header__tagline {
        min-width: 0;
    }

    .site-header__toggle {
        flex: 0 0 42px;
        margin-inline-start: 10px;
    }

    .yooz-shop-hero {
        padding-block: 28px 12px;
    }

    .yooz-shop-hero h1 {
        font-size: 27px;
        line-height: 1.6;
    }

    .yooz-shop-hero p {
        font-size: 14px;
        line-height: 1.9;
    }

    .yooz-shop {
        padding: 24px 12px 32px;
    }

    .yooz-shop .yooz-shop-categories {
        min-width: 0;
        width: 100%;
        margin-inline: 0;
    }

    .yooz-shop .categorySwiper {
        overflow: hidden;
    }

    .yooz-shop :is(.category-swiper-button-next, .category-swiper-button-prev) {
        display: none;
    }

    .yooz-shop > .mb-12 {
        margin-bottom: 24px;
    }

    .yooz-shop > .mb-12 > h2 {
        font-size: 20px;
        gap: 8px;
    }

    .yooz-shop > .mb-12 > h2 img {
        width: 56px;
        max-height: 90px;
        object-fit: contain;
    }

    .yooz-shop > .bg-white {
        padding: 16px;
        margin-bottom: 24px;
    }

    .yooz-shop #searchInput {
        min-width: 0;
        min-height: 48px;
        padding-block: 10px;
        font-size: 16px;
    }

    .yooz-shop #sortBtn {
        min-height: 48px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .yooz-shop #productsGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-bottom: 24px;
    }

    /* Use normal flow for card copy, including cards returned by AJAX. */
    .yooz-shop #productsGrid .product-card > div:last-child {
        position: static;
        padding: 12px 10px;
        background: #fff;
    }

    .yooz-shop #productsGrid .product-card > div:last-child > a {
        display: block;
    }

    .yooz-shop #productsGrid .product-card h3 {
        font-size: 13px;
        line-height: 1.8;
        min-height: 47px;
    }

    .yooz-shop #productsGrid .product-card .text-base {
        font-size: 13px;
    }

    .yooz-shop #productsGrid .product-card > div:last-child > p {
        display: none;
    }

    .yooz-shop :is(#pagination, #pagination > div) {
        flex-wrap: wrap;
    }

    .yooz-shop #emptyState {
        min-height: 0;
        padding: 24px 16px;
    }

    .yooz-shop-newsletter {
        margin-top: 0;
        padding: 32px 16px;
    }

    .yooz-shop-newsletter h2 {
        font-size: 23px;
    }

    .yooz-shop-newsletter #yooz-newsletter-form > .flex {
        flex-direction: column;
        gap: 10px;
    }

    .yooz-shop-newsletter #yooz-newsletter-form :is(input, button) {
        box-sizing: border-box;
        min-width: 0;
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }

    body.single-product > .character {
        display: none;
    }

    .yooz-product {
        padding: 24px 12px;
        overflow-wrap: anywhere;
    }

    .yooz-product .breadcrumb {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 12px;
        line-height: 1.8;
    }

    .yooz-product :is(.content-section, .yooz-product-gallery, .sticky-order > div) {
        padding: 18px 16px;
        border-radius: 18px;
    }

    .yooz-product #mainGalleryImage {
        max-height: 340px;
        width: 100%;
        object-fit: contain;
    }

    .yooz-product :is(.content-section p, .spec-card, .feature-item) {
        font-size: 14px;
        line-height: 1.9;
    }

    .yooz-product .sticky-order h1 {
        font-size: 22px;
    }

    .yooz-product .sticky-order .text-4xl {
        font-size: 28px;
    }

    .yooz-product .sticky-order :is(a, button):is(.w-full) {
        min-height: 48px;
        font-size: 15px;
        padding: 12px;
        text-align: center;
    }

    .yooz-product .feature-item {
        padding: 12px;
        gap: 10px;
    }

    .yooz-product .feature-icon {
        flex: 0 0 36px;
        min-width: 0;
    }

    .yooz-product .feature-item > div:last-child {
        min-width: 0;
    }

    .yooz-product #reviews #comment {
        box-sizing: border-box;
        width: 100%;
        min-height: 140px;
        font-size: 16px;
    }

    .yooz-product #reviews #submit {
        min-height: 48px;
        width: 100%;
    }

    .contact-modal.active {
        padding: 12px;
    }

    .contact-modal .contact-modal-content {
        padding: 20px 16px;
        max-height: calc(100dvh - 24px);
    }

    .contact-modal :is(input, textarea) {
        min-width: 0;
        font-size: 16px;
    }

    .contact-modal .contact-modal-close {
        min-width: 44px;
        min-height: 44px;
    }
}
