/*
 * WooCommerce Base CSS
 * High-end electronics store redesign.
 *
 * @package wc-store
 */

/* ─── WooCommerce Baseline ──────────────────────────────────────────────────── */

.woocommerce,
.woocommerce-page {
  font-family: var(--wcstore-font-body);
  color: var(--wcstore-text);
  box-sizing: border-box;
}

.woocommerce h1,
.woocommerce h2,
.woocommerce h3,
.woocommerce h4,
.woocommerce h5,
.woocommerce h6,
.woocommerce .page-title,
.entry-title {
  font-family: var(--wcstore-font-heading);
  color: var(--wcstore-text);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ─── Notices ───────────────────────────────────────────────────────────────── */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: var(--wcstore-radius-md);
  margin-bottom: var(--sp-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  background: var(--wcstore-surface);
  border: 1px solid var(--wcstore-border-light);
  box-shadow: var(--wcstore-shadow-md);
}

.woocommerce-message::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wcstore-success);
  color: #fff;
  margin-right: 12px;
  font-size: 12px;
  flex-shrink: 0;
}

.woocommerce-error::before {
  content: '!';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wcstore-error);
  color: #fff;
  margin-right: 12px;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.woocommerce-info::before {
  content: 'i';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wcstore-primary);
  color: #fff;
  margin-right: 12px;
  font-family: serif;
  font-style: italic;
  font-weight: 800;
  flex-shrink: 0;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */

.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  height: 48px;
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--wcstore-radius-full);
  border: none;
  background: var(--wcstore-text);
  color: var(--wcstore-surface);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-out-expo);
  box-shadow: var(--wcstore-shadow-sm);
}

.woocommerce .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
  background: var(--wcstore-primary);
  color: #fff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--wcstore-shadow-glow);
}

.woocommerce .button.alt,
.woocommerce a.button.alt,
.woocommerce button.alt { /* scoped to .woocommerce to avoid global bleed */
  background: var(--wcstore-primary);
  color: #fff;
}

.woocommerce .button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.alt:hover {
  background: var(--wcstore-primary-dark);
  box-shadow: var(--wcstore-shadow-glow);
}

/* Secondary outline feeling for certain buttons */
.woocommerce .button.button-secondary {
  background: transparent;
  color: var(--wcstore-text);
  border: 1.5px solid var(--wcstore-border);
  box-shadow: none;
}

.woocommerce .button.button-secondary:hover {
  border-color: var(--wcstore-text);
  background: var(--wcstore-text);
  color: var(--wcstore-surface);
}

/* ─── Form Fields ───────────────────────────────────────────────────────────── */

.woocommerce form .form-row {
  margin-bottom: var(--sp-md);
  padding: 0;
}

.woocommerce form .form-row label {
  display: block;
  font-family: var(--wcstore-font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--wcstore-text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.woocommerce .quantity .qty,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-size: var(--text-base);
  font-family: var(--wcstore-font-body);
  font-weight: 500;
  color: var(--wcstore-text);
  background: color-mix(in srgb, var(--wcstore-bg) 50%, var(--wcstore-surface));
  border: 1px solid var(--wcstore-border);
  border-radius: var(--wcstore-radius-sm);
  transition: all var(--duration-fast) var(--ease-out-expo);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  appearance: none;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
  outline: none;
  background: var(--wcstore-surface);
  border-color: var(--wcstore-primary);
  box-shadow: 0 0 0 4px var(--wcstore-primary-light);
}

.woocommerce form .form-row input.woocommerce-invalid {
  border-color: var(--wcstore-error);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--wcstore-error) 20%, transparent);
}

/* Form Radios / Checkboxes */
.woocommerce form .form-row input[type="radio"],
.woocommerce form .form-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  accent-color: var(--wcstore-primary);
  cursor: pointer;
}

/* ─── Select2 Overrides ─────────────────────────────────────────────────────── */
/* Ensures country/state dropdowns match the new inputs */
.woocommerce .select2-container .select2-selection--single {
  height: 54px;
  padding: 14px 18px;
  font-size: var(--text-base);
  font-family: inherit;
  font-weight: 500;
  background: color-mix(in srgb, var(--wcstore-bg) 50%, var(--wcstore-surface));
  border: 1px solid var(--wcstore-border);
  border-radius: var(--wcstore-radius-sm);
  display: flex;
  align-items: center;
}

