/* pypstyless.css */
/* ================================
   Cart + Register Styles (App Proxy)
   ================================ */
.page-width {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

/* Utilities */
.page-width .hidden {
  display: none !important;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Base Table Styles (kept) */
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}
th {
  background-color: #f2f2f2;
}
tr:hover {
  background-color: #f5f5f5;
}

#cart-message-container span {
  background: red;
  color: white;
  padding: 10px;
  margin: 2px auto;
  border-radius: 5px;
  display: block;
}

/* Inline messages in cart header */
#cart-message-container p {
  margin: 0 0 8px 0;
  font-size: 18px; /* was 1.5rem */
  line-height: 1.5;
}

/* =================================
 * Cart Skeleton styles (kept + tuned)
 * ================================= */

.cart-container {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 200px 120px; /* safer minmax */
  grid-gap: 20px 8px; /* a bit wider columns gap */
  padding: 12px;
}

.cart-item {
  display: contents;
}

.cart-container .columna {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0; /* prevent overflow on long titles */
}

.cart-container .columna.contenedor-1 {
  align-items: flex-start;
  justify-content: flex-start;
}

.cart-container .columna.contenedor-2 {
  justify-content: space-between;
  gap: 12px;
}

.cart-item-details {
  padding: 0 15px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cart-item-title {
  font-weight: 600;
  line-height: 1.25;
  font-size: 16px;
  word-break: break-word;
}

.cart-item-tiered-price {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px; /* was 0.95rem */
}

.cart-item-tiered-price span {
  font-size: 16px;
}
.cart-item-tiered-price small s {
  font-size: 15px;
  opacity: 0.6;
}

#tieredPriceHeading {
  font-size: 14px; /* was 0.95rem */
  font-weight: 600;
  padding: 6px 10px;
  border: 1px dashed #ddd;
  border-radius: 6px;
}

.cart-item.cart-item-header {
  font-size: 16px;
}

.cart-item-image img {
  width: 150px;
  height: auto;
  border-radius: 6px;
  display: block;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0;
}

/* ---- Consistent control heights (buttons = input) ---- */
.cart-item-quantity input {
  height: 42px;
  box-sizing: border-box;
  padding: 0; /* vertical padding 0 to match fixed height */
  text-align: center;
  max-width: 43px;
  border: solid #ccc;
  border-width: 1px 0;
  margin: 0 -4px;
  border-radius: 0;
  appearance: textfield;
  line-height: 42px; /* improves vertical centering across browsers */
}

.cart-item-quantity input::-webkit-outer-spin-button,
.cart-item-quantity input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-button-pyp {
  border-radius: 0px !important;
  height: 42px; /* match input height */
  min-width: 42px; /* square buttons */
  box-sizing: border-box;
  padding: 0; /* rely on fixed height/width */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: #000;
  border: 1px solid #ccc;
  cursor: pointer;
  line-height: 1;
}

.qty-button-pyp:focus-visible,
.cart-container .button:focus-visible {
  outline: 2px solid #000;
  outline-offset: 1px;
}

.columna .cart-item-actions cart-remove-button {
  margin: unset;
  margin-left: 15px;
  display: unset;
}

.cart-container .columna.cart-item-total {
  justify-content: flex-end;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.cart-item-header {
  font-weight: bold;
}

.cart-container .loading__spinner {
  position: relative;
  padding-top: 0;
  width: 32px;
  height: 32px;
}

/* Spinner visuals */
.loading__spinner .spinner {
  width: 32px;
  height: 32px;
  animation: pyp-rotate 1s linear infinite;
}
.loading__spinner .path {
  stroke: #999;
  stroke-linecap: round;
  animation: pyp-dash 1.5s ease-in-out infinite;
}
@keyframes pyp-rotate {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes pyp-dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.cart-item .cart-item-image {
  display: flex;
  justify-content: flex-start;
}

.titulo-mas-rango {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  flex-direction: row;
  gap: 12px;
  margin-bottom: 6px;
}

.titulo-mas-rango h1 {
  font-size: 25px; /* was 2.5rem */
  margin: 8px 0;
}

.cart-container .cart-item-separator {
  grid-column: 1 / -1;
  display: block;
  min-height: 12px;
}

.cart-container .cart-item-separator.border {
  grid-column: 1 / -1;
  border-bottom: 1px solid #e5e5e5;
  display: block;
  min-height: 8px;
}

.acciones {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}

.acciones .underlined-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-total-pyp {
  grid-column: 1 / -1;
  display: flex;
  padding: 18px 0 10px 0;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 6px;
  border-top: 1px solid #eee;
}

.cart-total-pyp #tieredTotal {
  font-weight: 700;
}

/* Buttons */
.boton-pyp {
  background-color: black;
  color: white;
  padding: 10px 20px;
  border: none;
  display: block;
}
.boton-pyp:hover {
  background-color: grey;
  color: black;
}

/* Theme button inside cart actions */
.cart-container .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  text-decoration: none;
}

