/* =====================================================
   DOOMDROP styling for WooCommerce's Cart and Checkout blocks.
   Loaded only on those pages (templates/store.php). WooCommerce
   still renders the markup; this re-skins it with the site tokens.
   Rules start with body.doomdrop-store so they outrank WooCommerce's
   own block styles, which load after this file.
   ===================================================== */

body.doomdrop-store {
  --sticker-mark: 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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h14a2 2 0 0 1 2 2v9l-7 7H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z'/%3E%3Cpath d='M14 21v-5a2 2 0 0 1 2-2h5'/%3E%3Cpath d='M12 7l1.4 2.8 3 .4-2.2 2.1.5 3-2.7-1.4-2.7 1.4.5-3L7.6 10.2l3-.4z'/%3E%3C/svg%3E");
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

/* ---------- Page frame ---------- */
.store-secure {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.store-secure .ico { width: 16px; height: 16px; color: var(--accent); }
.store-back { font-size: 14px; }

.store-page { padding-block: 44px 80px; }
.store-page__title { font-size: 56px; }
.store-page__content { margin-top: 28px; }

body.doomdrop-store .wp-block-woocommerce-checkout,
body.doomdrop-store .wp-block-woocommerce-cart {
  max-width: none;
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--font-body);
}
body.doomdrop-store .wc-block-formatted-money-amount { font-variant-numeric: tabular-nums; }

/* ---------- Headings ---------- */
body.doomdrop-store .wc-block-components-title.wc-block-components-title,
body.doomdrop-store .wc-block-components-checkout-step__title,
body.doomdrop-store .wc-block-cart__totals-title.wc-block-cart__totals-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}
body.doomdrop-store .wc-block-components-checkout-step__description,
body.doomdrop-store .wc-block-checkout__guest-checkout-notice { color: var(--muted); }

/* ---------- Text inputs and selects ---------- */
body.doomdrop-store .wc-block-components-text-input input[type],
body.doomdrop-store .wc-blocks-components-select .wc-blocks-components-select__select,
body.doomdrop-store .wc-block-components-textarea,
body.doomdrop-store .wc-block-components-combobox .wc-block-components-combobox-control input {
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  box-shadow: none;
  caret-color: var(--accent);
}
body.doomdrop-store .wc-block-components-text-input input[type]:focus,
body.doomdrop-store .wc-blocks-components-select .wc-blocks-components-select__select:focus,
body.doomdrop-store .wc-block-components-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  outline: none;
}
body.doomdrop-store .wc-block-components-text-input label,
body.doomdrop-store .wc-blocks-components-select .wc-blocks-components-select__label,
body.doomdrop-store .wc-block-components-combobox .wc-block-components-combobox-control label {
  color: var(--muted);
}
body.doomdrop-store .wc-blocks-components-select .wc-blocks-components-select__container { background: transparent; }
body.doomdrop-store .wc-blocks-components-select__expand { fill: var(--muted); }
body.doomdrop-store .wc-block-components-text-input input::placeholder,
body.doomdrop-store .wc-block-components-textarea::placeholder { color: var(--muted); opacity: 1; }

/* Browser autofill would otherwise paint fields pale yellow-white */
body.doomdrop-store input:-webkit-autofill,
body.doomdrop-store input:-webkit-autofill:hover,
body.doomdrop-store input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--card) inset;
  -webkit-text-fill-color: var(--text);
}

/* Validation */
body.doomdrop-store .wc-block-components-text-input.has-error input[type],
body.doomdrop-store .wc-blocks-components-select.has-error .wc-blocks-components-select__select { border-color: var(--dangerText); }
body.doomdrop-store .wc-block-components-validation-error,
body.doomdrop-store .has-error label { color: var(--dangerText); }

