/* ==============================================================
   THE KHATOON SHOP v5.0.2 — ACCOUNT, WHOLESALE & UTILITY STABILITY
   Fixes production components that previously depended on removed
   historical CSS. All selectors are scoped to existing theme markup.
   ============================================================== */

/* Never allow an un-sized inline icon to use the browser's 300x150 SVG size. */
.tks-account-main svg,
.tks-wholesale-main svg,
.tks-policy-page svg,
.tks-support-page svg {
    display: block;
    max-width: none;
    flex: 0 0 auto;
}

/* ---------- My Account ---------- */
.tks-account-main .tks-page-shell { padding-top: clamp(24px, 3vw, 42px); }
.tks-account-heading { margin-bottom: 24px; }
.tks-account-greeting {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--tks-muted);
}
.tks-account-greeting strong { color: var(--tks-pink); }
.tks-account-greeting a {
    min-height: 38px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--tks-pink);
    border-radius: 9px;
    color: var(--tks-pink);
    font-weight: 800;
    text-decoration: none;
}
.tks-account-content .woocommerce {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.tks-account-content .woocommerce-MyAccount-navigation,
.tks-account-content .woocommerce-MyAccount-content {
    float: none !important;
    width: 100% !important;
    min-width: 0;
}
.tks-account-dashboard { display: grid; gap: 18px; min-width: 0; }
.tks-account-welcome {
    margin: 0;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #f0dce4;
    border-radius: 16px;
    background: var(--tks-pink-pale);
}
.tks-account-welcome > span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    border: 2px solid var(--tks-pink);
    border-radius: 50%;
    background: #fff;
    color: var(--tks-pink);
}
.tks-account-welcome > span svg { width: 25px; height: 25px; }
.tks-account-welcome h2 { margin: 0; color: var(--tks-pink); font: 700 26px/1.15 var(--tks-serif); }
.tks-account-welcome h2 span { color: inherit; }
.tks-account-welcome p { margin: 4px 0 0; color: var(--tks-muted); }
.tks-mobile-account-profile-arrow,
.tks-mobile-account-orders-heading,
.tks-mobile-account-heading,
.tks-account-support-links { display: none; }
.tks-account-dashboard__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
    min-width: 0;
}
.tks-account-dashboard__main,
.tks-account-dashboard__side { min-width: 0; }
.tks-account-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.tks-account-summary-card {
    min-width: 0;
    min-height: 156px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid var(--tks-border);
    border-radius: 14px;
    background: #fff;
    color: var(--tks-ink);
    text-decoration: none;
    box-shadow: var(--tks-shadow-sm);
}
.tks-account-summary-card > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--tks-pink-soft);
    color: var(--tks-pink);
}
.tks-account-summary-card svg { width: 23px; height: 23px; }
.tks-account-summary-card > strong { margin-top: 10px; font-size: 25px; line-height: 1; }
.tks-account-summary-card > em { margin-top: 5px; color: var(--tks-ink); font-size: 13px; font-style: normal; font-weight: 800; }
.tks-account-summary-card > small { margin-top: auto; padding-top: 8px; color: var(--tks-pink); font-weight: 800; }
.tks-recent-orders,
.tks-account-details-card,
.tks-account-quick-links,
.tks-account-support-links {
    border: 1px solid var(--tks-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--tks-shadow-sm);
}
.tks-recent-orders { padding: 18px; }
.tks-section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.tks-section-heading-row h2 { margin: 0; font: 700 27px/1.1 var(--tks-serif); }
.tks-section-heading-row a { color: var(--tks-pink); font-weight: 800; text-decoration: none; }
.tks-orders-table-wrap { max-width: 100%; overflow-x: auto; }
.tks-orders-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tks-orders-table-wrap th { padding: 10px; background: #f8f5f7; color: #554d52; text-align: left; white-space: nowrap; }
.tks-orders-table-wrap td { padding: 11px 9px; border-top: 1px solid var(--tks-border); vertical-align: middle; }
.tks-orders-table-wrap td:last-child a { color: var(--tks-pink); font-weight: 800; }
.tks-order-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #f0edef; color: #5e575b; font-size: 11px; font-weight: 850; }
.tks-order-status--completed { background: #e8f7ee; color: var(--tks-success); }
.tks-order-status--processing { background: #fff2df; color: var(--tks-warning); }
.tks-order-status--cancelled,
.tks-order-status--failed { background: #f2ecef; color: var(--tks-error); }
.tks-account-dashboard__side { display: grid; gap: 15px; }
.tks-account-details-card { padding: 18px; background: var(--tks-pink-pale); border-color: #f0d6e0; }
.tks-account-details-card h2,
.tks-account-quick-links h2,
.tks-account-support-links h2 { margin: 0 0 12px; font: 700 24px/1.1 var(--tks-serif); }
.tks-account-details-card p { margin: 10px 0; display: flex; align-items: flex-start; gap: 9px; color: #514a4e; font-size: 13px; overflow-wrap: anywhere; }
.tks-account-details-card p span { color: var(--tks-pink); }
.tks-account-details-card p svg { width: 18px; height: 18px; }
.tks-account-details-card .tks-button { width: 100%; margin-top: 8px; }
.tks-account-quick-links,
.tks-account-support-links { padding: 18px; }
.tks-account-quick-links a,
.tks-account-support-links a {
    min-height: 42px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--tks-border);
    color: var(--tks-ink);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}
.tks-account-quick-links a:first-of-type,
.tks-account-support-links a:first-of-type { border-top: 0; }
.tks-account-quick-links a b,
.tks-account-support-links a b { color: var(--tks-pink); font-size: 20px; }

/* ---------- Wholesale ---------- */
.tks-wholesale-main .tks-page-shell { padding-top: clamp(24px, 3vw, 42px); }
.tks-wholesale-hero {
    min-height: 480px;
    padding: clamp(24px, 3.5vw, 48px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    align-items: center;
    gap: 28px;
    border: 1px solid #f1d7e0;
    border-radius: 24px;
    background: linear-gradient(115deg, #fff 0%, #fff7fa 58%, #fde8f0 100%);
    overflow: hidden;
}
.tks-wholesale-hero h1 { margin: 0; font: 700 clamp(42px, 5vw, 70px)/.98 var(--tks-serif); letter-spacing: -.04em; }
.tks-wholesale-hero h1 em { color: var(--tks-pink); }
.tks-wholesale-hero__copy > p { max-width: 690px; margin: 18px 0; color: var(--tks-muted); font-size: clamp(16px, 1.25vw, 19px); }
.tks-wholesale-hero__points { margin: 18px 0 22px; display: flex; flex-wrap: wrap; gap: 9px; }
.tks-wholesale-hero__points span { min-height: 38px; padding: 8px 11px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #f1ccd9; border-radius: 999px; background: #fff; font-size: 13px; font-weight: 800; }
.tks-wholesale-hero__points svg { width: 18px; height: 18px; color: var(--tks-pink); }
.tks-wholesale-collage { position: relative; min-height: 400px; isolation: isolate; }
.tks-wholesale-collage::before { content: ""; position: absolute; z-index: -1; inset: 10% 5%; border-radius: 50%; background: radial-gradient(circle, rgba(255,15,104,.16), transparent 65%); }
.tks-wholesale-product { position: absolute; width: 31%; aspect-ratio: 1; display: block; overflow: hidden; border: 1px solid rgba(212,175,55,.55); border-radius: 16px; background: rgba(255,255,255,.92); box-shadow: 0 18px 36px rgba(57,24,39,.14); transform: rotate(-3deg); }
.tks-wholesale-product img { width: 100%; height: 100%; padding: 7px; display: block; object-fit: contain; }
.tks-wholesale-product--1 { left: 5%; top: 5%; }
.tks-wholesale-product--2 { left: 35%; top: 0; transform: rotate(3deg); }
.tks-wholesale-product--3 { right: 2%; top: 10%; }
.tks-wholesale-product--4 { left: 0; top: 38%; transform: rotate(4deg); }
.tks-wholesale-product--5 { left: 33%; top: 34%; z-index: 2; width: 35%; }
.tks-wholesale-product--6 { right: 0; top: 42%; transform: rotate(-4deg); }
.tks-wholesale-product--7 { left: 15%; bottom: 0; }
.tks-wholesale-product--8 { right: 13%; bottom: 0; transform: rotate(4deg); }
.tks-wholesale-layout { margin-top: 26px; }
.tks-card-heading { margin-bottom: 20px; display: flex; align-items: flex-start; gap: 14px; }
.tks-card-heading > span { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 48px; border-radius: 50%; background: var(--tks-pink); color: #fff; }
.tks-card-heading > span svg { width: 24px; height: 24px; }
.tks-card-heading h2 { margin: 0; font: 700 31px/1.1 var(--tks-serif); }
.tks-card-heading p { margin: 5px 0 0; color: var(--tks-muted); }
.tks-wholesale-form .tks-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.tks-wholesale-form .tks-form-grid .is-full { grid-column: 1 / -1; }
.tks-wholesale-form .tks-form-grid label,
.tks-wholesale-form .tks-form-grid fieldset { min-width: 0; }
.tks-wholesale-form .tks-form-grid label > span,
.tks-wholesale-form .tks-category-checks legend { display: block; margin-bottom: 6px; color: var(--tks-ink); font-weight: 800; }
.tks-wholesale-form .tks-form-grid label b { color: var(--tks-pink); }
.tks-wholesale-form .tks-form-grid input,
.tks-wholesale-form .tks-form-grid select,
.tks-wholesale-form .tks-form-grid textarea { width: 100%; min-height: 50px; padding: 11px 13px; border: 1px solid var(--tks-border); border-radius: 11px; background: #fff; color: var(--tks-ink); }
.tks-wholesale-form .tks-form-grid textarea { resize: vertical; }
.tks-wholesale-form .tks-form-grid input:focus,
.tks-wholesale-form .tks-form-grid select:focus,
.tks-wholesale-form .tks-form-grid textarea:focus { border-color: var(--tks-pink); box-shadow: 0 0 0 3px rgba(255,15,104,.10); outline: 0; }
.tks-honeypot { position: absolute !important; left: -99999px !important; }
.tks-business-types article > span { width: 48px; height: 48px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--tks-pink); }
.tks-business-types article > span svg { width: 24px; height: 24px; }
.tks-business-types article strong { display: block; }
.tks-business-types article p { margin: 5px 0 0; color: var(--tks-muted); font-size: 13px; }

/* ---------- Policy and support pages ---------- */
.tks-policy-page .tks-policy-card { min-height: 0; }
.tks-policy-card svg,
.tks-policy-highlight svg { width: 22px; height: 22px; }
.tks-support-page .tks-home-faq,
.tks-support-page .tks-track-order-card { margin-top: 0; }

@media (max-width: 1180px) {
    .tks-account-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tks-account-dashboard__grid { grid-template-columns: 1fr; }
    .tks-account-dashboard__side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tks-account-support-links { display: block; }
    .tks-wholesale-hero { grid-template-columns: 1fr 1fr; }
    .tks-business-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .tks-account-content .woocommerce { display: block; }
    .tks-account-content .woocommerce-MyAccount-navigation { margin-bottom: 16px; }
    .tks-account-dashboard__side { grid-template-columns: 1fr; }
    .tks-wholesale-hero { grid-template-columns: 1fr; min-height: 0; }
    .tks-wholesale-collage { min-height: 365px; }
    .tks-wholesale-layout { grid-template-columns: 1fr; }
    .tks-wholesale-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .tks-wholesale-contact-card { margin-top: 0; }
    .tks-business-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .tks-account-heading { align-items: flex-start; }
    .tks-account-greeting { justify-content: flex-start; }
    .tks-account-content .woocommerce-MyAccount-navigation ul { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
    .tks-account-content .woocommerce-MyAccount-navigation li { flex: 0 0 auto; }
    .tks-account-content .woocommerce-MyAccount-navigation li a { min-height: 42px !important; border: 1px solid var(--tks-border) !important; border-radius: 999px !important; white-space: nowrap; }
    .tks-account-welcome { align-items: flex-start; }
    .tks-account-welcome h2 { font-size: 23px; }
    .tks-mobile-account-profile-arrow { margin-left: auto; display: inline-flex; color: var(--tks-pink); font-size: 30px; text-decoration: none; }
    .tks-mobile-account-orders-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .tks-mobile-account-orders-heading h2 { margin: 0; font: 700 24px/1.1 var(--tks-serif); }
    .tks-mobile-account-orders-heading a { color: var(--tks-pink); font-weight: 800; text-decoration: none; }
    .tks-account-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tks-account-summary-card { min-height: 140px; }
    .tks-orders-table-wrap table,
    .tks-orders-table-wrap tbody,
    .tks-orders-table-wrap tr,
    .tks-orders-table-wrap td { display: block; }
    .tks-orders-table-wrap thead { display: none; }
    .tks-orders-table-wrap tr { margin-bottom: 10px; padding: 10px; border: 1px solid var(--tks-border); border-radius: 11px; }
    .tks-orders-table-wrap td { padding: 7px !important; display: flex !important; justify-content: space-between; gap: 14px; border: 0 !important; }
    .tks-orders-table-wrap td::before { content: attr(data-label); font-weight: 800; color: #554d52; }
    .tks-wholesale-hero { padding: 22px 18px; border-radius: 18px; }
    .tks-wholesale-hero h1 { font-size: 43px; }
    .tks-wholesale-collage { min-height: 310px; }
    .tks-wholesale-form-card { padding: 18px; }
    .tks-card-heading h2 { font-size: 27px; }
    .tks-wholesale-form .tks-form-grid { grid-template-columns: 1fr; }
    .tks-wholesale-form .tks-form-grid .is-full { grid-column: auto; }
    .tks-wholesale-side { grid-template-columns: 1fr; }
    .tks-business-types { grid-template-columns: 1fr; padding: 18px; }
    .tks-business-types article { padding: 16px; border-right: 0; border-top: 1px solid #f0dce4; }
}

@media (max-width: 420px) {
    .tks-account-summary-cards { grid-template-columns: 1fr 1fr; gap: 9px; }
    .tks-account-summary-card { min-height: 132px; padding: 13px; }
    .tks-account-summary-card > strong { font-size: 22px; }
    .tks-wholesale-collage { min-height: 270px; }
}
