/* VISTORA — Cart & Checkout skin (classic [woocommerce_cart]/[woocommerce_checkout]).
   Matches the site design system: rounded cards, soft shadows, purple/gold brand,
   Playfair headings. Fully responsive — the cart table stacks into cards on mobile
   and the checkout columns collapse. Tokens fall back to literal brand values. */

.woocommerce { max-width: 1040px; margin: 0 auto; }
.woocommerce-cart .woocommerce, .woocommerce-checkout .woocommerce { padding: 1rem 0 3rem; }

.woocommerce h1, .woocommerce h2, .woocommerce h3,
.woocommerce-cart h1, .woocommerce-checkout h1 {
  font-family: 'Playfair Display', Georgia, serif; color: var(--fg, #2D2D2D); font-weight: 700;
}
.lang-ar .woocommerce h1, .lang-ar .woocommerce h2, .lang-ar .woocommerce h3 { font-family: 'Cairo', sans-serif; }

/* ---------- Buttons ---------- */
.woocommerce .button, .woocommerce button.button, .woocommerce input.button, .woocommerce #place_order, .woocommerce a.button {
  background: var(--primary, #4A3B6B) !important; color: #fff !important; border: 0 !important;
  border-radius: 999px !important; padding: .8rem 1.6rem !important; font-weight: 700 !important;
  font-size: .95rem !important; box-shadow: none !important; transition: transform .2s, box-shadow .2s !important;
  text-shadow: none !important;
}
.woocommerce .button:hover, .woocommerce #place_order:hover, .woocommerce a.button:hover {
  transform: translateY(-1px); box-shadow: 0 12px 26px -14px rgba(74,59,107,.7) !important;
}
.woocommerce .button.alt, .woocommerce #place_order { background: var(--accent, #C9A961) !important; color: var(--accent-fg, #2D2D2D) !important; }
.woocommerce .wc-proceed-to-checkout .checkout-button { display: block; text-align: center; font-size: 1.05rem !important; padding: 1rem !important; }

