/* =========================================================
   MAEW – PRODUCTO INDIVIDUAL + RELACIONADOS (FIX TOOLTIPS)
   ========================================================= */

:root {
  --maew-red: #e3032d;
  --maew-ink: #151515;
  --maew-ink-2: #334155;
  --maew-line: #e2e8f0;
  --maew-surface: #f8fafc;
  --radius: 12px;
}

/* ---------------------------------------------------------
   1. FICHA DE PRODUCTO (Parte Superior)
   --------------------------------------------------------- */
.woocommerce div.product div.summary {
  display: flex; flex-direction: column;
}

.maew-uxwrap {
  display: flex; flex-direction: column; gap: 16px; align-items: flex-start; width: 100%;
}

.maew-uxtitle {
  font-family: "Poppins", sans-serif; font-weight: 800; font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1; color: var(--maew-ink); margin: 0 !important;
}

.maew-uxdesc {
  font-size: 16px; line-height: 1.6; color: var(--maew-ink-2); margin: 0;
}

.maew-pill {
  display: inline-flex; align-items: center; background: #fff; color: var(--maew-red);
  font-weight: 700; padding: 8px 16px; border-radius: 50px; border: 1px solid var(--maew-line);
  box-shadow: 0 2px 10px rgba(0,0,0,0.03); font-size: 14px;
}

/* COLORES (SWATCHES + TOOLTIPS RECUPERADOS) */
.maew-product-colors { width: 100%; }

.maew-swatch {
  display: block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #e2e8f0;
  cursor: pointer; position: relative; transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.maew-swatch:hover { transform: scale(1.2); border-color: #94a3b8; z-index: 100; }

/* Tooltip (El nombre del color) */
.maew-swatch::before {
  content: attr(data-tooltip);
  position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%) translateY(5px);
  background: #1e293b; color: #fff; font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 6px; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
/* Flechita del Tooltip */
.maew-swatch::after {
  content: '';
  position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%) translateY(5px);
  border: 5px solid transparent; border-top-color: #1e293b;
  opacity: 0; visibility: hidden; margin-bottom: -10px;
  transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
/* Efecto Hover */
.maew-swatch:hover::before, .maew-swatch:hover::after {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

/* Botones Principales */
.maew-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 8px; }
.maew-btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none !important;
  font-weight: 700; border-radius: 12px; padding: 14px 24px; font-size: 16px; transition: transform .2s; width: 100%;
}
.maew-btn--primary {
  background: linear-gradient(180deg, #ff2a4c 0%, var(--maew-red) 100%);
  color: #fff !important; box-shadow: 0 4px 14px rgba(227, 3, 45, 0.3); border: none;
}
.maew-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(227, 3, 45, 0.4); }
.maew-btn--ghost { background: #fff; border: 2px solid var(--maew-line); color: var(--maew-ink-2) !important; }
.maew-btn--ghost:hover { background: var(--maew-surface); }

.maew-ship {
  background: var(--maew-surface); border: 1px solid var(--maew-line); border-radius: 12px;
  padding: 12px 16px; color: var(--maew-ink-2); font-weight: 500; font-size: 14px; width: 100%;
}

@media (min-width: 768px) {
  .maew-actions { flex-direction: row; }
  .maew-btn { width: auto; min-width: 200px; }
}

/* ---------------------------------------------------------
   2. PESTAÑAS DE DESCRIPCIÓN (¡ESTO ES LO NUEVO!)
   --------------------------------------------------------- */
/* Estilos para que el texto de descripción se vea bonito abajo */
.woocommerce-tabs {
    margin-top: 60px;
    clear: both;
}

/* Pestañas (Botones) */
.woocommerce-tabs ul.tabs {
    list-style: none !important; padding: 0 !important; margin: 0 0 20px !important;
    display: flex; gap: 20px; border-bottom: 2px solid #e2e8f0;
}
.woocommerce-tabs ul.tabs li {
    border: none !important; background: transparent !important; margin: 0 !important; padding: 0 !important;
}
.woocommerce-tabs ul.tabs li a {
    display: block; padding: 10px 0; 
    font-family: "Poppins", sans-serif; font-weight: 700; font-size: 16px; 
    color: #64748b; text-decoration: none; 
    border-bottom: 3px solid transparent; transition: all 0.2s;
}
/* Pestaña Activa */
.woocommerce-tabs ul.tabs li.active a {
    color: var(--maew-red); border-bottom-color: var(--maew-red);
}

/* Caja de Texto */
.woocommerce-tabs .panel {
    background: #fff; 
    /* border: 1px solid #e2e8f0; border-radius: 12px;  <-- Si quieres borde descomenta esto */
    padding: 10px 0; /* Espacio arriba/abajo */
    font-size: 16px; line-height: 1.8; color: #334155;
}
.woocommerce-tabs .panel h2 { display: none; } /* Ocultar título repetido */


/* ---------------------------------------------------------
   3. PRODUCTOS RELACIONADOS (Diseño de Tarjetas)
   --------------------------------------------------------- */

/* FIX DE ESPACIOS FANTASMA (Mata el hueco a la izquierda) */
.related.products ul.products::before,
.related.products ul.products::after,
.upsells.products ul.products::before,
.upsells.products ul.products::after {
    display: none !important;
    content: none !important;
}

/* Títulos de sección */
.related.products h2, 
.upsells.products h2 {
    font-size: 24px; font-weight: 800; color: #18233f;
    margin-top: 60px; margin-bottom: 30px;
    border-bottom: 2px solid #f1f5f9; padding-bottom: 15px;
}

/* Grid de 4 columnas */
.related.products ul.products,
.upsells.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important; margin: 0 !important; padding: 0 !important;
}

/* Tarjeta (Card) */
.related.products ul.products li.product,
.upsells.products ul.products li.product {
    float: none !important; width: 100% !important; margin: 0 !important;
    background: #fff; border: 1px solid var(--maew-line); border-radius: 12px;
    padding: 15px; display: flex !important; flex-direction: column;
    transition: transform 0.2s;
}
.related.products ul.products li.product:hover,
.upsells.products ul.products li.product:hover {
    transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); border-color: #cbd5e1;
}

