/* Wrapper / títulos */
.ce-wrapper {
  font-family: system-ui, sans-serif;
  color:#333;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  clear: both;
  flex-basis: 100% !important;
  order: -1;
  margin-bottom: 1.5rem;
}
.ce-title { font-size:1.25rem; font-weight:700; margin:0 0 1rem; }

/* Inputs y selects */
.ce-content label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.ce-content input[type="number"],
.ce-content select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  font-size: 0.95rem;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ce-content input[type="number"]:focus,
.ce-content select:focus {
  outline: none;
  border-color: #B1A100;
  box-shadow: 0 0 0 2px rgba(242, 139, 40, 0.15);
}

.ce-content select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Acordeón */
.ce-accordion {
  border:1px solid #e6e6e6;
  border-radius:6px;
  overflow:hidden;
  margin-bottom:.8rem;
  background:#fff;
  width: 100%;
  box-sizing: border-box;
}
.ce-header {
  background:#f7f7f7;
  padding:.75rem 1rem;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  align-items:center;
  transition: background-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}
.ce-header:hover { background:#efefef; }
.ce-header.active { background:#e8e8e8; }
.ce-header::after { content: '▼'; font-size: 0.8rem; color: #666; transition: transform 0.2s ease; margin-left: 0.5rem; }
.ce-header.active::after { transform: rotate(180deg); }
.ce-header h4 {
  font-size:.95rem;
  margin:0;
  font-weight:600;
}
.ce-content {
  padding:.75rem 1rem;
  border-top:1px solid #eee;
  display: none;
  width: 100%;
  box-sizing: border-box;
}
.ce-content.active { display: block; }
.ce-muted { color:#777; font-size:.9rem; }

/* Opciones */
.ce-options {
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  width: 100%;
  box-sizing: border-box;
}

.ce-info-icon {
  display: inline-block;
  margin-left: 0.5rem;
  cursor: pointer;
  color: black;
  font-size: 20px;
  font-weight: bold;
}

.ce-info-icon:hover {
  color: darkred;
}
.ce-option {
  border:1px solid #d8d8d8; border-radius:6px; padding:.5rem .75rem; cursor:pointer;
  background:#fff; user-select:none; transition:box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
.ce-option:hover { box-shadow:0 1px 0 rgba(0,0,0,.06); transform:translateY(-1px); }
.ce-option.selected { border-color:#B1A100; box-shadow:0 0 0 2px rgba(242,139,40,.15) inset; background:#fff7ef; }

/* Mantener compatibilidad: posible duplicados no afectan layout; kept intentionally */
/* Opciones (duplicated block preserved) */
.ce-options { display:flex; flex-wrap:wrap; gap:.5rem; }
.ce-option {
  border:1px solid #d8d8d8; border-radius:6px; padding:.5rem .75rem; cursor:pointer;
  background:#fff; user-select:none; transition:box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
.ce-option:hover { box-shadow:0 1px 0 rgba(0,0,0,.06); transform:translateY(-1px); }
.ce-option.selected { border-color:#B1A100; box-shadow:0 0 0 2px rgba(242,139,40,.15) inset; background:#fff7ef; }

/* Chips y thumbs */
.ce-option--chip { padding:.45rem .65rem; border-radius:999px; }

/* Nuevos estilos para opciones con imágenes */
.ce-options--thumbs .ce-option--thumb {
  width: 120px;
  text-align: center;
  padding: .75rem .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ce-options--thumbs .ce-option--thumb:hover {
  border-color: #bbb;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.ce-options--thumbs .ce-option--thumb.selected {
  border-color: #B1A100;
  background: #fff7ef;
  box-shadow: 0 0 0 3px rgba(242,139,40,.2);
}

.ce-option-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #f0f0f0;
}

.ce-option-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  text-align: center;
  line-height: 1.2;
}

.ce-option-helper {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.15rem;
  text-align: center;
}

.ce-samples-cta {
  margin-top: 1.75rem;
  padding: 1.1rem;
  border: 1px dashed #e4a33c;
  border-radius: 12px;
  background: #fff9f1;
  display: grid;
  gap: 0.8rem;
  justify-items: center;
  align-items: center;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.ce-samples-cta__title {
  font-weight: 700;
  color: #c67518;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.ce-samples-cta__button {
  padding: 0.9rem 1.5rem;
  width: 100%;
  max-width: none;
  background: linear-gradient(180deg, #f0a22f 0%, #d97e12 100%);
  border: 1px solid #d97e12;
  border-radius: 9px;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ce-samples-cta__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(217, 126, 18, 0.25);
}

.ce-samples-cta__button:focus {
  outline: 2px solid rgba(217, 126, 18, 0.3);
  outline-offset: 2px;
}

.ce-samples-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.ce-samples-modal.active {
  display: flex;
}

.ce-samples-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.ce-samples-modal__dialog {
  position: relative;
  width: min(760px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ce-samples-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: #f5f5f5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ce-samples-modal__close:hover {
  background: #ededed;
}

.ce-samples-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #c67518;
}

.ce-samples-modal__info {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
  background: #fff9f1;
  border: 1px dashed #f0a22f;
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.ce-samples-section {
  display: grid;
  gap: 0.6rem;
}

.ce-samples-product {
  margin: 0;
  font-weight: 700;
  color: #444;
}

.ce-samples-section__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.ce-samples-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.ce-sample-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.03);
}

.ce-sample-thumb {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 1px solid #f0f0f0;
}

.ce-sample-info {
  display: grid;
  gap: 0.15rem;
}

.ce-sample-name {
  font-weight: 700;
  color: #333;
}

.ce-sample-ref {
  font-size: 0.9rem;
  color: #666;
}

.ce-sample-remove {
  border: none;
  background: transparent;
  font-size: 22px;
  color: #c64a2b;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: transform 0.1s ease;
}

.ce-sample-remove:hover {
  transform: scale(1.05);
}

.ce-samples-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: #555;
}

.ce-samples-alert {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.ce-samples-alert--warning {
  background: #fff7e6;
  border-color: #f5c76d;
  color: #8a6405;
}

.ce-samples-alert--error {
  background: #fff2f0;
  border-color: #f5a5a0;
  color: #b42816;
  display: none;
}

.ce-samples-alert--success {
  background: #e8f7ef;
  border-color: #8cd4a2;
  color: #1d7a3c;
  display: none;
}

.ce-samples-section--address {
  margin-top: 0.5rem;
}

.ce-samples-fieldset {
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  padding: 0.85rem 1rem 1rem;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.ce-samples-fieldset + .ce-samples-fieldset {
  margin-top: 0.75rem;
}

.ce-samples-fieldset legend {
  padding: 0 0.25rem;
  font-weight: 700;
  color: #444;
}

.ce-samples-form {
  display: grid;
  gap: 0.65rem;
}

.ce-samples-form__row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.ce-samples-form__row:nth-child(2),
.ce-samples-form__row:nth-child(5) {
  grid-template-columns: 1fr;
}

.ce-samples-form__row--checkbox {
  grid-template-columns: 1fr;
}

.ce-samples-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #dedede;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.ce-samples-input[readonly] {
  background: #f7f7f7;
  color: #555;
}

.ce-samples-input:focus {
  outline: 2px solid rgba(240, 162, 47, 0.35);
  border-color: #f0a22f;
}

.ce-samples-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #444;
}

.ce-samples-checkbox input {
  margin-top: 0.2rem;
}

.ce-samples-checkbox a {
  color: #c67518;
}

.ce-samples-modal__footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.ce-samples-btn {
  border-radius: 9px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.ce-samples-btn--primary {
  background: linear-gradient(180deg, #f0a22f 0%, #d97e12 100%);
  border-color: #d97e12;
  color: #fff;
  box-shadow: 0 6px 12px rgba(217, 126, 18, 0.25);
}

.ce-samples-btn--ghost {
  background: #fff;
  border-color: #d0d0d0;
  color: #333;
}

.ce-samples-btn:hover {
  transform: translateY(-1px);
}

.ce-samples-btn:focus {
  outline: 2px solid rgba(217, 126, 18, 0.25);
  outline-offset: 2px;
}

/* Badge numérica (para 8/10) */
.ce-badge {
  display:inline-block; width:24px; height:24px; line-height:24px; text-align:center;
  border-radius:999px; background:#f0f0f0; font-weight:700; margin-right:.35rem;
}

/* Resumen */
.ce-summary--final { background:#fafafa; border:1px solid #e6e6e6; border-radius:8px; padding:1rem; margin-top:1rem; width:100%; box-sizing:border-box; }
.ce-product-name { color:#B1A100; font-weight:700; margin:.15rem 0 1rem; }
.ce-summary-grid { display:grid; grid-template-columns: 1fr 1fr; gap:.6rem 2rem; }
.ce-summary-item { display:flex; gap:.35rem; }
.ce-summary-key { color:#666; }
.ce-summary-val { font-weight:700; }

.ce-price-box {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  background: #fafafa;
  display: none;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  text-align: center;
}

.ce-price-value,
[data-ce-price-target] {
  color: #B1A100;
  font-weight: 700;
  font-size: 1.2rem;
}

.ce-price-breakdown {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ce-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: #444;
}

.ce-breakdown-label {
  font-weight: 500;
}

.ce-breakdown-value,
[data-ce-price-base],
[data-ce-price-motor] {
  font-weight: 600;
  color: #222;
}

/* Estilos para opciones del estor en carrito/checkout */
.woocommerce-cart-form .product-name dl.variation,
.woocommerce-checkout-review-order .product-name dl.variation {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.woocommerce-cart-form .product-name dl.variation dt,
.woocommerce-checkout-review-order .product-name dl.variation dt {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.woocommerce-cart-form .product-name dl.variation dd,
.woocommerce-checkout-review-order .product-name dl.variation dd {
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 0.5rem 0;
  color: #666;
}

/* Botón de zoom */
.ce-option {
  position: relative;
}

.ce-zoom-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
  padding: 0;
}

.ce-option:hover .ce-zoom-btn {
  opacity: 1;
}

.ce-zoom-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* Lightbox Modal */
.ce-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.ce-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ce-lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.ce-lightbox-content {
  position: relative;
  z-index: 10000;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: ce-lightbox-fade-in 0.3s ease;
}

@keyframes ce-lightbox-fade-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#ce-lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.ce-lightbox-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
}

.ce-lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  font-weight: bold;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10001;
  transition: color 0.2s ease;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ce-lightbox-close:hover {
  color: #ccc;
}

/* Info Lightbox Modal */
.ce-info-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.ce-info-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ce-info-lightbox .ce-lightbox-content {
  max-width: 600px;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  max-height: 80vh;
  overflow-y: auto;
}

.ce-info-lightbox-content {
  color: #333;
  line-height: 1.5;
  font-size: 1rem;
}

.ce-info-lightbox-content h1,
.ce-info-lightbox-content h2,
.ce-info-lightbox-content h3,
.ce-info-lightbox-content h4,
.ce-info-lightbox-content h5,
.ce-info-lightbox-content h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #222;
}

.ce-info-lightbox-content p {
  margin-bottom: 1rem;
}

.ce-info-lightbox-content ul,
.ce-info-lightbox-content ol {
  margin-bottom: 1rem;
  margin-left: 2rem;
}

.ce-info-lightbox-content li {
  margin-bottom: 0.25rem;
}

.ce-info-lightbox-content a {
  color: #B1A100;
  text-decoration: underline;
}

.ce-info-lightbox-content a:hover {
  color: #8E9200;
}

.ce-info-lightbox-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 30px;
  font-weight: bold;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ce-info-lightbox-close:hover {
  color: #333;
}

/* RESPONSIVE DESIGN */
/* Tablets y teléfonos grandes */
@media (max-width: 768px) {
  .ce-wrapper {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .ce-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .ce-content input[type="number"],
  .ce-content select {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .ce-options--thumbs {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .ce-option--thumb {
    width: 100%;
    max-width: none;
  }

  .ce-samples-cta {
    padding: 0.9rem;
    gap: 0.5rem;
  }

  .ce-samples-cta__button {
    font-size: 0.95rem;
  }

  .ce-samples-modal__dialog {
    width: 95vw;
    max-height: 92vh;
  }

  .ce-samples-modal__footer {
    grid-template-columns: 1fr;
  }

  .ce-summary--final {
    padding: 0.75rem;
  }

  .ce-summary-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .ce-price-box {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Teléfonos pequeños */
@media (max-width: 480px) {
  .ce-wrapper {
    padding: 0.5rem;
  }

  .ce-title {
    font-size: 1rem;
  }

  .ce-accordion {
    border-radius: 4px;
  }

  .ce-header {
    padding: 0.5rem 0.75rem;
  }

  .ce-header h4 {
    font-size: 0.85rem;
  }

  .ce-content {
    padding: 0.5rem 0.75rem;
  }

  .ce-options {
    margin-bottom: 0.5rem;
  }

  .ce-options--thumbs {
    grid-template-columns: 1fr;
  }

  .ce-option--chip {
    padding: 0.3rem 0.5rem;
  }

  .ce-option--thumb {
    padding: 0.5rem 0.25rem;
  }

  .ce-option-image {
    width: 60px;
    height: 60px;
  }

  .ce-option-label {
    font-size: 0.75rem;
  }

  .ce-muted {
    font-size: 0.8rem;
  }

  .ce-summary--final {
    padding: 0.5rem;
    border-radius: 4px;
  }

  .ce-product-name {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .ce-price-box {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .ce-samples-cta {
    padding: 0.75rem;
  }

  .ce-samples-cta__title {
    font-size: 0.85rem;
  }

  .ce-samples-cta__button {
    font-size: 0.9rem;
    padding: 0.8rem 1rem;
  }

  .ce-samples-modal__dialog {
    padding: 1rem;
  }

  .ce-sample-item {
    grid-template-columns: 60px 1fr auto;
  }

  .ce-sample-thumb {
    width: 60px;
    height: 60px;
  }

  .ce-samples-form__row {
    grid-template-columns: 1fr;
  }

  /* Info icons en móviles */
  .ce-info-icon {
    font-size: 18px;
    margin-left: 0.25rem;
  }

  /* Lightbox responsive */
  .ce-lightbox-content {
    max-width: 95vw;
    max-height: 90vh;
    padding: 1rem;
  }

  #ce-lightbox-image {
    max-height: 70vh;
  }

  .ce-lightbox-toggle {
    right: 20px;
    top: 15px;
  }

  .ce-lightbox-close {
    right: 25px;
    top: 15px;
    font-size: 35px;
  }

  .ce-info-lightbox-content {
    max-width: 95vw;
    padding: 1rem;
  }

  .ce-info-lightbox .ce-lightbox-content {
    max-height: 85vh;
  }
}

/* Responsive utilities */
/* Ocultar elementos en móviles si es necesario */
@media (max-width: 480px) {
  .ce-hide-mobile {
    display: none !important;
  }

  /* Botones más grandes en móviles */
  .ce-option {
    min-height: 44px; /* Apple's recommended minimum touch target size */
  }
}