/* ---------- Inputs ---------- */
.woocommerce form .form-row label { font-weight: 600; font-size: .85rem; color: var(--fg, #2D2D2D); margin-bottom: .35rem; }
.woocommerce form .form-row { margin: 0 0 1rem; padding: 0; }
.woocommerce input[type=text], .woocommerce input[type=email], .woocommerce input[type=tel],
.woocommerce input[type=password], .woocommerce input[type=number], .woocommerce select, .woocommerce textarea,
.woocommerce .select2-selection {
  width: 100%; box-sizing: border-box; font: inherit; color: var(--fg, #2D2D2D);
  border: 1px solid var(--border, #E5E5E5) !important; border-radius: 10px !important;
  padding: .7rem .85rem !important; min-height: 2.9rem; background: #fff;
}
.woocommerce input:focus, .woocommerce select:focus, .woocommerce textarea:focus {
  outline: none; border-color: var(--primary, #4A3B6B) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #4A3B6B) 14%, transparent) !important;
}

/* ---------- Notices (clean) ---------- */
.woocommerce-message, .woocommerce-error, .woocommerce-info {
  border: 0 !important; border-radius: 12px !important; padding: .9rem 1.15rem !important;
  margin: 0 0 1.25rem !important; font-weight: 600; list-style: none; box-shadow: none !important;
  background: #e6f4ea !important; color: #1e7e34 !important;
}
.woocommerce-error { background: #fdecea !important; color: #b3261e !important; }
.woocommerce-info  { background: #eef0f6 !important; color: #3a3a44 !important; }
.woocommerce-message::before, .woocommerce-error::before, .woocommerce-info::before { display: none !important; }
/* Hide checkout clutter: the coupon + "returning customer" login prompts, and any
   empty notice wrappers. Real error/validation messages (non-empty) still show. */
.woocommerce-form-coupon-toggle, .woocommerce-form-login-toggle { display: none !important; }
.woocommerce-checkout .woocommerce-notices-wrapper:empty,
.woocommerce-message:empty, .woocommerce-info:empty { display: none !important; }

/* ================= CART ================= */
.woocommerce-cart-form table.shop_table {
  border: 1px solid var(--border, #E5E5E5); border-radius: 16px; border-collapse: separate; border-spacing: 0;
  overflow: hidden; background: #fff; box-shadow: 0 16px 38px -30px rgba(74,59,107,.5);
}
.woocommerce-cart-form table.shop_table th {
  background: color-mix(in srgb, var(--secondary, #F5E6D3) 35%, #fff); padding: 1rem;
  font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; text-align: start;
}
.woocommerce-cart-form table.shop_table td { padding: 1rem; border-top: 1px solid color-mix(in srgb, var(--border, #E5E5E5) 70%, transparent); vertical-align: middle; }
.woocommerce-cart-form .product-thumbnail img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.woocommerce-cart-form .product-name a { color: var(--fg, #2D2D2D); font-weight: 600; text-decoration: none; }
.woocommerce-cart-form .product-name a:hover { color: var(--primary, #4A3B6B); }
.woocommerce-cart-form .product-remove a.remove {
  color: #b3261e !important; border: 1px solid #f3d2cd; width: 1.7rem; height: 1.7rem; line-height: 1.55rem;
  border-radius: 999px; font-size: 1.1rem; text-align: center;
}
.woocommerce-cart-form .product-remove a.remove:hover { background: #fdecea !important; color: #8a2b2b !important; }
.woocommerce-cart-form .quantity input.qty {
  width: 4.5rem; text-align: center; padding: .55rem .4rem !important; min-height: 2.6rem;
}
.woocommerce-cart-form .coupon { display: flex; gap: .5rem; align-items: center; }
.woocommerce-cart-form .coupon input { width: auto; flex: 1; max-width: 16rem; }
.woocommerce-cart-form td.actions { padding: 1rem; }

/* Cart totals card */
.cart-collaterals .cart_totals { float: none; width: 100%; }
.cart_totals h2 { font-size: 1.25rem; margin: 0 0 1rem; }
.cart_totals table {
  border: 1px solid var(--border, #E5E5E5); border-radius: 16px; overflow: hidden; width: 100%;
  background: #fff; box-shadow: 0 16px 38px -30px rgba(74,59,107,.5); border-collapse: separate; border-spacing: 0;
}
.cart_totals table th, .cart_totals table td { padding: .9rem 1.1rem; border-top: 1px solid color-mix(in srgb, var(--border, #E5E5E5) 70%, transparent); }
.cart_totals table tr:first-child th, .cart_totals table tr:first-child td { border-top: 0; }
.cart_totals .order-total .amount { color: var(--primary, #4A3B6B); font-size: 1.2rem; }
.wc-proceed-to-checkout { padding-top: 1.25rem !important; }

/* ===================== CHECKOUT (page-checkout.php shell) ===================== */
/* Purple hero band — matches the dark/purple heroes used across the site. */
.vp-checkout-hero { position: relative; overflow: hidden; text-align: center; color: #fff; padding: 3.25rem 0 3rem; background: linear-gradient(135deg, #3A2560 0%, #14101E 70%); }
.vp-checkout-hero::after { content: ""; position: absolute; top: -7rem; inset-inline-end: -6rem; width: 26rem; height: 26rem; border-radius: 50%; background: rgba(201,169,97,.14); filter: blur(70px); }
.vp-checkout-hero .vp-container { position: relative; }
.vp-checkout-hero .vp-eyebrow { color: var(--accent, #C9A961); margin-bottom: .6rem; }
.vp-checkout-hero .vp-checkout-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.15; color: #fff !important; margin: 0 0 1rem; }
.lang-ar .vp-checkout-title { font-family: 'Cairo', sans-serif; }
.vp-checkout-badges { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; color: rgba(255,255,255,.8); font-size: .85rem; }
.vp-checkout-badges span { display: inline-flex; align-items: center; gap: .45rem; }
.vp-checkout-badges svg { width: 16px; height: 16px; color: var(--accent, #C9A961); }
.vp-checkout-main { max-width: 1080px; padding-top: 2.5rem; padding-bottom: 4rem; }
.vp-checkout-foot { text-align: center; margin: 2rem 0 0; }
.vp-checkout-foot a { color: var(--primary, #4A3B6B); font-weight: 600; text-decoration: none; font-size: .92rem; }
.vp-checkout-foot a:hover { color: var(--accent, #C9A961); }

/* No shipping, and order notes are removed — hide those empty sections so the
   left column is purely the billing fields + the account password. */
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields { display: none !important; }
.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 { float: none; width: 100%; }

/* The two panels are the WHOLE columns: #customer_details (billing + password)
   and #order_review. The inner WooCommerce blocks are transparent so everything
   lives inside one bordered card per side. */
.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review {
  background: #fff; border: 1px solid var(--border, #E5E5E5); border-radius: 18px;
  padding: 1.75rem; box-shadow: 0 24px 50px -34px rgba(74,59,107,.55);
}
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-account-fields { background: none; border: 0; padding: 0; box-shadow: none; }
.woocommerce-checkout .woocommerce-billing-fields h3 { margin: 0 0 1.25rem; font-size: 1.15rem; }
/* Password sits inside the same card, separated by a hairline. */
.woocommerce-checkout .woocommerce-account-fields {
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--border, #E5E5E5) 70%, transparent);
}
.woocommerce-checkout #order_review_heading { display: none; } /* moved inside the card via hook */
.vp-order-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 1.25rem; }
.vp-order-title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.2rem; margin: 0; color: var(--fg, #2D2D2D); }
.lang-ar .vp-order-title { font-family: 'Cairo', sans-serif; }
.vp-order-clear { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 999px; border: 1px solid var(--border, #E5E5E5); color: var(--muted, #5A5A5A); text-decoration: none; transition: all .2s; }
.vp-order-clear svg { width: 15px; height: 15px; }
.vp-order-clear:hover { background: #fdecea; border-color: #f3c0ba; color: #b3261e; }

/* Order summary table — clean, horizontally aligned, no redundant rows. */
.woocommerce-checkout-review-order-table { border: 0 !important; width: 100%; border-collapse: collapse; }
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td { padding: .75rem 0; border: 0; vertical-align: middle; }
.woocommerce-checkout-review-order-table tbody td,
.woocommerce-checkout-review-order-table tfoot th,
.woocommerce-checkout-review-order-table tfoot td { border-top: 1px solid color-mix(in srgb, var(--border, #E5E5E5) 70%, transparent); }
/* Names/labels start-aligned, all amounts end-aligned so the column lines up. */
.woocommerce-checkout-review-order-table thead .product-name,
.woocommerce-checkout-review-order-table .cart_item .product-name,
.woocommerce-checkout-review-order-table tfoot th { text-align: start; }
.woocommerce-checkout-review-order-table thead .product-total,
.woocommerce-checkout-review-order-table .cart_item .product-total,
.woocommerce-checkout-review-order-table tfoot td { text-align: end; white-space: nowrap; }
.woocommerce-checkout-review-order-table thead th { text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; color: var(--muted, #5A5A5A); font-weight: 700; padding-top: 0; }
.woocommerce-checkout-review-order-table .cart_item .product-name { color: var(--fg, #2D2D2D); font-weight: 600; }
.woocommerce-checkout-review-order-table .order-total th { font-size: 1rem; }
.woocommerce-checkout-review-order-table .order-total .amount { color: var(--primary, #4A3B6B); font-size: 1.35rem; }
/* Drop redundant detail: per-item "× 1" (digital, always one) and the Subtotal
   row (identical to Total with no tax/shipping). Keeps the summary tidy. */
.woocommerce-checkout-review-order-table .product-quantity { display: none; }
.woocommerce-checkout-review-order-table .cart-subtotal { display: none; }

/* Payment. */
#payment { background: transparent !important; margin-top: 1.25rem; }
#payment ul.payment_methods { border: 0 !important; padding: 0 !important; margin: 0 0 1rem; list-style: none; }
#payment ul.payment_methods li { background: color-mix(in srgb, var(--secondary, #F5E6D3) 24%, #fff); border: 1px solid var(--border, #E5E5E5); border-radius: 12px; padding: .85rem 1rem; margin: 0 0 .6rem; }
#payment ul.payment_methods li label { font-weight: 700; margin: 0; }
#payment div.payment_box { background: #fff !important; border: 1px solid var(--border, #E5E5E5); border-radius: 10px; margin-top: .6rem; font-size: .85rem; color: var(--muted, #5A5A5A); }
#payment div.payment_box::before { display: none !important; }
#payment .woocommerce-terms-and-conditions-wrapper { margin: .25rem 0 1rem; font-size: .85rem; }
#payment .place-order { padding: 0 !important; margin: 0; }
#place_order { width: 100%; font-size: 1.05rem !important; padding: 1rem !important; }

/* ---------- Order received / thank-you ---------- */
.vp-thankyou { max-width: 640px; margin: 0 auto; }
.vp-thankyou-card { background: #fff; border: 1px solid var(--border, #E5E5E5); border-radius: 18px; padding: 2.5rem 2rem; text-align: center; box-shadow: 0 24px 50px -34px rgba(74,59,107,.55); }
.vp-thankyou-ic { display: inline-grid; place-items: center; width: 4.5rem; height: 4.5rem; border-radius: 50%; background: #e6f4ea; color: #1e7e34; margin: 0 0 1.25rem; }
.vp-thankyou-ic svg { width: 2.4rem; height: 2.4rem; }
.vp-thankyou-ic-fail { background: #fdecea; color: #b3261e; }
.vp-thankyou-card h1 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--fg, #2D2D2D); margin: 0 0 .5rem; }
.lang-ar .vp-thankyou-card h1 { font-family: 'Cairo', sans-serif; }
.vp-thankyou-sub { color: var(--muted, #5A5A5A); margin: 0 0 1.75rem; line-height: 1.7; }
.vp-thankyou-meta { list-style: none; margin: 0 0 1.75rem; padding: 1.25rem; display: grid; gap: .6rem; background: color-mix(in srgb, var(--secondary, #F5E6D3) 22%, #fff); border-radius: 14px; text-align: start; }
.vp-thankyou-meta li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.vp-thankyou-meta li span { color: var(--muted, #5A5A5A); }
.vp-thankyou-meta li strong { color: var(--fg, #2D2D2D); }
.vp-thankyou-cta { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.vp-thankyou .woocommerce-order-details, .vp-thankyou .woocommerce-customer-details { margin-top: 2rem; }
.vp-thankyou .woocommerce-order-details__title, .vp-thankyou .woocommerce-column__title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.15rem; }
/* Order-received customer details: WooCommerce prints the phone/email icon via a
   ::before glyph positioned with physical left margins that only flip in its own RTL
   stylesheet — which isn't loaded when the locale is flipped mid-request, so in
   Arabic the icon lands on the wrong side / overlaps the text. Apply WooCommerce's
   own RTL values (padding-right + mirrored margins) so it sits correctly. */
[dir=rtl] .woocommerce-customer-details--phone,
[dir=rtl] .woocommerce-customer-details--email,
.lang-ar .woocommerce-customer-details--phone,
.lang-ar .woocommerce-customer-details--email { padding-left: 0 !important; padding-right: 1.5em !important; }
[dir=rtl] .woocommerce-customer-details--phone::before,
[dir=rtl] .woocommerce-customer-details--email::before,
.lang-ar .woocommerce-customer-details--phone::before,
.lang-ar .woocommerce-customer-details--email::before { margin-right: -1.5em !important; margin-left: .618em !important; }
/* Hide WooCommerce's default order-overview + plain "received" line (we show our card). */
.vp-thankyou .woocommerce-thankyou-order-received, .vp-thankyou .woocommerce-order-overview { display: none; }

/* Layout: stacked (mobile) → details | sticky order summary (desktop). Both cards
   are direct grid children of form.checkout, so they top-align on every screen. */
.woocommerce-checkout form.checkout { display: grid; gap: 1.5rem; }
@media (min-width: 921px) {
  .woocommerce-checkout form.checkout { grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: start; }
  .woocommerce-checkout form.checkout #customer_details { grid-column: 1; margin: 0; }
  .woocommerce-checkout form.checkout #order_review { grid-column: 2; position: sticky; top: 1.5rem; }
}
@media (max-width: 600px) {
  .vp-checkout-main { padding-top: 1.75rem; }
  .woocommerce-checkout #customer_details, .woocommerce-checkout #order_review { padding: 1.25rem; }
  .woocommerce form .form-row-first, .woocommerce form .form-row-last { width: 100% !important; float: none !important; margin-right: 0 !important; }
}
@media (max-width: 600px) {
  /* Cart table → stacked cards (uses WooCommerce td[data-title]) */
  .woocommerce-cart-form table.shop_table thead { display: none; }
  .woocommerce-cart-form table.shop_table tr { display: block; border-bottom: 1px solid var(--border, #E5E5E5); padding: .35rem 0; }
  .woocommerce-cart-form table.shop_table tr:last-child { border-bottom: 0; }
  .woocommerce-cart-form table.shop_table td {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .6rem 1rem; border-top: 0; text-align: end;
  }
  .woocommerce-cart-form table.shop_table td::before {
    content: attr(data-title); font-weight: 700; color: var(--fg, #2D2D2D); text-align: start; font-size: .82rem;
  }
  .woocommerce-cart-form td.product-remove { justify-content: flex-end; }
  .woocommerce-cart-form td.product-remove::before { display: none; }
  .woocommerce-cart-form td.actions { display: block; }
  .woocommerce-cart-form td.actions::before { display: none; }
  .woocommerce-cart-form .coupon { flex-wrap: wrap; }
  .woocommerce-cart-form .coupon input { max-width: none; }
}

/* ---------- RTL (Arabic cart & checkout) ---------- */
/* Arabic checkout: STACK the billing name/contact fields full-width, one per row.
   WooCommerce's two-column float layout puts "First name" on the LEFT; reading
   right→left an Arabic user filled the right-hand box first — which is actually LAST
   name — leaving First name empty and hitting "first name is required". Full-width
   rows remove the left/right ambiguity for good: First name is always its own row at
   the top, impossible to misfill at any screen width. English keeps its two-column
   layout (left→right order is already correct there). Keyed off [dir=rtl] (on the
   <html> element) and .lang-ar, with !important, so it holds regardless of which of
   WooCommerce's own stylesheets loads. */
[dir=rtl] .woocommerce form .form-row-first,
[dir=rtl] .woocommerce form .form-row-last,
.lang-ar .woocommerce form .form-row-first,
.lang-ar .woocommerce form .form-row-last {
  float: none !important;
  width: 100% !important;
  margin-inline: 0 !important;
}
/* Password reveal (eye) sits at the END of the field: right in English (LTR), left
   in Arabic (RTL). Explicit physical positioning — the earlier logical version was
   cancelled by a stray `right:auto`, which left the eye at the START in English. */
.woocommerce form .password-input { position: relative; display: block; }
.woocommerce form .password-input input { padding-right: 2.6rem !important; padding-left: .85rem !important; }
.woocommerce form .password-input .show-password-input {
  position: absolute; top: 50%; transform: translateY(-50%); margin: 0;
  right: .9rem; left: auto; cursor: pointer;
}
/* Arabic: mirror to the left end. */
[dir=rtl] .woocommerce form .password-input input,
.lang-ar .woocommerce form .password-input input { padding-right: .85rem !important; padding-left: 2.6rem !important; }
[dir=rtl] .woocommerce form .password-input .show-password-input,
.lang-ar .woocommerce form .password-input .show-password-input { right: auto; left: .9rem; }

/* Checkout: highlight the "terms and conditions" link in the consent line. */
.woocommerce-terms-and-conditions-link {
  font-weight: 700;
  color: var(--primary, #4A3B6B);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.woocommerce-terms-and-conditions-link:hover {
  color: var(--accent, #C9A961);
}
