/* ==========================================================================
   Cotton Trend: cart, checkout, order received, my account, order tracking.
   WordPress / WooCommerce glue on top of pages.css, account.css and track-size.css.
   Neutral palette only.
   ========================================================================== */

/* ---------- Shared ---------- */
.woocommerce form .field.form-row { margin: 0; }
.field .optional { font-weight: 400; }
.field.woocommerce-invalid input, .field.woocommerce-invalid textarea, .field.woocommerce-invalid select,
.field.woocommerce-invalid .acc-pw input { border-color: var(--sale); box-shadow: 0 0 0 3px rgba(185,65,47,.1); }
.field.woocommerce-invalid .field__err { display: block; }
.field.woocommerce-invalid .field__hint { display: none; }
.field:has(.checkout-inline-error-message) .field__err { display: none; }
.checkout-inline-error-message { font-size: 12px; color: var(--sale); margin: 0; }
.field.woocommerce-validated input:not(:focus) { border-color: #9CC2AD; }
.blockUI.blockOverlay { border-radius: inherit; }
.is-busy { opacity: .6; pointer-events: none; transition: opacity .2s; }
[aria-busy="true"] { opacity: .75; cursor: progress; }
.flow-body .woocommerce-notices-wrapper:not(:empty) { margin-bottom: 20px; }
.flow-body, .acc-body, .acc-auth, .track-wrap { overflow-x: clip; }

/* ---------- Header on checkout: keep the bag icon ---------- */
.page-checkout .header-actions a.icon-btn[href*="cart"] { display: grid !important; }

/* ---------- Cart ---------- */
.ct-cart__main { min-width: 0; }
.cart-item__img { align-self: start; }
.ct-cart .free-bar p { margin: 0; }
.ct-cart__actions { height: 0; overflow: hidden; }
.cart-item__unit .woocommerce-Price-amount { font-weight: 500; }
.cart-item__meta { flex-wrap: wrap; }
.cart-item .product-remove .remove { font-size: 13px; }
.cart-item .ct-qty-one { font-size: 13px; color: var(--muted); }
.cart-item .qty input.qty { padding: 0; min-height: 0; border: 0; }
.back-link { margin-top: 24px; }
.cart-empty__ic { width: 64px; height: 64px; border-radius: 50%; background: var(--stone); display: grid; place-items: center; }
.cart-empty__ic .icon { width: 26px; height: 26px; }
.ct-cart--empty .cross { max-width: 1000px; margin-inline: auto; }
.mini-card { min-width: 0; }
.mini-card div { min-width: 0; }
.mini-card .added_to_cart { display: none; }
.cart_totals .totals .shipping dt { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; }
.cart_totals .promo-code__applied .link-btn { font-size: 13px; }
.cart_totals .wc-proceed-to-checkout:empty { display: none; }
.coupon-error-notice { grid-column: 1 / -1; font-size: 13px; color: var(--sale); }
.promo-code__field input[aria-invalid="true"] { color: var(--sale); }
.summary .checkout-button .icon, .summary .btn--wa .icon { transform: none; }

/* ---------- Checkout ---------- */
.flow-grid--checkout > .woocommerce-message, .flow-grid--checkout > .woocommerce-error,
.flow-grid--checkout > .woocommerce-info, .flow-grid--checkout > .woocommerce-NoticeGroup { grid-column: 1 / -1; }
.checkout.woocommerce-checkout { min-width: 0; }
.checkout .woocommerce-NoticeGroup { grid-column: 1 / -1; }
.ct-co-details { display: grid; gap: 14px; }
.ct-hidden-field { display: none; }
/* Payment block and place-order button sit in the form's own grid, with "Save my details" before the button. */
#order_review.ct-co-payment, #order_review.ct-co-payment > #payment { display: contents; }
#payment .place-order { order: 10; display: grid; gap: 12px; margin: 0; }
#payment .co-sec { order: 0; }
.ct-co-account { display: grid; gap: 12px; }
.ct-co-account .create-account { padding: 18px; border-radius: 10px; background: var(--stone); }
.ct-co-account .create-account .field__hint { margin: 0; }
ul.payment_methods { list-style: none; margin: 0; padding: 0; }
ul.payment_methods li { list-style: none; }
ul.payment_methods .payment_box { margin: 8px 0 2px; padding: 14px 16px; border-radius: 8px; background: var(--stone); font-size: 14px; }
ul.payment_methods .payment_box p:last-child { margin-bottom: 0; }
.choice__icon { display: flex; gap: 4px; align-items: center; }
.choice__icon img { max-height: 24px; width: auto; }
.choice__body small { overflow-wrap: anywhere; }
.ct-ship-choices .choices + .choices { margin-top: 10px; }
.ct-ship-hidden { display: none; }
.co-sec .fields + .choices { margin-top: 16px; }
.co-instruction { margin: 0 0 16px; text-align: center; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.co-mobile-summary { display: none; }
.co-mobile-summary__toggle { display: none; }
.co-mobile-summary h2 { font-size: 16px; margin: 0 0 12px; }
.co-mobile-summary ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.co-mobile-summary li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.co-mobile-summary li img { width: 44px; height: 52px; object-fit: cover; border-radius: 6px; flex: none; }
.co-mobile-summary li > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 1px; }
.co-mobile-summary li b { font-weight: 600; }
.co-mobile-summary li small { color: var(--muted); font-size: 12px; }
.co-mobile-summary__totals { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.co-mobile-summary__totals div { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.co-mobile-summary__grand { font-weight: 700; color: var(--ink) !important; font-size: 15.5px; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 999px) {
  .co-mobile-summary__toggle { display: flex; margin: 16px 0 0; }
  .co-mobile-summary { display: none; margin: 10px 0 0; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
  .co-mobile-summary.is-open { display: block; }
  .summary--checkout, .flow-grid--checkout > .sum-toggle { display: none; }
}
.page-checkout .wa-float { display: none; }
.ct-co-details .field input::placeholder,
.ct-co-details .field textarea::placeholder { color: #A6A6A2; opacity: 1; }
.co-terms-check { margin: 4px 0 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.co-terms-check .check__box { margin-top: 2px; }
.co-terms-check__text { flex: 1; }
.co-terms-check a { text-decoration: underline; }
.ct-ship-pkg { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.ct-ship-empty { font-size: 14px; color: var(--ink-2); padding: 14px 16px; border-radius: 8px; background: var(--stone); margin: 0; }
.ct-place-order::before { content: ""; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat; }
.ct-place-order { gap: 10px; }
.co-terms { font-size: 12.5px; color: var(--muted); text-align: center; margin: 0; }
.co-terms a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.woocommerce-terms-and-conditions-wrapper { font-size: 12.5px; color: var(--muted); }
.woocommerce-terms-and-conditions-wrapper .woocommerce-privacy-policy-text p { margin: 0; }
.woocommerce-terms-and-conditions-wrapper a { text-decoration: underline; text-underline-offset: 2px; }
.woocommerce-terms-and-conditions-wrapper .form-row { display: flex; gap: 8px; margin: 8px 0 0; }
.ct-review .sum-items { margin-bottom: 4px; }
.ct-review .totals { padding-top: 16px; border-top: 1px solid var(--stone-2); }
.ct-review .totals .link-btn { font-size: 12px; margin-left: 4px; }
.sum-item__name { min-width: 0; overflow-wrap: anywhere; }
.ct-co-coupon .link-btn { font-size: 13px; }
.checkout_coupon.promo-code { margin-top: -4px; }
.sum-toggle .ct-co-total { justify-self: end; font-weight: 700; }
.ct-co-login { display: grid; gap: 12px; justify-items: start; max-width: 520px; }
@media (max-width: 999px) {
  .summary--checkout { order: -1; }
}

/* ---------- Thank you ---------- */
.ty-hero--failed { background: #F6E3DF; }
.ty-hero--failed .ty-hero__check { background: var(--sale); }
.ty-pay--actions { gap: 10px; }
.ty-pay b span, .ty-pay b bdi { font-size: inherit; color: inherit; }
.ty-gateway { font-size: 14px; }
.ty-gateway h2 { font-size: 18px; }
.ty-account input[type="email"] { flex-basis: 100%; }
.ty-card--dark .acc-copy-btn { flex: none; }
.ref-code { min-width: 0; }
.ref-code span[data-ref-code] { min-width: 0; overflow-wrap: anywhere; }
.ty-hero { min-width: 0; }
.ty-hero > div { min-width: 0; }
.ty-meta dd { overflow-wrap: anywhere; }

/* ---------- Account: layout ---------- */
.ct-acc-layout > .woocommerce { display: contents; }
.ct-acc-layout > .woocommerce > .woocommerce-notices-wrapper,
.ct-acc-layout > .woocommerce > .woocommerce-message,
.ct-acc-layout > .woocommerce > .woocommerce-error,
.ct-acc-layout > .woocommerce > .woocommerce-info { grid-column: 1 / -1; }
.woocommerce-MyAccount-content { min-width: 0; display: grid; gap: 24px; align-content: start; }
.woocommerce-MyAccount-content > .woocommerce-notices-wrapper:empty { display: none; }
.acc-nav__list { list-style: none; margin: 0; padding: 0; }
.acc-nav__list a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.acc-nav__list a[aria-current="page"] .acc-nav__count { background: rgba(255,255,255,.18); color: #fff; }
@media (min-width: 960px) {
  .acc-nav__list a[aria-current="page"]:hover { background: var(--ink-2); }
}
.acc-hello .muted .link-btn { font-size: inherit; }
.acc-stats { list-style: none; padding: 0; margin: 0; }
.acc-stats li { min-width: 0; }
.acc-stats__n { overflow-wrap: anywhere; }
.acc-latest .acc-status { font-size: 12px; }
.acc-thumbs { list-style: none; padding: 0; margin: 0; }
.acc-kid header form { margin: 0; }
.acc-kid__remove .icon { width: 17px; height: 17px; }
.acc-kid-form h3 .icon { width: 20px; height: 20px; }
.ct-wish-form { margin: 0; }
ul.products.acc-products li.product .ct-media > .button { position: absolute; }

/* Orders: WooCommerce's generic button style must not win here */
.woocommerce .acc-order-actions a.button:not(.btn) { min-height: 38px; padding: 0 16px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 500; }
.woocommerce .acc-order-actions a.button:not(.btn):hover { border-color: var(--ink); }
.woocommerce .acc-order-actions a.button.track { background: var(--ink); border-color: var(--ink); color: #fff; }
.woocommerce .acc-order-actions a.button.pay { background: var(--ink); border-color: var(--ink); color: #fff; }
.acc-orders th a { text-decoration: underline; }

/* Account details */
.acc-details fieldset { border: 1px solid var(--line); }
.acc-details .fields { gap: 14px; }

/* Default WooCommerce screens inside the account (edit address, view order, payment methods) */
.woocommerce-MyAccount-content .woocommerce-address-fields__field-wrapper { display: grid; gap: 14px; }
@media (min-width: 640px) {
  .woocommerce-MyAccount-content .woocommerce-address-fields__field-wrapper { grid-template-columns: 1fr 1fr; }
  .woocommerce-MyAccount-content .woocommerce-address-fields__field-wrapper .form-row-wide { grid-column: 1 / -1; }
}
.woocommerce-MyAccount-content .woocommerce-address-fields__field-wrapper .form-row { margin: 0; }
.woocommerce-MyAccount-content .woocommerce-address-fields .ct-hidden-field { display: none; }
.woocommerce-MyAccount-content form > h2, .woocommerce-MyAccount-content > h2 { font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.02em; }
.woocommerce-MyAccount-content .woocommerce-address-fields > p:last-child { margin-top: 18px; }
.woocommerce-MyAccount-content select { -webkit-appearance: none; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316191C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 15px no-repeat; padding-right: 40px; }
.woocommerce-MyAccount-content mark { background: var(--stone); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.woocommerce-MyAccount-content table.shop_table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.woocommerce-MyAccount-content table.shop_table th, .woocommerce-MyAccount-content table.shop_table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.woocommerce-MyAccount-content .woocommerce-customer-details address { font-style: normal; line-height: 1.6; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.woocommerce-MyAccount-content .woocommerce-order-details, .woocommerce-MyAccount-content .woocommerce-customer-details { display: grid; gap: 14px; }
.woocommerce-MyAccount-content .order-again .button { width: auto; }

/* ---------- Log in / lost password ---------- */
.ct-acc-notices:empty, .ct-acc-notices > .woocommerce-notices-wrapper:empty { display: none; }
.ct-acc-notices { margin-top: 18px; }
.ct-acc-notices .woocommerce-error, .ct-acc-notices .woocommerce-message, .ct-acc-notices .woocommerce-info { margin: 0; }
.ct-acc-gap { height: 22px; }
.acc-form .field input { min-height: 48px; }
.acc-form .woocommerce-privacy-policy-text p { font-size: 12.5px; color: var(--muted); margin: 0; }
.acc-form .woocommerce-privacy-policy-text a { text-decoration: underline; }
.acc-otp[hidden] { display: none; }
.acc-switch[aria-expanded="true"] { background: var(--stone); }
.ct-auth-simple .container { display: grid; }
.ct-auth-simple .acc-panel { gap: 16px; }
.ct-auth-simple form { display: grid; gap: 14px; }
.ct-auth-simple form .form-row { margin: 0; }
.ct-auth-simple form .button { width: 100%; }
.ct-auth-simple .acc-foot { margin-top: 6px; }

/* ---------- Order tracking ---------- */
.ct-track > .woocommerce-error, .ct-track > .woocommerce-message, .ct-track > .woocommerce-info { margin-bottom: 20px; }
.track-chip--still { background: #EEF5F0; color: #2F7A55; }
.track-chip--still i { display: none; }
.track-stopped { margin: 24px 0; padding: 14px 16px; border-radius: 10px; background: var(--stone); font-size: 14px; color: var(--ink-2); }
.track-steps__item .icon, .track-steps__dot span { line-height: 1; }
.track-address { overflow-wrap: anywhere; }
.track-result .tl b { overflow-wrap: anywhere; }
.track-form__actions .btn .icon { transform: none; }
.track-help .channel { min-width: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
  .flow-head .page-title { font-size: 30px; }
  .cart-item { gap: 14px; }
  .cart-item__top { flex-direction: column; gap: 6px; }
  .cart-item__actions { gap: 14px; }
  .co-sec { padding: 18px 16px; }
  .choice { gap: 12px; padding: 14px; }
  .summary__box { padding: 20px 16px; }
  .ty-pay { min-width: 0; }
  .ty-pay b { font-size: 28px; }
  .ref-code { flex-wrap: wrap; border-radius: 16px; padding: 10px 12px; }
  .acc-kid__meta { grid-template-columns: 1fr 1fr; }
  .track-dl div { grid-template-columns: 84px minmax(0, 1fr); }
}

/* Copy button on the dark referral card (account.css is not loaded on the thank you page) */
.ty-card--dark .acc-copy-btn { background: #fff; color: var(--ink); border-color: #fff; min-height: 44px; padding: 0 18px; }
.ty-card--dark .acc-copy-btn:hover { background: var(--stone); }
.ty-card--dark .acc-copy-btn .icon { width: 17px; height: 17px; transform: none; }

/* Notices WooCommerce prints before the checkout template (add-to-cart, stock) */
.page-checkout main > .woocommerce > .woocommerce-notices-wrapper:not(:empty),
.page-checkout main > .woocommerce > .woocommerce-error,
.page-checkout main > .woocommerce > .woocommerce-message { width: min(100% - var(--gutter) * 2, var(--container)); margin: 20px auto 0; }
