/**
 * Estilos del Widget de Variaciones de Producto
 *
 * Estilo: Clean, e-commerce moderno (Shopify/DTC)
 * Mobile-first
 *
 * @package Floreria_Rosify
 */

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

.floreria-product-variations-widget {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* ========================================
   GRUPO DE VARIACIÓN
   ======================================== */

.floreria-variation-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   ETIQUETA DE VARIACIÓN
   ======================================== */

.floreria-variation-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.floreria-variation-label-name {
    color: #6B7280;
}

.floreria-variation-label-value {
    font-weight: 600;
    color: #111827;
}

/* ========================================
   OPCIONES DE VARIACIÓN (PILLS)
   ======================================== */

.floreria-variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ========================================
   PILL / BOTÓN DE VARIACIÓN
   ======================================== */

.floreria-variation-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #6B7280;
    background-color: #FFFFFF;
    border: 2px solid #D1D5DB;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.floreria-variation-pill:hover {
    border-color: #F9A8D4;
    color: #BE185D;
}

.floreria-variation-pill:focus {
    outline: none;
}

/* Estado seleccionado */
.floreria-variation-pill.is-selected {
    color: #BE185D;
    border-color: #BE185D;
    background-color: #FFFFFF;
    font-weight: 600;
}

/* Estado deshabilitado */
.floreria-variation-pill.is-disabled,
.floreria-variation-pill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    text-decoration: line-through;
}

.floreria-variation-pill.is-disabled:hover {
    border-color: #D1D5DB;
    color: #6B7280;
}

/* ========================================
   DROPDOWN DE VARIACIÓN
   ======================================== */

.floreria-variation-dropdown-wrapper {
    width: 100%;
}

.floreria-variation-dropdown {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    background-color: #FFFFFF;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%236B7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.floreria-variation-dropdown:hover {
    border-color: #9CA3AF;
    background-color: #F9FAFB;
}

.floreria-variation-dropdown:focus {
    outline: none;
    border-color: #BE185D;
}

.floreria-variation-dropdown option {
    padding: 8px;
}

/* ========================================
   SELECTOR DE FECHA
   ======================================== */

.floreria-date-selector {
    width: 100%;
}

.floreria-date-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    background-color: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.floreria-date-button:hover {
    border-color: #9CA3AF;
    background-color: #F9FAFB;
}

.floreria-date-button:focus {
    outline: none;
}

.floreria-date-button svg {
    flex-shrink: 0;
    color: #6B7280;
}

.floreria-date-button.has-selection {
    border-color: #D1D5DB;
}

.floreria-date-button.has-selection .floreria-date-text {
    color: #111827;
    font-weight: 500;
}

.floreria-date-text {
    flex: 1;
}

/* ========================================
   MENSAJE DE ENTREGA (DELIVERY INFO)
   ======================================== */

.floreria-delivery-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #6B7280;
    background-color: #F9FAFB;
    border-radius: 8px;
}

.floreria-delivery-info svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #9CA3AF;
}

.floreria-delivery-info-text {
    flex: 1;
}

.floreria-delivery-info strong {
    font-weight: 600;
    color: #374151;
}

/* ========================================
   BOTÓN AGREGAR AL CARRITO
   ======================================== */

.floreria-add-to-cart-wrapper {
    width: 100%;
}

.floreria-add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    background-color: #BE185D;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.floreria-add-to-cart-btn:hover {
    background-color: #9D174D;
}

/* Sin animación en active */

.floreria-add-to-cart-btn:focus {
    outline: none;
}

.floreria-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.floreria-btn-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.floreria-btn-price {
    font-weight: 700;
}

/* Estado de carga */
.floreria-add-to-cart-btn.is-loading .floreria-btn-text {
    visibility: hidden;
}

.floreria-add-to-cart-btn.is-loading .floreria-btn-loading {
    display: flex !important;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.floreria-spinner {
    animation: floreria-spin 0.8s linear infinite;
}

@keyframes floreria-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Estado de éxito */
.floreria-add-to-cart-btn.is-success {
    background-color: #059669;
}

/* ========================================
   PLACEHOLDER EN EDITOR
   ======================================== */

.floreria-widget-placeholder {
    padding: 40px 20px;
    background: linear-gradient(135deg, #FDF2F8 0%, #FCE7F3 100%);
    border: 2px dashed #F9A8D4;
    border-radius: 12px;
    text-align: center;
    color: #9D174D;
}

.floreria-widget-placeholder p {
    margin: 0;
    padding: 4px 0;
    font-size: 14px;
}

/* ========================================
   RESPONSIVE - MOBILE FIRST
   ======================================== */

/* Móvil pequeño (< 360px) */
@media (max-width: 359px) {
    .floreria-variation-pill {
        padding: 8px 14px;
        font-size: 13px;
    }

    .floreria-date-button {
        padding: 12px 14px;
        font-size: 14px;
    }

    .floreria-add-to-cart-btn {
        padding: 14px 18px;
        font-size: 15px;
    }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .floreria-variation-label {
        font-size: 15px;
    }

    .floreria-variation-pill {
        padding: 12px 24px;
        font-size: 15px;
    }

    .floreria-date-button {
        padding: 16px 20px;
        font-size: 16px;
    }

    .floreria-add-to-cart-btn {
        padding: 18px 28px;
        font-size: 17px;
    }
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */

/* Respetar preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .floreria-variation-pill,
    .floreria-date-button,
    .floreria-add-to-cart-btn {
        transition: none;
    }

    .floreria-spinner {
        animation: none;
    }

}

/* Screen reader only */
.floreria-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   EDITOR DE ELEMENTOR
   ======================================== */

.elementor-editor-active .floreria-product-variations-widget {
    min-height: 200px;
}