/* Inline links (add apartment, edit address, terms) */
body.doomdrop-store .wc-block-components-address-form__address_2-toggle,
body.doomdrop-store .wc-block-components-address-card__edit,
body.doomdrop-store .wc-block-checkout__terms a,
body.doomdrop-store .wc-block-components-product-metadata a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.doomdrop-store .wc-block-checkout__terms { color: var(--muted); }
body.doomdrop-store .wc-block-checkout__terms--with-separator { border-top-color: var(--line); }

/* ---------- Checkboxes and radios ---------- */
body.doomdrop-store .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
  border: 1px solid var(--line2);
  border-radius: 5px;
  background: var(--card);
}
body.doomdrop-store .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}
body.doomdrop-store .wc-block-components-checkbox .wc-block-components-checkbox__mark { fill: var(--onAccent); }
body.doomdrop-store .wc-block-components-checkbox__label { color: var(--text); }

body.doomdrop-store .wc-block-components-radio-control__input {
  border: 1px solid var(--line2);
  background: var(--card);
}
body.doomdrop-store .wc-block-components-radio-control__input:checked { border-color: var(--accent); }
body.doomdrop-store .wc-block-components-radio-control__input:checked::before { background: var(--accent); }
body.doomdrop-store .wc-block-components-radio-control--highlight-checked::after,
body.doomdrop-store .wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option--checked-option-highlighted {
  border-color: var(--accent);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--accent);
}
body.doomdrop-store .wc-block-components-radio-control--highlight-checked {
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--line2);
}
body.doomdrop-store .wc-block-components-radio-control__secondary-label,
body.doomdrop-store .wc-block-components-radio-control__description { color: var(--muted); }

/* ---------- Buttons ---------- */
body.doomdrop-store .wc-block-components-button:not(.is-link),
body.doomdrop-store .wc-block-components-checkout-place-order-button,
body.doomdrop-store .wc-block-cart__submit-button {
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--onAccent);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--btnGlow);
  transition: filter .15s;
}
body.doomdrop-store .wc-block-components-button:not(.is-link):hover { filter: brightness(1.08); color: var(--onAccent); }
body.doomdrop-store .wc-block-components-button:not(.is-link):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
body.doomdrop-store .wc-block-components-button:not(.is-link):disabled,
body.doomdrop-store .wc-block-components-button:not(.is-link)[aria-disabled="true"] {
  border-color: var(--line2);
  background: var(--card2);
  color: var(--muted);
  box-shadow: none;
  filter: none;
  cursor: not-allowed;
}
body.doomdrop-store .wc-block-components-checkout-return-to-cart-button,
body.doomdrop-store .wc-block-components-button.is-link { color: var(--muted); }
body.doomdrop-store .wc-block-components-checkout-return-to-cart-button:hover { color: var(--text); }
body.doomdrop-store .wc-block-components-checkout-return-to-cart-button svg { fill: currentColor; }

/* ---------- Notices ---------- */
body.doomdrop-store .wc-block-components-notice-banner {
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: var(--card2);
  color: var(--text);
}
body.doomdrop-store .wc-block-components-notice-banner.is-error {
  border-color: var(--dangerLine);
  background: color-mix(in srgb, var(--dangerText) 9%, var(--card));
}
body.doomdrop-store .wc-block-components-notice-banner.is-error > svg { background-color: var(--dangerText); fill: var(--card); }
body.doomdrop-store .wc-block-components-notice-banner.is-success,
body.doomdrop-store .wc-block-components-notice-banner.is-info {
  border-color: var(--accent);
  background: var(--accentBg);
}
body.doomdrop-store .wc-block-components-notice-banner.is-success > svg,
body.doomdrop-store .wc-block-components-notice-banner.is-info > svg { background-color: var(--accent); fill: var(--onAccent); }

/* ---------- Order summary (checkout sidebar) and totals ---------- */
body.doomdrop-store .wp-block-woocommerce-checkout-order-summary-block,
body.doomdrop-store .wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
/* On phones WooCommerce shows the summary twice: a collapsible bar at the top (our frame is enough,
   so drop its own divider lines) and a full copy above Place order, whose inner box already has a
   frame (so that copy gets one frame, not two). */
