/**
 * Améliorations UX/UI pour les pages produits - Thème Classic
 * Optimisé pour maximiser le taux de conversion et d'action
 */

/* ========================================
   PREUVE SOCIALE & URGENCE
======================================== */

/* Indicateur de vues en temps réel */
.product-social-proof {
    margin: 15px 0;
    animation: slideInFromTop 0.6s ease-out;
}

.social-proof-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid #ff9800;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #e65100;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15);
}

.social-proof-item.live-viewers {
    animation: pulse-glow 3s ease-in-out infinite;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: #ff5722;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7);
}

.social-proof-item .material-icons {
    font-size: 18px;
    color: #ff9800;
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 87, 34, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0);
    }
}

@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 16px rgba(255, 152, 0, 0.3);
    }
}

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

/* ========================================
   PRIX ET RÉDUCTIONS OPTIMISÉS
======================================== */

/* Badge "Offre spéciale" */
.saving-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    font-weight: 700;
    font-size: 13px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
    animation: bounce-in 0.6s ease-out;
    margin-bottom: 10px;
}

.saving-badge .material-icons {
    font-size: 16px;
}

@keyframes bounce-in {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.discount-banner {
    margin-bottom: 10px;
}

.conversion-price-block {
    position: relative;
}

.conversion-price-block::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(
        135deg,
        rgba(211, 47, 47, 0.1),
        rgba(255, 152, 0, 0.1)
    );
    border-radius: 10px;
    z-index: -1;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%,
    100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ========================================
   BOUTON CTA OPTIMISÉ
======================================== */

.conversion-optimized-cta {
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.conversion-optimized-cta::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition:
        width 0.6s,
        height 0.6s;
}

.conversion-optimized-cta:hover::before {
    width: 300px;
    height: 300px;
}

.conversion-optimized-cta .cta-icon-arrow {
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.conversion-optimized-cta:hover .cta-icon-arrow {
    transform: translateX(5px);
    animation: arrow-bounce 0.6s ease infinite;
}

@keyframes arrow-bounce {
    0%,
    100% {
        transform: translateX(5px);
    }
    50% {
        transform: translateX(10px);
    }
}

.conversion-optimized-cta:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.4) !important;
}

/* ========================================
   RÉASSURANCE INLINE
======================================== */

.product-reassurance-inline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 20px;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    clear: both;
}

.reassurance-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: left;
    gap: 10px;
    padding: 12px 10px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
}

.reassurance-item:last-child {
    border-right: none;
}

.reassurance-item:hover {
    background: #ffffff;
}

.reassurance-item .material-icons {
    font-size: 24px;
    color: #4caf50;
    flex-shrink: 0;
}

.reassurance-item span {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@keyframes icon-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================
   DISPONIBILITÉ AMÉLIORÉE
======================================== */

.product-availability-enhanced {
    margin-top: 15px;
}

.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(220,220,220,0.05);
    animation: fadeInUp 0.5s ease-out;
}

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

.availability-badge.available {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.availability-badge.available .material-icons {
    color: #4caf50;
    font-size: 24px;
}

.availability-badge.last-items {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
    border: 2px solid #ff9800;
    position: relative;
    animation: urgency-pulse 2s ease-in-out infinite;
}

@keyframes urgency-pulse {
    0%,
    100% {
        box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 152, 0, 0.5);
    }
}

.availability-badge.last-items .material-icons {
    color: #ff9800;
    font-size: 24px;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-3px);
    }
    75% {
        transform: translateX(3px);
    }
}

.urgency-pulse {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: #ff5722;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.availability-badge.unavailable {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 2px solid #f44336;
}

.availability-badge.unavailable .material-icons {
    color: #f44336;
    font-size: 24px;
}

/* Layout général amélioré */
.product-improved-layout {
    align-items: flex-start;
}

.product-images-column {
    position: relative;
    top: auto;
    align-self: flex-start;
}

.product-info-column {
    padding-left: 40px;
}