/* Imagen envuelta */
.maew-card-thumb {
    background: #f8fafc; border-radius: 8px; padding: 10px; margin-bottom: 12px;
    height: 150px; display: flex; align-items: center; justify-content: center;
}
.maew-card-thumb img {
    max-height: 100%; width: auto !important; object-fit: contain !important; mix-blend-mode: multiply;
}

/* Textos */
.maew-iva {
    display: inline-block; font-size: 9px; font-weight: 700; color: #64748b; background: #eef2ff;
    padding: 3px 6px; border-radius: 4px; margin-bottom: 6px; width: fit-content;
}
.related.products .woocommerce-loop-product__title,
.upsells.products .woocommerce-loop-product__title {
    font-size: 15px !important; font-weight: 800 !important; color: #1e293b;
    margin: 0 0 5px !important; line-height: 1.3 !important;
}
.maew-card-excerpt {
    font-size: 12px; color: #64748b; margin-bottom: 15px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Botón Cotizar (Rojo) */
.maew-card-btn {
    margin-top: auto; display: block; width: 100%; text-align: center;
    background: var(--maew-red); color: #fff !important;
    padding: 10px; border-radius: 8px; font-weight: 700; text-decoration: none !important; font-size: 13px;
}
.maew-card-btn:hover { background: #c00226; }

/* Limpieza */
.related.products .price, .related.products .button, .related.products .star-rating,
.upsells.products .price, .upsells.products .button, .upsells.products .star-rating {
    display: none !important;
}

/* Responsive */
@media (max-width: 900px) {
    .related.products ul.products, .upsells.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}