body.doomdrop-store .wc-block-components-checkout-order-summary__title { border-top: 0; border-bottom: 0; }
body.doomdrop-store .checkout-order-summary-block-fill-wrapper {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.doomdrop-store .checkout-order-summary-block-fill {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
body.doomdrop-store .wc-block-components-totals-wrapper,
body.doomdrop-store .wc-block-components-order-summary,
body.doomdrop-store .wc-block-components-panel { border-color: var(--line); }
body.doomdrop-store .wc-block-components-checkout-order-summary__title-text { font-family: var(--font-display); font-size: 22px; font-weight: 800; text-transform: uppercase; }
/* The stickers have no photos: swap WooCommerce's pale placeholder for the shop's sticker mark */
body.doomdrop-store .wc-block-components-order-summary-item__image:has(img[src*="woocommerce-placeholder"]),
body.doomdrop-store .wc-block-cart-item__image a:has(img[src*="woocommerce-placeholder"]) {
  position: relative;
  display: block;
  border-radius: 8px;
  background: var(--card2);
}
body.doomdrop-store .wc-block-components-order-summary-item__image img[src*="woocommerce-placeholder"],
body.doomdrop-store .wc-block-cart-item__image img[src*="woocommerce-placeholder"] { visibility: hidden; }
body.doomdrop-store .wc-block-components-order-summary-item__image:has(img[src*="woocommerce-placeholder"])::after,
body.doomdrop-store .wc-block-cart-item__image a:has(img[src*="woocommerce-placeholder"])::after {
  content: "";
  position: absolute;
  inset: 22%;
  background: var(--accent);
  -webkit-mask: var(--sticker-mark) center / contain no-repeat;
  mask: var(--sticker-mark) center / contain no-repeat;
}
body.doomdrop-store .wc-block-components-order-summary-item__quantity {
  border: 2px solid var(--card);
  background: var(--accent);
  color: var(--onAccent);
  box-shadow: none;
  font-weight: 700;
}
body.doomdrop-store .wc-block-components-product-name,
body.doomdrop-store .wc-block-cart-items .wc-block-components-product-name.wc-block-components-product-name {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}
body.doomdrop-store .wc-block-components-order-summary-item__individual-prices,
body.doomdrop-store .wc-block-components-product-metadata { color: var(--muted); }
body.doomdrop-store .wc-block-components-panel__button { color: var(--text); }
body.doomdrop-store .wc-block-components-panel__button-icon { fill: var(--muted); }
body.doomdrop-store .wc-block-components-totals-item__label,
body.doomdrop-store .wc-block-components-totals-item__description { color: var(--muted); }
body.doomdrop-store .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
}
body.doomdrop-store .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
}

/* The cart's totals box only gets a frame from us, so it needs its own inner spacing */
body.doomdrop-store .wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block { padding: 8px 20px; }
body.doomdrop-store .wc-block-cart__totals-title.wc-block-cart__totals-title { padding: 12px 0 8px; }

/* ---------- Cart page table ---------- */
body.doomdrop-store .wc-block-cart-items,
body.doomdrop-store .wc-block-cart-items th,
body.doomdrop-store .wc-block-cart-items td { border-color: var(--line); }
body.doomdrop-store .wc-block-cart-items__header { color: var(--muted); }
body.doomdrop-store .wc-block-cart-item__remove-link { color: var(--muted); }
body.doomdrop-store .wc-block-cart-item__remove-link:hover { color: var(--dangerText); }
body.doomdrop-store .wc-block-components-quantity-selector {
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card);
}
body.doomdrop-store .wc-block-components-quantity-selector::after { display: none; }
body.doomdrop-store .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input,
body.doomdrop-store .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
  background: transparent;
  color: var(--text);
}

@media (max-width: 719.98px) {
  .store-page { padding-block: 24px 48px; }
  .store-page__title { font-size: 40px; }
  .store-page__content { margin-top: 18px; }
  .store-back { width: 44px; padding: 0; }
}
