/**
 * Rose&Fly Pack Builder - Styles Front-End
 * Élégance et sophistication selon la charte Rose&Fly
 */

/* Import de la police Playfair Display si nécessaire */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&display=swap');

/* ==========================================================================
   Bloc Pack Principal
   ========================================================================== */

.rf-pack-wrapper {
    background: linear-gradient(135deg, #fff5f7 0%, #fef8f9 100%);
    padding: 25px;
    border-radius: 12px;
    margin: 25px 0 30px 0;
    transition: all 0.3s ease;
}

.rf-pack-wrapper:hover {
    background: linear-gradient(135deg, #fff0f3 0%, #fef5f7 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 71, 109, 0.1);
}

/* ==========================================================================
   Titre "La suggestion de Rosy"
   ========================================================================== */

.rf-pack-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: #8b3555;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   Composition du Pack (inline)
   ========================================================================== */

.rf-pack-composition {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rf-pack-products {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

/* ==========================================================================
   Items Produits
   ========================================================================== */

.rf-pack-product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.rf-pack-product-img {
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.rf-pack-product-item:hover .rf-pack-product-img {
    transform: scale(1.05);
}

.rf-pack-product-name {
    font-size: 11px;
    color: #666;
    text-align: center;
    line-height: 1.3;
}

/* Tailles adaptatives selon le nombre de produits */
.rf-pack-products[data-count="2"] .rf-pack-product-img {
    width: 70px;
    height: 70px;
}

.rf-pack-products[data-count="2"] .rf-pack-product-name {
    max-width: 70px;
}

.rf-pack-products[data-count="3"] .rf-pack-product-img {
    width: 60px;
    height: 60px;
}

.rf-pack-products[data-count="3"] .rf-pack-product-name {
    max-width: 60px;
}

.rf-pack-products[data-count="4"] .rf-pack-product-img {
    width: 50px;
    height: 50px;
}

.rf-pack-products[data-count="4"] .rf-pack-product-name {
    max-width: 50px;
    font-size: 10px;
}

/* ==========================================================================
   Symbole Plus
   ========================================================================== */

.rf-pack-plus {
    font-size: 20px;
    color: #b8476d;
    font-weight: 300;
    margin: 0 3px;
}

/* ==========================================================================
   Pricing
   ========================================================================== */

.rf-pack-pricing {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.rf-pack-equal {
    font-size: 18px;
    color: #b8476d;
    font-weight: 300;
}

.rf-pack-price-old {
    font-size: 15px;
    color: #999;
    text-decoration: line-through;
    font-weight: 300;
}

.rf-pack-price-arrow {
    font-size: 18px;
    color: #b8476d;
}

.rf-pack-price-new {
    font-size: 20px;
    color: #8b3555;
    font-weight: 600;
    font-family: 'Playfair Display', Georgia, serif;
}

.rf-pack-discount {
    background: #8b3555;
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

/* ==========================================================================
   Bouton Ajouter le Pack
   ========================================================================== */

.rf-pack-add-btn {
    background: linear-gradient(135deg, #8b3555 0%, #6b2a42 100%);
    color: white;
    border: none;
    padding: 14px 35px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: none;
}

.rf-pack-add-btn:hover {
    background: linear-gradient(135deg, #6b2a42 0%, #5a2336 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 53, 85, 0.3);
}

.rf-pack-add-btn:active {
    transform: translateY(0);
}

.rf-pack-add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.rf-pack-add-btn.loading {
    opacity: 0.8;
    cursor: wait;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.rf-pack-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.rf-pack-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rf-pack-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Message de Rupture de Stock
   ========================================================================== */

.rf-pack-out-of-stock {
    background: #fff3f3;
    color: #d63031;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

/* ==========================================================================
   Responsive Mobile
   ========================================================================== */

@media (max-width: 768px) {
    .rf-pack-wrapper {
        padding: 20px 15px;
    }
    
    .rf-pack-title {
        font-size: 18px;
    }
    
    .rf-pack-composition {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rf-pack-products {
        justify-content: center;
    }
    
    .rf-pack-pricing {
        justify-content: center;
        margin-left: 0;
        margin-top: 10px;
        flex-wrap: wrap;
    }
    
    .rf-pack-price-old {
        font-size: 14px;
    }
    
    .rf-pack-price-new {
        font-size: 18px;
    }
    
    .rf-pack-add-btn {
        font-size: 12px;
        padding: 12px 30px;
    }
}

@media (max-width: 480px) {
    .rf-pack-wrapper {
        padding: 15px 10px;
        margin: 20px 0;
    }
    
    .rf-pack-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .rf-pack-products {
        gap: 8px;
    }
    
    .rf-pack-plus {
        font-size: 16px;
        margin: 0 2px;
    }
    
    /* Forcer des tailles plus petites sur mobile */
    .rf-pack-products[data-count="2"] .rf-pack-product-img {
        width: 60px;
        height: 60px;
    }
    
    .rf-pack-products[data-count="3"] .rf-pack-product-img,
    .rf-pack-products[data-count="4"] .rf-pack-product-img {
        width: 50px;
        height: 50px;
    }
    
    .rf-pack-product-name {
        font-size: 10px;
    }
    
    .rf-pack-pricing {
        gap: 6px;
    }
    
    .rf-pack-equal {
        font-size: 16px;
    }
    
    .rf-pack-price-old {
        font-size: 13px;
    }
    
    .rf-pack-price-arrow {
        font-size: 16px;
    }
    
    .rf-pack-price-new {
        font-size: 16px;
    }
    
    .rf-pack-discount {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* ==========================================================================
   Animations de chargement
   ========================================================================== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.rf-pack-add-btn.loading::after {
    content: "...";
    animation: pulse 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Compatibilité avec les thèmes
   ========================================================================== */

/* Reset de styles potentiellement conflictuels */
.rf-pack-wrapper * {
    box-sizing: border-box;
}

.rf-pack-wrapper button {
    font-family: inherit;
}

/* S'assurer que le bloc ne soit pas écrasé par d'autres styles */
.woocommerce div.product .rf-pack-wrapper {
    clear: both;
}
