/* ========================================
   dif.css  –  Extensiones Difundir / Site 333
   Complementa styles.css con componentes
   del carrito, popup de variantes y tabs
======================================== */

/* ========================================
   Utilidad: Botón ancho completo
======================================== */
.btn--full {
    width: 100%;
    justify-content: center;
}

/* ========================================
   Botón agregar al carrito – listado
======================================== */
.product-card__cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.5;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.product-card__cart-btn:hover {
    background: var(--fucsia, #E91E8C);
    box-shadow: 0 4px 15px rgba(233, 30, 140, 0.3);
    transform: translateY(-1px);
}

/* ========================================
   Popup del Carrito  (confirmación + variantes)
======================================== */
.carro-popup {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
}

.carro-popup.activo {
    display: block;
}

.carro-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.carro-popup__box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 2rem));
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 1;
    max-height: 90vh;
    overflow-y: auto;
}

.carro-popup__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    font-size: 1rem;
    transition: all 0.2s;
}

.carro-popup__close:hover {
    background: var(--fucsia, #E91E8C);
    color: #fff;
}

/* Modo confirmación */
.carro-popup__icon {
    width: 60px;
    height: 60px;
    background: #e8f8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: #27ae60;
    font-size: 1.5rem;
}

.carro-popup__title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.carro-popup__text {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.carro-popup__product {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.carro-popup__img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #eee;
}

.carro-popup__info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #555;
    min-width: 0;
}

.carro-popup__info strong {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carro-popup__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.carro-popup__btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: all 0.25s;
    font-family: var(--font-sans);
}

.carro-popup__btn--secondary {
    background: #f0f0f0;
    color: #333;
}

.carro-popup__btn--secondary:hover {
    background: #e0e0e0;
}

.carro-popup__btn--primary {
    background: var(--fucsia, #E91E8C);
    color: #fff;
}

.carro-popup__btn--primary:hover {
    background: var(--fucsia-hover, #D4177F);
    box-shadow: 0 4px 15px rgba(233, 30, 140, 0.3);
    transform: translateY(-1px);
}

/* ── Modo variantes ── */
.carro-popup__var-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.carro-popup__var-nombre {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.carro-popup__var-selector {
    margin: 1rem 0;
}

/* Grupos de variante generados por JS */
.carro-var-grupo {
    margin-bottom: 1rem;
}

.carro-var-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
    margin-bottom: 0.5rem;
}

.carro-var-opciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.carro-var-opciones.has-error .carro-var-btn:not(.activo) {
    border-color: #e74c3c;
}

.carro-var-btn {
    padding: 0.4rem 0.9rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.carro-var-btn:hover {
    border-color: var(--fucsia, #E91E8C);
    color: var(--fucsia, #E91E8C);
}

.carro-var-btn.activo {
    border-color: var(--fucsia, #E91E8C);
    background: var(--fucsia, #E91E8C);
    color: #fff;
}

.carro-var-error {
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 0.5rem;
    display: none;
}

/* ========================================
   Pestañas de contacto
======================================== */
.contact-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 0;
    background: #f9f9f9;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.contact-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.25s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.contact-tab:hover {
    color: var(--fucsia, #E91E8C);
    background: rgba(233, 30, 140, 0.04);
}

.contact-tab--active {
    color: var(--fucsia, #E91E8C);
    border-bottom-color: var(--fucsia, #E91E8C);
    background: #fff;
}

.contact-tab svg {
    flex-shrink: 0;
}

/* Paneles de pestañas */
.contact-tab-panel {
    display: none;
}

.contact-tab-panel--active {
    display: block;
}

/* ========================================
   Alertas de formulario
======================================== */
.form-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-alert--error {
    background: #fff0f0;
    color: #c0392b;
    border: 1px solid #f5c6c6;
}

.form-alert--success {
    background: #f0fff4;
    color: #27ae60;
    border: 1px solid #b2e8c8;
}

/* ========================================
   Select estilizado (mayorista form)
======================================== */
.form-select {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--rosa, #E91E8C);
    box-shadow: 0 0 0 3px rgba(212, 165, 165, 0.2);
}

/* ========================================
   Insignias de producto – variantes extra
======================================== */
.product-card__badge--sin-stock {
    background: #999;
    color: #fff;
}

.product-card__badge--disponible {
    background: #27ae60;
    color: #fff;
}