/* Titre du produit */
.product-title-improved {
    font-size: 32px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

/* Métadonnées produit */
.product-meta-wrapper {
    display: flex;
    gap: 25px;
    margin: 18px 0;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 14px;
}

.product-meta-wrapper .product-reference,
.product-meta-wrapper .product-condition {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-meta-wrapper label {
    font-weight: 600;
    color: #555;
    margin: 0;
}

.product-meta-wrapper span {
    color: #888;
}

/* Prix du produit */
.product-prices {
    margin-bottom: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(240,240,240,0.03);
}

.product-prices .product-price {
    font-size: 36px;
    font-weight: 700;
    color: #d32f2f;
    margin-bottom: 8px;
}

.product-prices .has-discount .product-price {
    color: #d32f2f;
}

.product-prices .regular-price {
    font-size: 22px;
    text-decoration: line-through;
    color: #999;
    margin-right: 12px;
}

.product-prices .discount-percentage {
    display: inline-block;
    background: #d32f2f;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    margin-left: 10px;
}

.product-prices .tax-shipping-delivery-label {
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

/* Description courte */
#product-description-short-\\.* {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 25px;
}

.product-description {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
}

/* Actions produit (variantes, quantité, boutons) */
.product-actions {
    margin-top: 30px;
}

/* Zone Quantité + Bouton - Redesign */
.product-add-to-cart {
    margin-top: 30px;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(230,230,230,0.04);
    border: 1px solid #e9ecef;
}

.product-add-to-cart .control-label {
    font-weight: 700;
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-add-to-cart .product-quantity {
    display: flex;
    align-items: stretch;
    gap: 15px;
    margin-bottom: 0 !important;
}

.product-add-to-cart .qty {
    flex: 0 0 110px;
    margin: 0 !important;
}

.product-add-to-cart input[type="number"],
.product-add-to-cart #quantity_wanted {
    width: 100%;
    height: 58px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    background: #fafafa;
}

.product-add-to-cart input[type="number"]:focus,
.product-add-to-cart #quantity_wanted:focus {
    border-color: #d32f2f;
    background: white;
    outline: none;
}

.product-add-to-cart .add {
    flex: 1;
    display: flex;
}

.product-add-to-cart .btn-primary {
    width: 100%;
    height: 58px;
    padding: 0 30px;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    border: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 16px rgba(211, 47, 47, 0.35);
    position: relative;
    overflow: hidden;
}

.product-add-to-cart .btn-primary:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(211, 47, 47, 0.45);
}

.product-add-to-cart .btn-primary:active {
    transform: translateY(-1px);
}

/* ========================================
   VARIANTES PRODUIT - REDESIGN COMPLET
======================================== */