.woocommerce .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 52px;
  right: 12px;
}

/* ─── Tables ────────────────────────────────────────────────────────────────── */

.woocommerce table.shop_table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  background: transparent;
  margin-bottom: var(--sp-lg);
}

.woocommerce table.shop_table thead th {
  background: transparent;
  color: var(--wcstore-text-muted);
  font-family: var(--wcstore-font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--sp-sm) 0;
  border-bottom: 2px solid var(--wcstore-border-light);
  text-align: left;
}

.woocommerce table.shop_table td,
.woocommerce table.shop_table th {
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--wcstore-border-light);
  vertical-align: middle;
}

/* ─── Pagination ────────────────────────────────────────────────────────────── */

.woocommerce-pagination,
.woocommerce nav.woocommerce-pagination {
  margin-top: var(--sp-xl);
  text-align: center;
}

.woocommerce-pagination ul.page-numbers,
ul.page-numbers {
  display: inline-flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.woocommerce-pagination ul.page-numbers li a.page-numbers,
.woocommerce-pagination ul.page-numbers li span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  font-family: var(--wcstore-font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--wcstore-radius-full);
  text-decoration: none;
  color: var(--wcstore-text-muted);
  background: transparent;
  transition: all var(--duration-fast) var(--ease-out-expo);
}

.woocommerce-pagination ul.page-numbers li a.page-numbers:hover {
  background: var(--wcstore-border-light);
  color: var(--wcstore-text);
  transform: translateY(-2px);
}

.woocommerce-pagination ul.page-numbers li span.current {
  background: var(--wcstore-text);
  color: var(--wcstore-surface);
  box-shadow: var(--wcstore-shadow-sm);
}

/* ─── Breadcrumb ────────────────────────────────────────────────────────────── */

.wcstore-breadcrumb,
.woocommerce-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wcstore-text-muted);
  margin-bottom: var(--sp-md);
}

.wcstore-breadcrumb__link,
.woocommerce-breadcrumb a {
  color: var(--wcstore-text-muted);
  transition: color var(--duration-fast);
}

.wcstore-breadcrumb__link:hover,
.woocommerce-breadcrumb a:hover {
  color: var(--wcstore-primary);
}

.wcstore-breadcrumb__sep {
  opacity: 0.5;
}

.wcstore-breadcrumb__current {
  color: var(--wcstore-text);
}

/* ─── Quantity Input ────────────────────────────────────────────────────────── */

.wcstore-qty {
  display: inline-flex;
  align-items: center;
  background: var(--wcstore-bg);
  border-radius: var(--wcstore-radius-full);
  padding: 4px;
  border: 1px solid var(--wcstore-border-light);
}

.wcstore-qty__btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--wcstore-surface);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: var(--wcstore-text);
  transition: all var(--duration-fast) var(--ease-out-expo);
  box-shadow: var(--wcstore-shadow-sm);
}

.wcstore-qty__btn:hover {
  background: var(--wcstore-text);
  color: var(--wcstore-surface);
}

.wcstore-qty__btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor; /* +/- icons are stroked, not filled */
  fill: none;
}

.wcstore-qty__input {
  width: 44px !important;
  height: 40px !important;
  border: none !important;
  background: transparent !important;
  text-align: center;
  font-family: var(--wcstore-font-heading);
  font-size: var(--text-base) !important;
  font-weight: 700;
  padding: 0 !important;
  box-shadow: none !important;
  -moz-appearance: textfield;
}

.wcstore-qty__input::-webkit-outer-spin-button,
.wcstore-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ─── Rating Stars ──────────────────────────────────────────────────────────── */

.woocommerce .star-rating {
  color: var(--wcstore-accent);
  font-size: 14px;
}

@media (max-width: 768px) {
  .woocommerce table.shop_table_responsive thead {
    display: none;
  }

  .woocommerce table.shop_table_responsive tbody td {
    display: block;
    text-align: right;
    width: 100%;
    border-bottom: 1px solid var(--wcstore-border-light);
    padding: var(--sp-sm) 0;
  }

  .woocommerce table.shop_table_responsive tbody td::before {
    content: attr(data-title) "";
    float: left;
    font-family: var(--wcstore-font-heading);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wcstore-text-muted);
  }
}
