/* WooCommerce Cart & Checkout *blocks* restyled for the dark/gold theme.
   These blocks render client-side, so everything here targets the classes the
   React components actually emit. Scoped to .ioi-store (set in
   page-influencer.php) so nothing leaks into wp-admin or other pages. */

.ioi-store {
  --ioi-gold: #e6c27a;
  --ioi-line: rgba(255, 255, 255, 0.1);
  --ioi-panel: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* ---------- layout ----------
   WooCommerce's own sidebar-layout already sizes main + sidebar to exactly fill
   the row. Do NOT add gap/margin here: any extra horizontal space pushes the
   total past 100% and flex-wrap drops the sidebar below the cart. Spacing is
   WooCommerce's job; this file only restyles. */

.ioi-store .wc-block-components-sidebar {
  padding: 1.75rem;
  background: var(--ioi-panel);
  border: 1px solid var(--ioi-line);
  border-radius: 1.5rem;
  backdrop-filter: blur(20px);
}

/* ---------- headings / text ---------- */
.ioi-store .wc-block-components-title,
.ioi-store .wc-block-cart__totals-title,
.ioi-store .wc-block-cart-items__header,
.ioi-store h1,
.ioi-store h2,
.ioi-store h3 {
  color: #fff;
}

.ioi-store .wc-block-cart-items__header {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid var(--ioi-line);
}

.ioi-store .wc-block-cart-items__row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ioi-store .wc-block-components-product-name {
  font-family: "Playfair Display", serif;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
}

.ioi-store .wc-block-components-product-name:hover {
  color: var(--ioi-gold);
}

.ioi-store .wc-block-components-product-metadata,
.ioi-store .wc-block-components-product-details__value,
.ioi-store .wc-block-components-product-metadata__description {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.ioi-store .wc-block-components-product-details__name {
  color: rgba(255, 255, 255, 0.4);
}

.ioi-store .wc-block-components-product-price,
.ioi-store .wc-block-components-product-price__value,
.ioi-store .wc-block-cart-item__total-price-and-sale-badge-wrapper,
.ioi-store .wc-block-components-formatted-money-amount {
  color: var(--ioi-gold);
}

.ioi-store .wc-block-cart-item__image img {
  border: 1px solid var(--ioi-line);
  border-radius: 0.75rem;
}

.ioi-store .wc-block-cart-item__remove-link {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: underline;
}

.ioi-store .wc-block-cart-item__remove-link:hover {
  color: #f87171;
}

/* creator bookings are single-slot — the stepper is meaningless here */
.ioi-store .wc-block-cart-item__quantity .wc-block-components-quantity-selector {
  display: none;
}

/* ---------- totals ---------- */
.ioi-store .wc-block-components-totals-wrapper {
  border-top: 1px solid var(--ioi-line);
}

.ioi-store .wc-block-components-totals-item__label {
  color: rgba(255, 255, 255, 0.6);
}

.ioi-store .wc-block-components-totals-item__value {
  color: #fff;
}

.ioi-store .wc-block-components-totals-footer-item {
  font-family: "Playfair Display", serif;
}

.ioi-store .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
  font-size: 1.75rem;
  color: var(--ioi-gold);
}

/* ---------- panels (coupons, order note) ---------- */
.ioi-store .wc-block-components-panel__button {
  color: rgba(255, 255, 255, 0.8);
}

.ioi-store .wc-block-components-panel__button:hover {
  color: var(--ioi-gold);
}

.ioi-store .wc-block-components-panel__button-icon {
  fill: var(--ioi-gold);
}

/* ---------- inputs ---------- */
.ioi-store .wc-block-components-text-input input[type="text"],
.ioi-store .wc-block-components-text-input input[type="email"],
.ioi-store .wc-block-components-text-input input[type="tel"],
.ioi-store .wc-block-components-text-input input[type="number"],
.ioi-store .wc-block-components-textarea,
.ioi-store .wc-block-components-combobox-control input,
.ioi-store .wc-block-components-select__container,
.ioi-store .wc-block-components-form input,
.ioi-store select {
  color: #fff;
  background: var(--ioi-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
}

.ioi-store .wc-block-components-text-input input:focus,
.ioi-store .wc-block-components-textarea:focus,
.ioi-store select:focus {
  border-color: var(--ioi-gold);
  outline: none;
  box-shadow: 0 0 0 1px var(--ioi-gold);
}

.ioi-store .wc-block-components-text-input label,
.ioi-store .wc-block-components-checkbox__label,
.ioi-store .wc-block-components-combobox-control label,
.ioi-store label {
  color: rgba(255, 255, 255, 0.6);
}

/* floating label sits on the input — match the panel, not white */
.ioi-store .wc-block-components-text-input.is-active label {
  background: transparent;
}

.ioi-store select option {
  color: #fff;
  background: #131315;
}

/* Country/state selects render as native <select> inside a container that has
   a white background. A translucent panel colour would let that white show
   through, so these use a SOLID dark fill (not the 5%-opaque --ioi-panel) plus
   a gold caret. */
.ioi-store .wc-blocks-components-select__container {
  background: transparent;
  border: 0;
}

.ioi-store .wc-blocks-components-select__select,
.ioi-store select {
  /* Top padding leaves room for the floating label so it no longer overlaps
     the selected value; bottom padding keeps the value visually centred. */
  height: auto;
  min-height: 52px;
  padding: 1.4rem 2.25rem 0.4rem 0.85rem;
  color: #fff;
  appearance: none;
  -webkit-appearance: none;
  background-color: #17171a;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6c27a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
}

.ioi-store .wc-blocks-components-select__label {
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- buttons ---------- */
.ioi-store .wc-block-components-button:not(.is-link),
.ioi-store .wc-block-cart__submit-button,
.ioi-store .wc-block-components-checkout-place-order-button {
  font-weight: 500;
  color: #000;
  background: linear-gradient(135deg, #f5e1a4 0%, #d4af37 50%, #a8842a 100%);
  border: 0;
  border-radius: 9999px;
  box-shadow: 0 0 60px -15px rgba(212, 175, 55, 0.6);
  transition: opacity 0.2s;
}

.ioi-store .wc-block-components-button:not(.is-link):hover {
  opacity: 0.9;
}

.ioi-store .wc-block-components-button__text {
  color: #000;
}

.ioi-store .wc-block-components-button.is-link {
  color: rgba(255, 255, 255, 0.7);
}

.ioi-store .wc-block-components-button.is-link:hover {
  color: var(--ioi-gold);
}

/* ---------- notices ---------- */
.ioi-store .wc-block-components-notice-banner {
  color: #fff;
  background: var(--ioi-panel);
  border: 1px solid var(--ioi-line);
  border-left: 3px solid var(--ioi-gold);
  border-radius: 0.75rem;
}

.ioi-store .wc-block-components-notice-banner.is-error {
  border-left-color: #f87171;
}

.ioi-store .wc-block-components-notice-banner.is-error svg {
  fill: #f87171;
}

.ioi-store .wc-block-components-notice-banner.is-info svg,
.ioi-store .wc-block-components-notice-banner.is-success svg {
  fill: var(--ioi-gold);
}

.ioi-store .wc-block-checkout__no-payment-methods-notice,
.ioi-store .wc-block-checkout__guest-checkout-notice {
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- empty cart ---------- */
.ioi-store .wc-block-cart__empty-cart__title {
  font-family: "Playfair Display", serif;
  color: #fff;
}

.ioi-store .wc-block-grid__product-title {
  color: #fff;
}

.ioi-store .wc-block-grid__product-price {
  color: var(--ioi-gold);
}

/* ---------- links ---------- */
.ioi-store a {
  color: var(--ioi-gold);
}

.ioi-store .wc-block-components-product-name,
.ioi-store .wc-block-cart-item__remove-link {
  color: inherit;
}

/* Store sells to India only, so the Country/Region field is redundant (India is
   the single allowed country and the default). Hide it in the block checkout —
   the value still submits correctly with the field hidden. */
.wc-block-checkout .wc-block-components-country-input,
.wp-block-woocommerce-checkout .wc-block-components-country-input,
.ioi-store .wc-block-components-country-input {
  display: none !important;
}

/* ---------- Order received (thank-you) page ------------------------------ */
.ioi-store .woocommerce-thankyou-order-received {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 2rem;
}

/* Order number / date / email / total → a row of glass cards. */
.ioi-store .woocommerce-order-overview {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  border: 0;
}
.ioi-store .woocommerce-order-overview li {
  /* !important defeats WooCommerce's more specific `border-right: dashed` so no
     stray dividers show between the cards. */
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 1rem;
  background: var(--ioi-panel);
  padding: 1.1rem 1.35rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.62rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}
.ioi-store .woocommerce-order-overview li strong {
  display: block;
  margin-top: 0.4rem;
  font-size: 1rem;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-transform: none;
  color: #fff;
}

/* Section headings. */
.ioi-store .woocommerce-order-details__title,
.ioi-store .woocommerce-column__title,
.ioi-store .woocommerce-customer-details h2,
.ioi-store .woocommerce-order-details h2 {
  font-family: var(--ioi-serif, "Playfair Display", serif);
  font-size: 1.5rem;
  color: #fff;
  margin: 2.5rem 0 1rem;
}

/* Order details table wrapped in a glass panel. */
.ioi-store .woocommerce-table--order-details {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
}
.ioi-store .woocommerce-table--order-details th,
.ioi-store .woocommerce-table--order-details td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
}
.ioi-store .woocommerce-table--order-details thead th {
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}
.ioi-store .woocommerce-table--order-details tfoot th,
.ioi-store .woocommerce-table--order-details tfoot td {
  color: #fff;
}
.ioi-store .woocommerce-table--order-details tfoot tr:last-child th,
.ioi-store .woocommerce-table--order-details tfoot tr:last-child td {
  color: var(--ioi-gold);
  font-size: 1.05rem;
}
.ioi-store .woocommerce-table--order-details a { color: var(--ioi-gold); }

/* Billing address block. */
.ioi-store .woocommerce-customer-details address {
  font-style: normal;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: var(--ioi-panel);
  padding: 1.25rem 1.5rem;
}
.ioi-store .woocommerce-customer-details address .woocommerce-customer-details--phone,
.ioi-store .woocommerce-customer-details address .woocommerce-customer-details--email {
  margin-top: 0.35rem;
}

/* Keep the RM card from butting straight into the table. */
.ioi-store .ioi-rm-card { margin-top: 2rem; }
/* `.ioi-store a { color: gold }` would turn the gold button's own label gold
   (invisible). Force the button text/icon back to black. */
.ioi-store .ioi-rm-card a[class*="gold-gradient"] { color: #000; }
.ioi-store .ioi-rm-card a[class*="gold-gradient"] svg { color: #000; }

/* Gap above the empty-cart "New in store" product slider (spacing only). */
.ioi-store .wc-block-grid,
.ioi-store .wp-block-woocommerce-product-new,
.ioi-store ul.products { margin-top: 2.5rem; }

/* --- Order-summary quantity badge: creators are always qty 1, so hide it --- */
.ioi-store .wc-block-components-order-summary-item__quantity {
  display: none !important;
}

/* --- Checkout explainer notes -------------------------------------------
 * Rendered as pseudo-elements on the (React-managed) total row so we never
 * inject nodes into the checkout tree. Copy is passed in via CSS variables
 * set on <body> by influencer-store.js. Both notes flank the final total. */
.ioi-creator-checkout .wc-block-components-totals-footer-item {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

/* "Influencer amounts are shown for reference only" — above the total. */
.ioi-creator-checkout .wc-block-components-totals-footer-item::before {
  content: var(--ioi-ref-note, "");
  order: -1;
  flex-basis: 100%;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

/* Flat-fee / RM explainer — below the total. */
.ioi-creator-checkout .wc-block-components-totals-footer-item::after {
  content: var(--ioi-fee-note, "");
  order: 99;
  flex-basis: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(230, 194, 122, 0.25);
  border-radius: 0.75rem;
  background: rgba(230, 194, 122, 0.06);
  color: rgba(255, 255, 255, 0.65);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: normal;
}
