/* ============================================================
 * WooCommerce Blocks — Focofy Boutique
 * Cart Block e Checkout Block (WC 9+)
 * Tokens Camada 2/3 — nenhum hex
 * ============================================================ */

/* ---- WRAPPER GLOBAL ---- */
.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout {
  max-width: var(--container-max, 1200px);
  margin-inline: auto;
  padding: var(--section-padding-y, 64px) var(--gutter, 24px);
}

/* ---- ESTADO VAZIO ---- */
.wp-block-woocommerce-empty-cart-block {
  text-align: center;
  padding: var(--space-12) var(--space-8);
}
.wc-block-cart__empty-cart__title,
.wp-block-woocommerce-empty-cart-block h2,
.wp-block-woocommerce-empty-cart-block .wp-block-heading {
  color: var(--color-heading) !important;
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--fw-heading);
  margin-bottom: var(--space-6);
}
.wp-block-woocommerce-empty-cart-block .wp-block-separator {
  border-color: var(--color-border-subtle);
  margin: var(--space-8) auto;
}

/* ---- GRID DE PRODUTOS (Novo na loja) ---- */
.wc-block-grid__products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--grid-gap, 24px);
  list-style: none;
  padding: 0;
  margin: 0;
}
.wc-block-grid__product {
  position: relative;
  background: var(--card-bg, var(--color-surface-1));
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--card-radius, var(--radius-lg));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.wc-block-grid__product:hover {
  box-shadow: var(--card-shadow-hover, var(--shadow-lg));
  transform: translateY(-2px);
}
.wc-block-grid__product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.wc-block-grid__product-image { overflow: hidden; }
.wc-block-grid__product-image img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}
.wc-block-grid__product:hover .wc-block-grid__product-image img {
  transform: scale(1.04);
}
.wc-block-grid__product-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-base);
  font-weight: var(--fw-semibold, 600);
  color: var(--color-heading);
  padding: var(--space-3) var(--space-4) var(--space-1);
  line-height: var(--lh-snug);
}
.wc-block-grid__product-price {
  padding: var(--space-1) var(--space-4) var(--space-3);
  color: var(--color-accent);
  font-weight: var(--fw-semibold);
}
.wc-block-grid__product-price del {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--fw-normal, 400);
  margin-right: var(--space-2);
}
.wc-block-grid__product-add-to-cart {
  padding: 0 var(--space-4) var(--space-4);
  margin-top: auto;
}
.wc-block-grid__product-add-to-cart .wp-block-button__link,
.wc-block-grid__product-add-to-cart a {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  padding: var(--btn-padding-y, 10px) var(--btn-padding-x, 16px) !important;
  background: var(--btn-primary-bg, var(--color-accent)) !important;
  color: var(--btn-primary-text, var(--color-text-inverse)) !important;
  border: none !important;
  border-radius: var(--btn-radius, var(--radius-md)) !important;
  font-weight: var(--btn-font-weight, 600) !important;
  font-size: var(--font-size-sm) !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: background var(--transition-base);
  box-sizing: border-box !important;
}
.wc-block-grid__product-add-to-cart .wp-block-button__link:hover,
.wc-block-grid__product-add-to-cart a:hover {
  background: var(--btn-primary-hover-bg, var(--color-accent-hover)) !important;
}
.wc-block-grid__product-onsale {
  position: absolute !important;
  top: var(--space-3) !important;
  left: var(--space-3) !important;
  right: auto !important;
  z-index: 2;
  background: var(--color-accent) !important;
  color: var(--color-text-inverse) !important;
  font-size: var(--font-size-xs) !important;
  font-weight: var(--fw-bold, 700) !important;
  padding: var(--space-1) var(--space-3) !important;
  border-radius: var(--radius-full) !important;
  text-transform: uppercase !important;
  letter-spacing: .06em;
  border: none !important;
  box-shadow: none !important;
}

/* ---- CARRINHO PREENCHIDO ---- */
.wp-block-woocommerce-filled-cart-block .wc-block-cart {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  align-items: start;
}
@media (min-width: 1024px) {  /* --bp-desktop */
  .wp-block-woocommerce-filled-cart-block .wc-block-cart {
    grid-template-columns: 1fr 380px;
  }
}