.product-variants-redesigned {
    margin-bottom: 30px;
    padding: 25px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.product-variants .clearfix {
    margin-bottom: 20px;
}

.product-variants .product-variants-item {
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(240,240,240,0.03);
}

.product-variants .product-variants-item:last-child {
    margin-bottom: 0;
}

.product-variants .variant-label {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 16px;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-variants .variant-selected-value {
    margin-bottom: 15px;
}

.product-variants .current-selection {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}

.product-variants label,
.product-variants .control-label {
    font-weight: 600;
    color: #888;
    font-size: 15px;
    margin-bottom: 12px;
    display: block;
}

.product-variants select {
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 100%;
    max-width: 100%;
    transition: border-color 0.3s ease;
    background: white;
}

.product-variants select:focus {
    border-color: #d32f2f;
    outline: none;
}

/* Style pour les variantes type radio (couleurs) */
.product-variants ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-variants ul li {
    margin: 0 !important;
}

.product-variants ul li input[type="radio"],
.product-variants ul li .input-radio,
.product-variants ul li .input-color {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.product-variants ul li label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 14px;
    background: white;
    margin: 0;
    min-height: 48px;
    text-align: center;
    position: relative;
}

.product-variants ul li label:hover {
    border-color: #d32f2f;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2);
}

.product-variants ul li input[type="radio"]:checked + label,
.product-variants ul li .input-radio:checked + label,
.product-variants ul li .input-color:checked + label,
.product-variants ul li label.selected {
    border-color: #d32f2f;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    color: #d32f2f;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.25);
    transform: translateY(-2px);
}

.product-variants ul li input[type="radio"]:checked + label::after,
.product-variants ul li .input-radio:checked + label::after,
.product-variants ul li .input-color:checked + label::after {
    content: "✓";
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #d32f2f;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.4);
}

/* Images produit */
.product-cover img {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220,220,220,0.05);
    transition: transform 0.3s ease;
}

.product-cover:hover img {
    transform: scale(1.02);
}

.images-container {
    margin-bottom: 20px;
}

/* Miniatures images */
.product-images {
    margin-top: 15px;
}

.product-images .thumb-container {
    margin: 0 8px 8px 0;
}

.product-images .thumb-container img {
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-images .thumb-container img:hover,
.product-images .thumb-container.selected img {
    border-color: #d32f2f;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.2);
}

/* Onglets de description - maintenant dans la colonne de droite */
.tabs {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f5f5f5;
}

.tabs .nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0;
}

.tabs .nav-tabs .nav-link {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tabs .nav-tabs .nav-link:hover {
    color: #d32f2f;
    border-bottom-color: rgba(211, 47, 47, 0.3);
}

.tabs .nav-tabs .nav-link.active {
    color: #d32f2f;
    border-bottom-color: #d32f2f;
    background: transparent;
}

.tabs .tab-content {
    padding: 30px 0 20px 0;
}

.tabs .tab-pane {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}

.tabs .tab-pane.active {
    animation: fadeIn 0.4s ease-in;
}

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

/* Badges et flags */
.product-flags {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
}

.product-flags .product-flag {
    display: inline-block;
    padding: 6px 14px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(200,200,200,0.08);
}

.product-flags .discount {
    background: #d32f2f;
    color: white;
}

.product-flags .new {
    background: #4caf50;
    color: white;
}

.product-flags .on-sale {
    background: #ff9800;
    color: white;
}

/* Produits accessoires */
.product-accessories {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e9ecef;
}

.product-accessories .h5 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #1a1a1a;
}

/* Disponibilité produit */
.product-availability {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.product-availability .product-available {
    color: #4caf50;
    background: #e8f5e9;
}

.product-availability .product-unavailable {
    color: #f44336;
    background: #ffebee;
}

/* Responsive - Tablette */
@media (max-width: 991px) {
    .product-images-column {
        position: relative;
        top: auto;
        margin-bottom: 30px;
    }

    .product-info-column {
        padding-left: 15px;
    }

    .product-title-improved {
        font-size: 26px;
    }

    .product-prices .product-price {
        font-size: 30px;
    }

    .product-add-to-cart .add {
        flex-direction: column;
        align-items: stretch;
    }

    .product-add-to-cart .btn-primary {
        max-width: 100%;
    }
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    .product-info-column {
        padding-left: 0;
    }

    .product-title-improved {
        font-size: 22px;
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    .product-prices {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .product-prices .product-price {
        font-size: 26px;
    }

    .product-meta-wrapper {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
    }

    .product-actions {
        margin-top: 20px;
    }

    .product-add-to-cart .btn-primary {
        font-size: 16px;
        padding: 14px 30px;
    }

    .tabs {
        margin-top: 40px;
    }

    .tabs .nav-tabs .nav-link {
        padding: 12px 15px;
        font-size: 14px;
    }

    .tabs .tab-content {
        padding: 25px 0;
    }

    .product-accessories {
        margin-top: 40px;
        padding-top: 30px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .product-title-improved {
        font-size: 20px;
    }

    .product-prices .product-price {
        font-size: 24px;
    }

    .product-add-to-cart input[type="number"] {
        width: 80px;
    }
}

/* Responsive adjustments for conversion elements */
@media (max-width: 991px) {
    .product-reassurance-inline {
        grid-template-columns: 1fr;
    }

    .reassurance-item {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 767px) {
    .social-proof-item {
        font-size: 12px;
        padding: 8px 12px;
    }

    .product-reassurance-inline {
        padding: 12px;
        gap: 8px;
    }

    .reassurance-item span {
        font-size: 11px;
    }

    .availability-badge {
        font-size: 13px;
        padding: 10px 15px;
    }

    .saving-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
}
