/* ============================================================================
   Curse Doll — WooCommerce + global polish (v5)
   Loaded on cart, checkout, account, order-received, and inner pages.
   Brand: rust #a82a1c / blood #7a0808 / bone #d9cdae / olive #9aa03f / near-black
   ============================================================================ */

:root{
  --cd-rust:#a82a1c;     --cd-blood:#7a0808;   --cd-rust-lt:#b5503e;
  --cd-bone:#d9cdae;     --cd-bone-dim:#b8ad8e; --cd-olive:#9aa03f;
  --cd-ink:#0a0806;      --cd-ink2:#0e0b07;     --cd-ink3:#080605;
  --cd-line:#2a1a10;     --cd-line2:#3a2a1a;    --cd-line-rust:#3a1410;
  --cd-muted:#6c6450;    --cd-muted2:#8a7a62;
}

/* kill default WP/WC link blue everywhere on the storefront */
body.cursedoll-site a,
.woocommerce a{ color:var(--cd-rust-lt); }
body.cursedoll-site a:hover,
.woocommerce a:hover{ color:var(--cd-bone); }

/* ── shared form controls ─────────────────────────────────────────────── */
.woocommerce input[type=text],.woocommerce input[type=email],.woocommerce input[type=tel],
.woocommerce input[type=number],.woocommerce input[type=password],.woocommerce input[type=search],
.woocommerce textarea,.woocommerce select,.woocommerce .select2-selection{
  background:var(--cd-ink2)!important;border:1px solid var(--cd-line2)!important;
  color:var(--cd-bone)!important;font-family:'Special Elite',monospace!important;
  font-size:16px!important;line-height:1.4!important;padding:12px 14px!important;
  border-radius:0!important;outline:none!important;width:100%;
  transition:border-color .18s ease, box-shadow .18s ease;
}
.woocommerce input::placeholder,.woocommerce textarea::placeholder{color:#5a5142!important;opacity:1;}
.woocommerce input:focus,.woocommerce textarea:focus,.woocommerce select:focus,
.woocommerce .select2-container--focus .select2-selection{
  border-color:var(--cd-rust)!important;
  box-shadow:0 0 0 2px rgba(168,42,28,.22), 0 0 16px rgba(168,42,28,.12)!important;
}
.woocommerce label,.woocommerce .form-row label{
  color:var(--cd-olive)!important;font-size:11px!important;letter-spacing:.16em!important;
  text-transform:uppercase!important;display:block;margin-bottom:6px;font-weight:400;
}
.woocommerce .required{color:var(--cd-rust)!important;border:0;}
/* select2 dark dropdown */
.select2-dropdown{background:var(--cd-ink2)!important;border:1px solid var(--cd-line2)!important;color:var(--cd-bone)!important;}
.select2-results__option{color:var(--cd-bone-dim)!important;}
.select2-results__option--highlighted{background:var(--cd-rust)!important;color:#fff!important;}
.select2-selection__rendered{color:var(--cd-bone)!important;line-height:46px!important;}
.select2-selection__arrow{top:12px!important;}

/* ── buttons: secondary = ghost, primary = rust gradient ──────────────── */
.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,
.woocommerce .button,.woocommerce button[type=submit]{
  background:transparent!important;border:2px solid var(--cd-rust)!important;
  color:var(--cd-rust-lt)!important;font-family:'Special Elite',monospace!important;
  font-size:14px!important;letter-spacing:.18em!important;text-transform:uppercase!important;
  padding:13px 26px!important;border-radius:0!important;cursor:pointer!important;
  text-decoration:none!important;display:inline-block;line-height:1.2!important;
  transition:background .18s ease,color .18s ease,box-shadow .18s ease,transform .12s ease;
}
.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce input.button:hover,
.woocommerce .button:hover,.woocommerce button[type=submit]:hover{
  background:rgba(168,42,28,.14)!important;color:var(--cd-bone)!important;
  box-shadow:0 0 18px rgba(168,42,28,.25)!important;
}
.woocommerce .button:active{transform:translateY(1px);}

/* primary CTAs: proceed-to-checkout + place order = solid gradient + glow */
.wc-proceed-to-checkout a.checkout-button,
.woocommerce #place_order,
.woocommerce .button.alt{
  background:linear-gradient(135deg,var(--cd-blood),var(--cd-rust))!important;
  border:2px solid var(--cd-rust)!important;color:#f0e6d6!important;
  box-shadow:0 0 24px rgba(168,42,28,.30), inset 0 1px 0 rgba(255,200,150,.1)!important;
  font-size:16px!important;letter-spacing:.24em!important;padding:16px 28px!important;
  width:100%!important;display:block!important;text-align:center!important;
}
.wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce #place_order:hover,
.woocommerce .button.alt:hover{
  background:linear-gradient(135deg,var(--cd-rust),#c2331f)!important;color:#fff!important;
  box-shadow:0 0 36px rgba(168,42,28,.5)!important;
}

/* ── tables / cards ───────────────────────────────────────────────────── */
.woocommerce table.shop_table{
  background:var(--cd-ink2)!important;border:1px solid var(--cd-line)!important;
  border-radius:0!important;border-collapse:separate!important;border-spacing:0;width:100%;
  box-shadow:0 18px 40px rgba(0,0,0,.5);
}
.woocommerce table.shop_table thead th{
  color:var(--cd-muted)!important;font-size:11px;letter-spacing:.2em;text-transform:uppercase;
  font-weight:400;padding:14px 16px!important;border-bottom:1px solid var(--cd-line2)!important;
}
.woocommerce table.shop_table td,.woocommerce table.shop_table th{
  border-color:var(--cd-line)!important;padding:16px!important;color:var(--cd-bone-dim)!important;
  border-bottom:1px solid var(--cd-line)!important;background:transparent!important;
}
.woocommerce td.product-name a{color:var(--cd-bone)!important;text-decoration:none;font-size:16px;}
.woocommerce td.product-name a:hover{color:#fff!important;}
.woocommerce .product-subtotal,.woocommerce .amount{color:var(--cd-bone)!important;}
.woocommerce .quantity input{width:64px!important;text-align:center;}
.woocommerce a.remove{
  color:var(--cd-rust)!important;border:1px solid rgba(168,42,28,.4);border-radius:50%!important;
  width:22px;height:22px;line-height:20px!important;font-weight:400!important;
}
.woocommerce a.remove:hover{background:var(--cd-rust)!important;color:#fff!important;}

/* ── product image: NEVER show the broken placeholder ─────────────────── */
.woocommerce td.product-thumbnail{width:84px;}
.woocommerce td.product-thumbnail img{
  width:64px!important;height:64px!important;object-fit:cover;
  border:1px solid var(--cd-line2);background:var(--cd-ink3);
}
/* if a curse has no image, WC outputs the grey placeholder — replace with a pin glyph */
.woocommerce td.product-thumbnail img[src*="placeholder"],
.woocommerce td.product-thumbnail img[src*="woocommerce-placeholder"]{
  visibility:hidden;position:relative;
}
.woocommerce td.product-thumbnail img[src*="placeholder"]::after,
.woocommerce td.product-thumbnail img[src*="woocommerce-placeholder"]::after{
  content:"";visibility:visible;position:absolute;inset:0;background:var(--cd-ink3);
  border:1px solid var(--cd-line2);
}
.woocommerce td.product-thumbnail a{
  position:relative;display:block;width:64px;height:64px;background:var(--cd-ink3);
  border:1px solid var(--cd-line2);overflow:hidden;
}
.woocommerce td.product-thumbnail a::before{
  content:"";position:absolute;left:50%;top:30%;width:8px;height:8px;border-radius:50%;
  background:radial-gradient(circle at 38% 32%,#e85a3f,#8a1d12 70%);
  transform:translateX(-50%);box-shadow:0 0 8px rgba(168,42,28,.6);z-index:1;
}
.woocommerce td.product-thumbnail a::after{
  content:"";position:absolute;left:50%;top:34%;width:2px;height:34%;
  background:linear-gradient(#d9cdae,#8a7a62);transform:translateX(-50%);z-index:0;
}

/* ── cart layout: cart left, totals right on desktop ──────────────────── */
.woocommerce .cart-collaterals{margin-top:30px;width:100%;}
.woocommerce .cart-collaterals .cart_totals{
  background:var(--cd-ink2);border:1px solid var(--cd-line);padding:24px 26px;
  box-shadow:0 18px 40px rgba(0,0,0,.5);float:none;width:100%;
}
.woocommerce .cart_totals h2{
  font-family:'Rubik Distressed',system-ui;color:var(--cd-bone);font-weight:400;
  font-size:clamp(22px,4vw,30px);margin:0 0 18px;
}
.woocommerce .cart_totals table tr th,.woocommerce .cart_totals table tr td{
  border-top:1px solid var(--cd-line)!important;padding:12px 6px!important;color:var(--cd-bone-dim)!important;
}
.woocommerce .cart_totals .order-total .amount{color:var(--cd-bone)!important;font-size:1.2em;}
@media(min-width:781px){
  .woocommerce-cart-form{ }
  .woocommerce .cart-collaterals{display:flex;justify-content:flex-end;}
  .woocommerce .cart-collaterals .cart_totals{max-width:440px;}
}

/* coupon row */
.woocommerce .coupon{display:flex;gap:10px;align-items:stretch;flex-wrap:wrap;}
.woocommerce .coupon input[type=text]{flex:1;min-width:160px;}
.woocommerce .actions{padding:16px 0!important;}

/* ── checkout specifics ───────────────────────────────────────────────── */
.woocommerce-checkout .col2-set{display:block;}
.woocommerce-checkout #customer_details{ }
.woocommerce-checkout h3{
  font-family:'Rubik Distressed',system-ui;color:var(--cd-bone);font-weight:400;
  font-size:clamp(20px,3.5vw,26px);margin:0 0 16px;
}
.woocommerce form.checkout{display:grid;grid-template-columns:1fr;gap:8px;}
@media(min-width:861px){
  /* Two-column checkout. CRITICAL: form.checkout has 4 direct children in this
     order — the express-pay wrapper, #customer_details, #order_review_heading,
     #order_review. Without explicit placement the express-pay block auto-flows
     into column 1 / row 1 and shoves the billing form down, leaving a big empty
     band and an empty "Your order" column. So we pin each child to its cell:
     express-pay spans the full width on row 1; billing (left) and the order
     summary (right) share row 2.                                            */
  .woocommerce form.checkout{
    grid-template-columns:1.15fr .85fr;gap:14px 48px;align-items:start;
  }
  /* express-pay / any leading wrapper → full-width, top */
  .woocommerce form.checkout > .wcpay-express-checkout-wrapper,
  .woocommerce form.checkout > .wc-block-components-express-payment,
  .woocommerce form.checkout > #wc-stripe-express-checkout-element,
  .woocommerce form.checkout > .woocommerce-form-coupon-toggle{
    grid-column:1 / -1!important;grid-row:1!important;max-width:540px;margin:0 auto 8px;
  }
  .woocommerce form.checkout > #customer_details{grid-column:1!important;grid-row:2!important;}
  .woocommerce form.checkout > #order_review_heading{grid-column:2!important;grid-row:2!important;align-self:start;}
  .woocommerce form.checkout > #order_review{grid-column:2!important;grid-row:2!important;margin-top:46px;}
  /* billing + additional-info stack vertically inside the narrow left column */
  .woocommerce form.checkout #customer_details.col2-set{display:block!important;}
  .woocommerce form.checkout #customer_details .col-2{margin-top:28px;}
}
.woocommerce #order_review{
  background:var(--cd-ink2);border:1px solid var(--cd-line);padding:24px;
  box-shadow:0 18px 40px rgba(0,0,0,.5);
}
.woocommerce #order_review_heading{
  font-family:'Rubik Distressed',system-ui;color:var(--cd-bone);font-weight:400;margin:0 0 14px;
}
.woocommerce-checkout-review-order-table tfoot tr td,
.woocommerce-checkout-review-order-table tfoot tr th{font-weight:400;color:var(--cd-bone)!important;}

/* express checkout (G Pay / Amazon Pay / WooPayments) — contained, not stretched */
.wcpay-express-checkout-wrapper,.wc-block-components-express-payment,
#wc-stripe-express-checkout-element,.payment_method_amazon_payments_advanced{
  width:100%;
}
.woocommerce .woocommerce-info,.woocommerce-checkout-payment{background:transparent!important;}

#payment{background:var(--cd-ink2)!important;border:1px solid var(--cd-line)!important;border-radius:0!important;padding:18px!important;}
#payment .payment_methods{margin:0;padding:0;list-style:none;}
#payment .payment_methods li{border-bottom:1px solid #1a1008;padding:12px 0;}
#payment .payment_methods li:last-child{border-bottom:0;}
#payment .payment_methods label{color:var(--cd-bone-dim)!important;font-size:14px!important;letter-spacing:0!important;text-transform:none!important;cursor:pointer;}
#payment .payment_box{background:var(--cd-ink3)!important;padding:14px;margin-top:10px;color:var(--cd-muted2);font-size:13px;border:1px solid var(--cd-line);}
.woocommerce-terms-and-conditions-wrapper{margin:16px 0;color:var(--cd-muted);font-size:12px;}
.woocommerce-privacy-policy-text{font-size:12px;color:#5a4a3a;margin-bottom:16px;}

/* ── notices ──────────────────────────────────────────────────────────── */
.woocommerce-message,.woocommerce-error,.woocommerce-info{
  background:var(--cd-ink2)!important;color:var(--cd-bone-dim)!important;
  border:1px solid var(--cd-line)!important;border-left:4px solid var(--cd-rust)!important;
  border-radius:0!important;padding:14px 18px!important;margin:0 0 22px!important;list-style:none;
  font-family:'Special Elite',monospace;
}
.woocommerce-message::before,.woocommerce-info::before,.woocommerce-error::before{color:var(--cd-rust)!important;}
.woocommerce-error li,.woocommerce-message li,.woocommerce-info li{list-style:none;}

/* ── empty cart state ─────────────────────────────────────────────────── */
.woocommerce-cart .cart-empty,.cart-empty.woocommerce-info{
  font-family:'Rubik Distressed',system-ui;font-size:clamp(24px,5vw,40px)!important;
  color:#3a2a1a!important;text-align:center;padding:50px 0 16px!important;
  background:transparent!important;border:0!important;
}
.woocommerce .return-to-shop{text-align:center;margin-top:14px;}

/* ── my-account ───────────────────────────────────────────────────────── */
.woocommerce-account .woocommerce{display:flex;gap:32px;align-items:flex-start;flex-wrap:wrap;}
.woocommerce-MyAccount-navigation{min-width:200px;flex:0 0 auto;}
.woocommerce-MyAccount-navigation ul{list-style:none;margin:0;padding:0;border:1px solid var(--cd-line);background:var(--cd-ink2);}
.woocommerce-MyAccount-navigation li a{display:block;padding:12px 16px;color:var(--cd-muted2);text-decoration:none;border-bottom:1px solid #1a1008;font-size:12px;letter-spacing:.12em;text-transform:uppercase;}
.woocommerce-MyAccount-navigation li.is-active a,.woocommerce-MyAccount-navigation li a:hover{color:var(--cd-bone);background:var(--cd-ink3);}
.woocommerce-MyAccount-content{flex:1;min-width:280px;}

/* ── responsive: stacked cart rows on mobile ──────────────────────────── */
@media(max-width:780px){
  .woocommerce-checkout .col2-set{grid-template-columns:1fr;gap:0;}
  .woocommerce table.shop_table_responsive thead{display:none;}
  .woocommerce table.shop_table_responsive tr{display:block;border-bottom:2px solid var(--cd-line2);}
  .woocommerce table.shop_table_responsive tr td{
    display:flex;justify-content:space-between;align-items:center;text-align:right;
    padding:12px 14px!important;border-bottom:1px solid var(--cd-line)!important;
  }
  .woocommerce table.shop_table_responsive tr td::before{
    content:attr(data-title);font-weight:400;color:var(--cd-muted);
    text-transform:uppercase;font-size:10px;letter-spacing:.16em;text-align:left;
  }
  .woocommerce table.shop_table_responsive .product-remove{justify-content:flex-end;}
  .woocommerce-cart .cart-collaterals .cart_totals{max-width:100%;}
  .woocommerce .coupon{flex-direction:column;}
}