/* Tabela de itens */
.wc-block-cart-items {
  width: 100%;
  border-collapse: collapse;
}
.wc-block-cart-items__header th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-xs);
  font-weight: var(--fw-semibold, 600);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  background: var(--color-surface-2, var(--color-surface-1));
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
}
.wc-block-cart-items__item {
  border-bottom: 1px solid var(--color-border-subtle);
}
.wc-block-cart-items__cell--left { padding: var(--space-4); width: 96px; }
.wc-block-components-product-image img {
  width: 80px;
  height: 106px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}
.wc-block-cart-items__cell--name { padding: var(--space-4); }
.wc-block-components-product-name {
  font-family: var(--font-heading);
  font-size: var(--font-size-base);
  font-weight: var(--fw-semibold, 600);
  color: var(--color-heading);
  text-decoration: none;
}
.wc-block-components-product-name:hover { color: var(--color-accent); }
.wc-block-components-product-metadata__description {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}
.wc-block-cart-items__cell--quantity { padding: var(--space-4); white-space: nowrap; }
.wc-block-components-quantity-selector {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--input-border, var(--color-border-subtle));
  border-radius: var(--input-radius, var(--radius-md));
  background: var(--input-bg, var(--color-surface-1));
  overflow: hidden;
}
.wc-block-components-quantity-selector__button {
  width: 36px;
  height: 40px;
  background: none;
  border: none;
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.wc-block-components-quantity-selector__button:hover {
  color: var(--color-accent);
  background: var(--color-surface-2);
}
.wc-block-components-quantity-selector__input {
  width: 48px;
  height: 40px;
  text-align: center;
  border: none;
  border-inline: 1px solid var(--color-border-subtle);
  background: none;
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: var(--fw-semibold, 600);
  outline: none;
}
.wc-block-cart-items__cell--total {
  padding: var(--space-4);
  text-align: right;
  font-weight: var(--fw-semibold, 600);
  color: var(--color-heading);
}
.wc-block-components-remove-item__button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  cursor: pointer;
  padding: var(--space-1) 0;
  text-decoration: underline;
  transition: color var(--transition-fast);
}
.wc-block-components-remove-item__button:hover { color: var(--color-danger); }

/* Totais (sidebar do carrinho) */
.wc-block-cart__totals,
.wc-block-components-totals-wrapper {
  background: var(--card-bg, var(--color-surface-1));
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--card-radius, var(--radius-lg));
  padding: var(--card-padding, var(--space-6));
}
.wc-block-components-totals-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: var(--font-size-base);
  color: var(--color-text);
}
.wc-block-components-totals-item:last-child { border-bottom: none; }
.wc-block-components-totals-item__label { color: var(--color-text-muted); }
.wc-block-components-totals-item__value {
  font-weight: var(--fw-semibold, 600);
  color: var(--color-heading);
}
.wc-block-components-totals-footer-item {
  font-size: var(--font-size-lg);
  font-weight: var(--fw-bold, 700);
  color: var(--color-heading);
  padding-top: var(--space-4);
  margin-top: var(--space-2);
}

/* Botoes ir para checkout e finalizar */
.wc-block-cart__submit-container { margin-top: var(--space-6); }
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
.wc-block-cart__proceed-to-checkout .wc-block-components-button {
  display: block;
  width: 100%;
  padding: var(--btn-padding-y, 14px) var(--btn-padding-x, 24px);
  background: var(--btn-primary-bg, var(--color-accent));
  color: var(--btn-primary-text, var(--color-text-inverse)) !important;
  border: none;
  border-radius: var(--btn-radius, var(--radius-md));
  font-size: var(--font-size-base);
  font-weight: var(--btn-font-weight, 600);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background var(--transition-base);
}
.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover {
  background: var(--btn-primary-hover-bg, var(--color-accent-hover));
}

/* ---- CHECKOUT BLOCK ---- */
.wp-block-woocommerce-checkout .wc-block-checkout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  align-items: start;
}
@media (min-width: 1024px) {  /* --bp-desktop */
  .wp-block-woocommerce-checkout .wc-block-checkout {
    grid-template-columns: 1fr 400px;
  }
}
.wc-block-checkout__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.wc-block-checkout__sidebar {
  background: var(--card-bg, var(--color-surface-1));
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--card-radius, var(--radius-lg));
  padding: var(--card-padding, var(--space-6));
  position: sticky;
  top: var(--space-8);
}

