/*
Theme Name: Vatandar Child
Description: Product discovery links and product page refinements.
Template: vatandar
Version: 1.4.2
Text Domain: vatandar-child
*/

/* Task 6: hide only the duplicated subtitle on single product pages. */
.single-product .product-stage-subtitle {
    display: none !important;
}

/* 5: the parent's specs tab is hardcoded, so hide both exact targets. */
.single-product .tab-nav-btn[onclick*="tab-specs"],
.single-product #tab-specs { display: none !important; }

/* 3: Persian glyphs with a Latin numeric value in the input. */
@font-face {
    font-family: 'Vatandar Persian Digits';
    src: url('fonts/Vazirmatn-FD-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
.single-product form.cart input.qty {
    font-family: 'Vatandar Persian Digits', 'Vazirmatn', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 400 !important;
    color: #f5e6c8 !important;
    background: transparent !important;
    border: 0 !important;
    outline: 0;
    text-align: center;
    width: 54px !important;
    min-height: 44px;
    padding: 4px !important;
    appearance: textfield;
    -moz-appearance: textfield;
}
.single-product form.cart input.qty::-webkit-inner-spin-button,
.single-product form.cart input.qty::-webkit-outer-spin-button { appearance: none; margin: 0; }
.single-product form.cart input.qty:focus-visible { outline: 2px solid #d4a853; outline-offset: 2px; border-radius: 6px; }
.single-product .child-quantity-control,
.single-product .qty-picker-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    direction: ltr;
    padding: 3px;
    background: #182310;
    border: 1px solid #7b6334;
    border-radius: 12px;
}
.single-product .child-quantity-control .quantity { margin: 0 !important; float: none !important; }
.single-product .child-quantity-control > button,
.single-product .qty-picker-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(212,168,83,.08);
    color: #edcd89;
    font: 600 1.3rem 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
.single-product .child-quantity-control > button:hover,
.single-product .qty-picker-btn:hover { background: #d4a853; color: #182310; }

/* 2: native fallback plus a themed, accessible picker controlled by JS. */
.single-product form.cart table.variations { width: 100%; margin: 12px 0 20px; }
.single-product form.cart table.variations th,
.single-product form.cart table.variations td { background: transparent; border: 0; padding: 5px 0; }
.single-product form.cart table.variations tr { display: flex; flex-direction: column; gap: 7px; }
.single-product form.cart table.variations label { color: #edcd89; font: 600 .95rem 'Vazirmatn',sans-serif; }
.single-product form.cart table.variations select {
    width: 100%;
    max-width: none !important;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid #d4a853;
    border-radius: 12px;
    background: #2a3a1f;
    color: #f5e6c8;
    font: 400 1rem 'Vazirmatn', sans-serif;
    color-scheme: dark;
}
.single-product form.cart table.variations option { background: #2a3a1f; color: #f5e6c8; }
.single-product form.cart table.variations option:hover,
.single-product form.cart table.variations option:checked { background: #d4a853; color: #182310; }
.single-product form.cart ::selection { background: #d4a853; color: #182310; }
.single-product form.cart ::-moz-selection { background: #d4a853; color: #182310; }
.single-product .child-weight-picker { position: relative; width: 100%; }
.single-product form.cart select.child-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
    clip-path: inset(50%);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.single-product .child-weight-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 54px;
    padding: 13px 17px;
    border: 1px solid #b9954c;
    border-radius: 13px;
    background: linear-gradient(135deg,#2a3a1f,#1b2913);
    color: #f5e6c8;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04),0 5px 14px rgba(0,0,0,.15);
    font: 500 1rem 'Vazirmatn',sans-serif;
    text-align: start;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.single-product .child-weight-trigger::after {
    content: '';
    width: 8px;
    height: 8px;
    border: solid #d4a853;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform .18s;
    margin: -4px 3px 0;
    flex-shrink: 0;
}
.single-product .child-weight-trigger:hover,
.single-product .child-weight-trigger[aria-expanded="true"] { border-color: #f2cf83; box-shadow: 0 0 0 3px rgba(212,168,83,.12); }
.single-product .child-weight-trigger[aria-expanded="true"]::after { transform: rotate(225deg); margin-top: 4px; }
.single-product .child-weight-trigger:focus-visible { outline: 2px solid #edcd89; outline-offset: 3px; }
.single-product .child-weight-options {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 8px);
    z-index: 50;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #b9954c;
    border-radius: 13px;
    background: #1e2d16;
    box-shadow: 0 16px 36px rgba(0,0,0,.5);
}
.single-product .child-weight-options[hidden] { display: none; }
.single-product .child-weight-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin: 2px 0;
    background: transparent;
    color: #f5e6c8;
    font: 500 1rem 'Vazirmatn',sans-serif;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.single-product .child-weight-option[aria-selected="true"]::after { content: '✓'; }
.single-product .child-weight-option:hover,
.single-product .child-weight-option.is-active,
.single-product .child-weight-option[aria-selected="true"] { background: #d4a853; color: #182310; }
.single-product .child-weight-option[aria-disabled="true"] { opacity: .35; cursor: not-allowed; }
.single-product .reset_variations { color: #edcd89; display: inline-block; margin-top: 10px; font: 400 .85rem 'Vazirmatn',sans-serif; }

/* 4: apply the same gold treatment to simple and native variable buttons. */
.single-product form.cart .single_add_to_cart_button,
.single-product form.cart .single_add_to_cart_button.alt,
.single-product form.cart .single_add_to_cart_button.alt:hover {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100% !important;
    min-height: 52px !important;
    height: auto !important;
    margin: 16px 0 0 !important;
    padding: 13px 18px !important;
    border: 1px solid #d4a853 !important;
    border-radius: 13px !important;
    background: #d4a853 !important;
    color: #182310 !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.2);
    font: 700 1rem 'Vazirmatn',sans-serif !important;
    float: none !important;
    transition: background .18s, box-shadow .18s;
}
.single-product form.cart .single_add_to_cart_button:not(.disabled):not(:disabled):hover {
    background: #edc675 !important;
    border-color: #edc675 !important;
    color: #182310 !important;
    box-shadow: 0 8px 24px rgba(212,168,83,.17);
}
.single-product form.cart .single_add_to_cart_button::before,
.single-product form.cart .single_add_to_cart_button::after { content: none !important; display: none !important; }
.single-product form.cart .single_add_to_cart_button.disabled,
.single-product form.cart .single_add_to_cart_button:disabled { opacity: .58 !important; cursor: not-allowed; }
.single-product form.cart .action-purchase-row { display: block; width: 100%; }
.single-product form.cart .woocommerce-variation-price { display: none; }

/* 7: price displays share one calculation, with the currency on the left. */
.single-product .vatandar-product-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 15px;
    margin: 12px 0;
    border: 1px dashed #8f773f;
    border-radius: 14px;
    background: rgba(32,47,23,.65);
}
.single-product .product-theme--restaurant .vatandar-product-box { background: rgba(51,29,15,.65); }
.single-product .vatandar-dynamic-price,
.single-product .price-final-row { display: inline-flex; align-items: baseline; gap: 7px; direction: ltr; flex-wrap: wrap; }
.single-product .vatandar-dynamic-price { color: #edcd89; font: 700 1.3rem 'Vazirmatn',sans-serif; }
.single-product .price-final-row .price-currency { font-size: .95rem; }
.single-product .price-big-value { direction: ltr; unicode-bidi: isolate; }
.single-product .child-price-number { direction: ltr; unicode-bidi: isolate; }
.single-product .price-box-banner { min-height: 80px; }
.single-product [data-child-price] .price-currency[hidden] { display: none !important; }

/* 8: the native WooCommerce review form remains in place. */
.single-product #tab-reviews .woocommerce-verification-required {
    padding: 16px;
    border: 1px solid #8f773f;
    border-radius: 12px;
    color: #f5e6c8;
    background: rgba(32,47,23,.7);
    line-height: 1.9;
}
.single-product #review_form input:not([type="submit"]),
.single-product #review_form textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 13px;
    border: 1px solid #8f773f;
    border-radius: 10px;
    color: #f5e6c8;
    background: #1e2d16;
    font: 400 1rem 'Vazirmatn',sans-serif;
}
.single-product #review_form textarea { min-height: 150px; }
.single-product #review_form label,
.single-product #review_form .comment-reply-title { display: block; margin: 10px 0; color: #edcd89; }
.single-product #review_form p.stars { display: block !important; margin: 15px 0 !important; }
.single-product #review_form p.stars span { display: inline-flex; direction: ltr; gap: 9px; }
.single-product #review_form p.stars a {
    display: inline-block !important;
    position: relative;
    width: 32px !important;
    height: 36px !important;
    text-indent: -9999px;
    overflow: hidden;
    font-size: 28px;
    color: #edcd89 !important;
    text-decoration: none;
}
.single-product #review_form p.stars a::before {
    content: '☆' !important;
    font-family: 'Vazirmatn',sans-serif !important;
    font-size: 28px !important;
    text-indent: 0;
    position: absolute;
    inset: 0;
    line-height: 36px;
}
.single-product #review_form p.stars a.child-star-selected::before { content: '★' !important; }
.single-product #review_form p.stars a:focus-visible { outline: 2px solid #edcd89; border-radius: 5px; }
.single-product #review_form #submit {
    background: #d4a853 !important;
    color: #182310 !important;
    border: 1px solid #d4a853 !important;
    border-radius: 11px !important;
    padding: 12px 22px !important;
    font: 700 1rem 'Vazirmatn',sans-serif !important;
    cursor: pointer;
}
@media (max-width: 768px) {
    .single-product .vatandar-product-box { padding: 12px; gap: 10px; }
    .single-product .vatandar-dynamic-price { font-size: 1.15rem; }
    .single-product .child-weight-trigger { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
    .single-product .child-weight-trigger,
    .single-product .child-weight-option { transition: none; }
}

/* Product refinements: remove redundant badges/price and keep field labels beside controls. */
.single-product .product-origin-pill,
.single-product .price-box-banner { display: none !important; }
.single-product .child-weight-field,
.single-product .child-quantity-field {
    display: flex;
    align-items: center;
    gap: 12px;
    direction: inherit;
}
.single-product .child-weight-field { width: 100%; max-width: 420px; flex-wrap: nowrap; }
.single-product .child-weight-field .child-weight-picker { flex: 1 1 240px; min-width: 0; max-width: 300px; }
.single-product .child-field-label {
    flex: 0 0 auto;
    margin: 0 !important;
    color: #edcd89;
    font: 600 .95rem 'Vazirmatn', sans-serif;
    white-space: nowrap;
}
.single-product form.cart table.variations th[hidden],
.single-product form.cart table.variations td.label[hidden] { display: none !important; }
[dir="rtl"] .single-product .child-weight-picker { direction: rtl; }
[dir="ltr"] .single-product .child-weight-picker { direction: ltr; }
.single-product .related-card-price { direction: ltr; }
.single-product .related-card-price .price-currency { order: -1; }
.single-product .related-card-price > span:not(.price-currency) { direction: ltr; unicode-bidi: isolate; }
.single-product .trust-perks-strip { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.single-product .trust-perk-text { line-height: 1.8; }
.single-product .trust-perk-icon { display: flex; align-items: center; justify-content: center; color: #d4a853; }
.single-product .trust-perk-icon svg { width: 30px; height: 30px; display: block; }
.single-product .trust-perk-item { gap: 8px; }
.single-product .child-weight-trigger { min-height: 48px; padding: 10px 13px; gap: 10px; font-size: .93rem; }
.single-product .child-weight-trigger > span { min-width: 0; }
.single-product .child-weight-options { scrollbar-width: thin; scrollbar-color: #b9954c #1e2d16; }
.single-product .child-weight-options::-webkit-scrollbar { width: 6px; }
.single-product .child-weight-options::-webkit-scrollbar-track { background: #1e2d16; }
.single-product .child-weight-options::-webkit-scrollbar-thumb { background: #b9954c; border-radius: 6px; }
.single-product .child-quantity-field { min-width: 0; }
.single-product form.cart .child-clear-selection {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #b9954c;
    border-radius: 50%;
    background: #1e2d16;
    color: #edcd89;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.single-product form.cart .child-clear-selection[hidden] { display: none !important; }
.single-product form.cart .child-clear-selection svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}
.single-product form.cart .child-clear-selection:hover { background: #edcd89; color: #182310; border-color: #edcd89; }
.single-product form.cart .child-clear-selection:focus-visible { outline: 2px solid #edcd89; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    .single-product form.cart .child-clear-selection { transition: none; }
}
@media (max-width: 768px) {
    .single-product .trust-perks-strip { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 12px; }
    .single-product .child-weight-field,
    .single-product .child-quantity-field { gap: 10px; }
    .single-product .child-field-label { font-size: .82rem; }
    .single-product .child-weight-trigger { font-size: .85rem; padding: 10px; }
}

/* Only product descriptions; keep the last line natural in both RTL and LTR. */
.single-product :is(.product-short-description, .woocommerce-product-details__short-description, #tab-desc .description-text-body, #tab-description, #tab-additional_information),
.single-product :is(.product-short-description, .woocommerce-product-details__short-description, #tab-desc .description-text-body, #tab-description, #tab-additional_information) p {
    text-align: justify !important;
    text-align-last: start;
    text-justify: inter-word;
    -webkit-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}
/* Persian/Arabic keep words intact; English can use its language dictionary. */
html[lang^="en"] .single-product :is(.product-short-description, .woocommerce-product-details__short-description, #tab-desc .description-text-body, #tab-description, #tab-additional_information),
html[lang^="en"] .single-product :is(.product-short-description, .woocommerce-product-details__short-description, #tab-desc .description-text-body, #tab-description, #tab-additional_information) p {
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}
/* Product review cards only; checkout and archive card styles stay untouched. */
.single-product #reviews :is(.woocommerce-Reviews-title, .comment-reply-title, h2, h3) {
    color: #e5c158 !important;
    line-height: 1.8;
}
.single-product #reviews .woocommerce-noreviews { color: #fff; }
.single-product #reviews #comments ol.commentlist { padding: 0; list-style: none; }
.single-product #reviews #comments ol.commentlist li { margin: 0 0 20px; padding: 0; }
.single-product #reviews #comments ol.commentlist li .comment_container {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: clamp(16px, 3vw, 24px);
    border: 1px solid rgba(212, 175, 55, .3);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(28, 44, 20, .82), rgba(10, 19, 7, .94));
    color: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .15);
    min-width: 0;
}
.single-product #reviews #comments ol.commentlist li img.avatar {
    position: static !important;
    float: none !important;
    flex: 0 0 48px;
    width: 48px !important;
    height: 48px !important;
    padding: 2px !important;
    margin: 0 !important;
    border: 1px solid #e5c158 !important;
    border-radius: 50%;
    object-fit: cover;
    background: #14200e;
    box-sizing: border-box;
}
.single-product #reviews #comments ol.commentlist li .comment-text {
    flex: 1 1 0;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    color: #fff;
    overflow-wrap: anywhere;
}
.single-product #reviews .woocommerce-review__author { display: inline-block; direction: ltr; unicode-bidi: isolate; color: #e5c158; }
.single-product #reviews .woocommerce-review__published-date { display: inline-block; direction: rtl; unicode-bidi: isolate; color: #c8d2b8; }
.single-product #reviews #comments :is(.meta, .description, .description p) { color: #fff; line-height: 1.9; }
.single-product #reviews .star-rating { color: #e5c158; }
@media (max-width: 576px) {
    .single-product #reviews #comments ol.commentlist li .comment_container { gap: 12px; }
    .single-product #reviews #comments ol.commentlist li .star-rating { float: none; margin-block-end: 10px; }
}
/* Theme only the newly enhanced city controls, including their body dropdown. */
body.woocommerce-checkout:not(.woocommerce-order-received) :is(#billing_city_field, #shipping_city_field) .select2-selection--single {
    background: #14200e;
    border: 1px solid rgba(212, 175, 55, .5);
    border-radius: 10px;
    min-height: 48px;
    font: inherit;
}
body.woocommerce-checkout:not(.woocommerce-order-received) :is(#billing_city_field, #shipping_city_field) .select2-selection__rendered { color: #f5e6c8; line-height: 46px; padding-inline: 14px 32px; }
body.woocommerce-checkout:not(.woocommerce-order-received) :is(#billing_city_field, #shipping_city_field) .select2-selection__arrow { top: 10px; }
body.woocommerce-checkout:not(.woocommerce-order-received) .vatandar-checkout-city-dropdown { background: #14200e; color: #f5e6c8; border-color: #b9954c; border-radius: 10px; overflow: hidden; font: inherit; }
body.woocommerce-checkout:not(.woocommerce-order-received) .vatandar-checkout-city-dropdown .select2-search__field { background: #1e2d16; color: #fff; border: 1px solid #b9954c; border-radius: 7px; font: inherit; }
body.woocommerce-checkout:not(.woocommerce-order-received) .vatandar-checkout-city-dropdown .select2-results__option { padding: 10px 14px; color: #f5e6c8; }
body.woocommerce-checkout:not(.woocommerce-order-received) .vatandar-checkout-city-dropdown :is(.select2-results__option--highlighted, .select2-results__option[aria-selected="true"]) { background: #d4a853; color: #14200e; }
/* Classic checkout only; receipts/cart/account keep their existing layout. */
body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout .woocommerce-billing-fields__field-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
    align-items: start;
}
body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout .woocommerce-billing-fields__field-wrapper::before,
body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout .woocommerce-billing-fields__field-wrapper::after { content: none; }
body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout .woocommerce-billing-fields__field-wrapper > .form-row {
    float: none !important;
    width: 100% !important;
    min-width: 0;
    padding: 0 !important;
    margin: 0 !important;
    clear: none;
}
body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout .woocommerce-billing-fields__field-wrapper .select2-selection--single {
    background: #14200e;
    border: 1px solid rgba(212, 175, 55, .5);
    border-radius: 10px;
    min-height: 48px;
    font: inherit;
}
body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout .woocommerce-billing-fields__field-wrapper .select2-selection__rendered { color: #f5e6c8; line-height: 46px; padding-inline: 14px 32px; }
body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout .woocommerce-billing-fields__field-wrapper .select2-selection__arrow { top: 10px; }
body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout .woocommerce-billing-fields__field-wrapper > .form-row-wide,
body.woocommerce-checkout:not(.woocommerce-order-received) .vatandar-default-address-notice { grid-column: 1 / -1; }
body.woocommerce-checkout:not(.woocommerce-order-received) .vatandar-default-address-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, .3);
    border-radius: 10px;
    background: rgba(212, 175, 55, .07);
    color: #c8d2b8;
    font-size: .85rem;
    line-height: 1.9;
}
body.woocommerce-checkout:not(.woocommerce-order-received) .vatandar-default-address-notice > :first-child { flex-shrink: 0; }
body.woocommerce-checkout:not(.woocommerce-order-received) #order_review .woocommerce-shipping-totals :is(th, td) {
    vertical-align: top !important;
    padding-block: 8px !important;
}
body.woocommerce-checkout:not(.woocommerce-order-received) #order_review .woocommerce-shipping-totals.vatandar-shipping-compact th { display: none; }
body.woocommerce-checkout:not(.woocommerce-order-received) #order_review .vatandar-shipping-label { display: block; margin-bottom: 6px; color: #d4a853; font-weight: 700; text-align: start; }
body.woocommerce-checkout:not(.woocommerce-order-received) #order_review ul#shipping_method {
    display: grid;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}
body.woocommerce-checkout:not(.woocommerce-order-received) #order_review ul#shipping_method li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    min-height: 44px !important;
    box-sizing: border-box;
    line-height: 1.5 !important;
}
body.woocommerce-checkout:not(.woocommerce-order-received) #order_review ul#shipping_method li input[type="radio"] { flex-shrink: 0; margin: 4px 0 0 !important; accent-color: #d4a853; }
body.woocommerce-checkout:not(.woocommerce-order-received) #order_review ul#shipping_method li label {
    flex: 1 1 0;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.6 !important;
    text-align: start;
    overflow-wrap: anywhere;
    cursor: pointer;
    color: #f5e6c8;
}
@media (max-width: 767px) {
    body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout .woocommerce-billing-fields__field-wrapper { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