.cart-container .button:hover {
  background: #333;
  border-color: #333;
}

.cart-container .button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Remove button (anchor with .button--tertiary) */
.cart-item-actions .button--tertiary {
  border: 1px solid #ddd;
  background: #fafafa;
  color: #111;
  padding: 10px 12px;
  min-height: 42px;
}

.cart-item-actions .button--tertiary:hover {
  background: #f0f0f0;
}

/* --- Make trash (remove) SVG always visible without touching qty buttons --- */
.cart-item-actions .button--tertiary .icon,
.cart-item-actions .button--tertiary svg {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
  overflow: visible;
}
.cart-item-actions .button--tertiary svg path {
  fill: currentColor;
}
.cart-item-actions .icon-remove {
  display: inline-block !important;
}

/* =========================
   Responsive adjustments
   ========================= */

@media (max-width: 1024px) {
  .cart-container {
    grid-template-columns: minmax(0, 1fr) 170px 100px;
    grid-gap: 16px 8px;
  }
  .cart-item-image img {
    width: 130px;
  }
}

@media (max-width: 820px) {
  .cart-container {
    grid-template-columns: minmax(0, 1fr) 160px 96px;
  }
  .cart-item-image img {
    width: 120px;
  }
}

@media (max-width: 690px) {
  .cart-container .columna.cart-item-total {
    display: none;
  } /* hide per-line total column */
  .cart-container {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) 180px;
    grid-gap: 12px 10px;
    padding: 10px;
  }
  .cart-item-image img {
    width: 100px;
    height: auto;
  }
  .titulo-mas-rango {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  #tieredPriceHeading {
    align-self: flex-start;
  }
}

@media (max-width: 520px) {
  .cart-container {
    grid-template-columns: minmax(0, 1fr) 150px;
    grid-gap: 10px;
  }
  .cart-item-image img {
    width: 86px;
  }

  /* Smaller but consistent controls on narrow screens */
  .qty-button-pyp {
    height: 38px;
    min-width: 38px;
    padding: 0;
  }
  .cart-item-quantity input {
    height: 38px;
    line-height: 38px;
    padding: 0 8px;
    width: 52px;
  }
}

@media (max-width: 430px) {
  .cart-container {
    grid-template-columns: 1fr 130px;
    grid-gap: 10px;
    padding: 8px;
  }
  .cart-item-image img {
    width: 70px;
    height: auto;
  }

  .cart-item-details {
    padding: 0 0 0 10px;
    flex-direction: column;
    text-align: right;
    align-items: flex-end;
    gap: 2px;
  }

  .cart-container .columna.contenedor-2 {
    flex-direction: column;
    gap: 8px;
  }
  .cart-container .columna.contenedor-1 {
    justify-content: space-between;
  }

  /* Single column fallback for very narrow screens */
  @media (max-width: 375px) {
    .cart-container {
      grid-template-columns: 1fr;
    }
    .cart-item-header {
      display: none;
    }
    .titulo-mas-rango {
      align-items: flex-start;
      flex-direction: column;
    }
    .cart-item-image img {
      width: 150px;
    }
    .cart-container .columna.contenedor-2 {
      flex-direction: row-reverse;
      justify-content: flex-start;
      gap: 10px;
    }
    .cart-container .columna.contenedor-1 {
      flex-direction: row;
      justify-content: space-between;
      gap: 10px;
    }
    .cart-container .columna .cart-item-actions cart-remove-button {
      margin-left: 0px;
    }
    .cart-container .columna .cart-item-actions {
      border: 1px solid #ddd;
      margin-right: 12px;
      border-radius: 6px;
      padding: 4px;
    }
    .cart-container .columna cart-remove-button .button {
      min-height: 52px;
    } /* was 3.2rem */
  }
}