/* Secoes do checkout */
.wc-block-components-checkout-step {
  background: var(--card-bg, var(--color-surface-1));
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--card-radius, var(--radius-lg));
  padding: var(--card-padding, var(--space-6));
}
.wc-block-components-checkout-step__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--fw-semibold, 600);
  color: var(--color-heading);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.wc-block-components-checkout-step__heading-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--fw-bold, 700);
  flex-shrink: 0;
}

/* Inputs do checkout */
.wc-block-components-text-input,
.wc-block-components-select { margin-bottom: var(--space-4); }
.wc-block-components-text-input input,
.wc-block-components-select select,
.wc-block-components-country-input input {
  width: 100%;
  padding: var(--input-padding-y, 12px) var(--input-padding-x, 16px);
  border: 1px solid var(--input-border, var(--color-border-subtle));
  border-radius: var(--input-radius, var(--radius-md));
  background: var(--input-bg, var(--color-surface-1));
  color: var(--input-text, var(--color-text));
  font-size: var(--font-size-base);
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}
.wc-block-components-text-input input:focus,
.wc-block-components-select select:focus {
  border-color: var(--input-border-focus, var(--color-accent));
}
.wc-block-components-text-input label,
.wc-block-components-select label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--fw-medium, 500);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* Checkbox */
.wc-block-components-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.wc-block-components-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.wc-block-components-checkbox .wc-block-components-checkbox__label {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  cursor: pointer;
}

/* Metodos de pagamento */
.wc-block-components-payment-method-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  margin-bottom: var(--space-3);
}
.wc-block-components-payment-method-label:hover {
  border-color: var(--color-accent);
  background: var(--color-surface-2);
}
input[type="radio"]:checked + .wc-block-components-payment-method-label,
.wc-block-components-radio-control__option--checked .wc-block-components-payment-method-label {
  border-color: var(--color-accent);
  background: var(--color-surface-2);
}
.wc-block-components-radio-control__input { accent-color: var(--color-accent); }
.wc-block-components-payment-method-label__visuals img { height: 24px; width: auto; }
.wc-block-components-payment-method-label__label {
  font-weight: var(--fw-medium, 500);
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

/* Resumo do pedido (sidebar checkout) */
.wc-block-checkout__order-summary-heading {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: var(--fw-semibold, 600);
  color: var(--color-heading);
  margin-bottom: var(--space-6);
}
.wc-block-components-order-summary-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.wc-block-components-order-summary-item__image img {
  width: 56px;
  height: 74px;
  object-fit: cover;
  border-radius: var(--radius-md);
}
.wc-block-components-order-summary-item__full-name {
  font-size: var(--font-size-sm);
  font-weight: var(--fw-semibold, 600);
  color: var(--color-heading);
}
.wc-block-components-order-summary-item__quantity {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
.wc-block-components-order-summary-item__total-price {
  font-weight: var(--fw-semibold, 600);
  color: var(--color-heading);
  margin-left: auto;
  white-space: nowrap;
}

/* Botoes genericos dos blocos */
.wc-block-components-button {
  padding: var(--btn-padding-y, 10px) var(--btn-padding-x, 20px);
  border-radius: var(--btn-radius, var(--radius-md));
  font-size: var(--font-size-sm);
  font-weight: var(--btn-font-weight, 600);
  cursor: pointer;
  transition: background var(--transition-base);
  border: none;
  background: var(--btn-primary-bg, var(--color-accent));
  color: var(--btn-primary-text, var(--color-text-inverse));
}
.wc-block-components-button:hover {
  background: var(--btn-primary-hover-bg, var(--color-accent-hover));
}

/* Notices */
.wc-block-components-notice-banner {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-6);
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface-1);
  color: var(--color-text);
}
.wc-block-components-notice-banner.is-error {
  border-left-color: var(--color-danger);
}
.wc-block-components-notice-banner.is-success {
  border-left-color: var(--color-success);
}