/* =========================
   Register Page Styles (kept)
   ========================= */
.registro-mayoristas {
  display: flex;
  justify-content: center;
}
.registro-mayoristas div {
  margin-bottom: 20px;
}
.registro-mayoristas form {
  width: 100%;
}
.registro-mayoristas .registrarse {
  width: 100%;
}
.registro-mayoristas .ya-tienes-cuenta {
  text-align: right;
  display: block;
}
.registro-mayoristas .texto-destacado {
  font-weight: bold;
  font-size: 24px;
} /* was 1.5rem */


/* ===== Register (Wholesale) ===== */
.registro-mayoristas.customer.login {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.registro-mayoristas.customer.login > div {
  width: 100%;
  max-width: 480px;
}

.registro-mayoristas h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 8px 0;
}

.registro-mayoristas p {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 14px 0;
}

#registrationForm {
  width: 100%;
}

#registrationForm .field {
  position: relative;
  margin-bottom: 18px;
}

/* Input */
#registrationForm .field input[type="email"] {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  padding: 12px 14px;
  font-size: 16px;
  color: #111;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Hide placeholder to use floating label cleanly */
#registrationForm .field input::placeholder { color: transparent; }

/* Label (floating) */
#registrationForm .field label {
  position: absolute;
  left: 12px;
  top: 22px; /* center-ish when input empty */
  transform: translateY(-50%);
  padding: 0 4px;
  background: #fff;
  color: #777;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  transition: all 0.15s ease;
}

/* Float label on focus or when value present */
#registrationForm .field input:focus + label,
#registrationForm .field input:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 12px;
  color: #111;
}

#registrationForm .field input:focus {
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
}

/* Error box */
#errorContainer {
  margin: 8px 0 14px 0;
  padding: 10px 12px;
  background: #ffe6e6;
  border: 1px solid #ff9b9b;
  border-radius: 6px;
  color: #7a0b0b;
  font-size: 14px;
}
#errorContainer:empty { display: none; }

/* Link: already have an account */
.ya-tienes-cuenta {
  display: inline-block;
  width: 100%;
  text-align: right;
  font-size: 14px;
  text-underline-offset: 3px;
  margin: 4px 0 12px 0;
}

/* Submit button */
.registro-mayoristas .registrarse {
  width: 100%;
  height: 44px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.registro-mayoristas .registrarse:hover {
  background: #333;
  border-color: #333;
}
.registro-mayoristas .registrarse:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Small screens */
@media (max-width: 420px) {
  .registro-mayoristas h1 { font-size: 24px; }
  #registrationForm .field input[type="email"] { height: 42px; }
  .registro-mayoristas .registrarse { height: 42px; font-size: 15px; }
}
/* ==== "Regístrate como mayorista" widget ==== */
#pyp-login-widget-no-mayorista{
  margin: 0 0 16px 0;
  padding: 12px 16px;
  background: #f6f6f6;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

#pyp-login-widget-no-mayorista h1{
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Override global .boton-pyp inside the widget */
#pyp-login-widget-no-mayorista .boton-pyp{
  display: inline-flex;            /* overrides global block */
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

#pyp-login-widget-no-mayorista .boton-pyp:hover{
  background: #333;
  border-color: #333;
  color: #fff;
}

#pyp-login-widget-no-mayorista .boton-pyp:focus-visible{
  outline: 2px solid #111;
  outline-offset: 2px;
}

@media (max-width: 460px){
  #pyp-login-widget-no-mayorista h1{
    font-size: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  #pyp-login-widget-no-mayorista .boton-pyp{ width: 100%; }
}
