/* Variables CSS personnalisées */
    :root {
        --primary-color: #F76211;
        --secondary-color: #395FA7;
        --accent-color: #00970B;
        --card-shadow: 0 8px 24px rgba(247, 98, 17, 0.08);
        --hover-shadow: 0 12px 32px rgba(247, 98, 17, 0.15);
        --border-radius: 12px;
        --transition: all 0.3s ease;
    }


    /* debut------------------------------------------------- */
    /* Styles pour les boutons Lire et Noter */
    .btn-read {
        background: linear-gradient(135deg, var(--secondary-color) 0%, #5a7ab9 100%);
        border: none;
        color: white;
    }

        .btn-read:hover {
            background: linear-gradient(135deg, #2d4a7a 0%, #395FA7 100%);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(57, 95, 167, 0.3);
        }

        .btn-rate {
            background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
            border: none;
            color: #856404;
        }

        .btn-rate:hover {
            background: linear-gradient(135deg, #ffb300 0%, #ffa000 100%);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
            color: #856404;
        }

    /* fin------------------------------------------------- */

    /* Styles pour les cartes produits */
    .product-card-wrapper {
        position: relative;
        height: 100%;
        margin-bottom: 1.5rem;
    }

    .product-card {
        background: white;
        border-radius: var(--border-radius);
        overflow: hidden;
        transition: var(--transition);
        border: 1px solid rgba(247, 98, 17, 0.1);
        height: 100%;
        box-shadow: var(--card-shadow);
    }

    .product-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--hover-shadow);
        border-color: var(--primary-color);
    }

    /* Images en portrait */
    .product-image-wrapper {
        overflow: hidden;
        position: relative;
        background: #f8f9fa;
        height: 320px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }

    .portrait-image {
        width: auto;
        height: 100%;
        max-width: 100%;
        object-fit: contain;
        transition: var(--transition);
        background: white;
    }

    .product-card:hover .portrait-image {
        transform: scale(1.03);
    }

    /* Badges sur l'image */
    .product-badges {
        position: absolute;
        bottom: 15px;
        left: 15px;
        display: flex;
        flex-direction: column;
        gap: 5px;
        z-index: 2;
    }

    .format-badge,
    .subject-badge {
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        display: inline-block;
        width: fit-content;
    }

    .format-badge {
        background: var(--secondary-color);
    }

    .subject-badge {
        background: var(--accent-color);
    }

    /* Badge type de produit - informatif seulement */
    .type-badge {
        position: absolute;
        top: 15px;
        left: 15px;
        background: rgba(57, 95, 167, 0.9);
        color: white;
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        z-index: 2;
        backdrop-filter: blur(4px);
    }

        /* ---- Badge "Acheté" ---- */
    .badge-purchased {
        position: absolute;
        top: 0;
        right: 0;
        margin: 0.5rem;
        z-index: 3;
    }
    .badge-purchased .badge {
        background: linear-gradient(135deg, var(--accent-color), #00b50c) !important;
        color: white;
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    /* Overlay pour voir les détails au survol */
    .product-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(247, 98, 17, 0.9);
        opacity: 0;
        transition: var(--transition);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 3;
        padding: 20px;
        text-align: center;
    }

    .product-card:hover .product-overlay {
        opacity: 1;
    }

    .product-title-overlay {
        font-size: 0.9rem;
        line-height: 1.3;
        color: white;
        margin-bottom: 10px;
        font-weight: 600;
    }

    .product-price-overlay {
        font-size: 1rem;
        color: white;
        margin-bottom: 15px;
        font-weight: 600;
    }

    /* Textes des produits */
    .product-title {
        color: #333;
        line-height: 1.4;
        height: 42px;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 0.95rem;
        margin-bottom: 8px;
        font-weight: 600;
    }

    /* Informations de prix */
    .price-info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0;
        margin-bottom: 15px;
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
    }

    .current-price {
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--primary-color);
    }

    .original-price {
        font-size: 0.9rem;
        color: #6c757d;
        text-decoration: line-through;
    }

    /* Boutons d'action */
    .btn-action-icon {
        border-radius: 8px;
        font-weight: 600;
        transition: var(--transition);
        padding: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
        width: 100%;
        min-height: 44px;
    }

    .order-icon-btn {
        background: white;
        border: 1px solid var(--primary-color);
        color: var(--primary-color);
    }

    .order-icon-btn:hover {
        background: var(--primary-color);
        color: white;
        transform: translateY(-2px);
    }

    .purchase-icon-btn {
        background: white;
        border: 1px solid var(--accent-color);
        color: var(--accent-color);
    }

    .purchase-icon-btn:hover {
        background: var(--accent-color);
        color: white;
        transform: translateY(-2px);
    }

    .tooltip-text {
        position: absolute;
        bottom: -30px;
        left: 50%;
        transform: translateX(-50%);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.75rem;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 10;
        pointer-events: none;
    }

    .order-icon-btn .tooltip-text {
        background: var(--primary-color);
    }

    .purchase-icon-btn .tooltip-text {
        background: var(--accent-color);
    }

    .tooltip-text::before {
        content: '';
        position: absolute;
        top: -4px;
        left: 50%;
        transform: translateX(-50%);
        border-width: 0 4px 4px 4px;
        border-style: solid;
    }

    .order-icon-btn .tooltip-text::before {
        border-color: transparent transparent var(--primary-color) transparent;
    }

    .purchase-icon-btn .tooltip-text::before {
        border-color: transparent transparent var(--accent-color) transparent;
    }

    .order-icon-btn:hover .tooltip-text,
    .purchase-icon-btn:hover .tooltip-text {
        opacity: 1;
        visibility: visible;
        bottom: -35px;
    }

    /* Étoiles de notation */
    .rating {
        margin-bottom: 10px;
    }

    .stars i {
        font-size: 0.8rem;
        margin-right: 1px;
    }

    /* Styles Bootstrap personnalisés */
    .btn-gradient-primary {
        background: linear-gradient(135deg, var(--primary-color) 0%, #FF8C5A 100%);
        border: none;
        color: white;
        font-weight: 600;
    }

    .btn-gradient-primary:hover {
        background: linear-gradient(135deg, #e5560e 0%, #e57a42 100%);
        color: white;
    }

    .btn-gradient-accent {
        background: linear-gradient(135deg, var(--accent-color) 0%, #00cc0b 100%);
        border: none;
        color: white;
        font-weight: 600;
    }

    .btn-gradient-accent:hover {
        background: linear-gradient(135deg, #008a09 0%, #00aa0a 100%);
        color: white;
    }

    .hero-section {
        background: linear-gradient(135deg, var(--primary-color) 0%, #FF8C5A 100%) !important;
    }

    .animate-fade-in-up {
        animation: fadeInUp 0.8s ease-out;
    }

    .animate-float {
        animation: float 3s ease-in-out infinite;
    }

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

    @keyframes float {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-20px);
        }
    }

    /* Pagination personnalisée */
    .pagination .page-link {
        color: var(--primary-color);
        border-color: rgba(247, 98, 17, 0.2);
    }

    .pagination .page-item.active .page-link {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
    }

    /* Styles uniformisés pour les modals */
    .modal {
        z-index: 1065 !important;
    }

    .modal-backdrop {
        z-index: 1055 !important;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
        display: flex;
        align-items: center;
    }

    .custom-modal .modal-content {
        border: none;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
        overflow: hidden;
        background: white;
    }

    .custom-modal .modal-header {
        background: linear-gradient(135deg, var(--primary-color) 0%, #FF8C5A 100%);
        color: white;
        border-bottom: none;
        padding: 1.5rem 2rem;
    }

    .purchase-modal .modal-header {
        background: linear-gradient(135deg, var(--accent-color) 0%, #00cc0b 100%);
    }

    .order-modal .modal-header {
        background: linear-gradient(135deg, var(--primary-color) 0%, #FF8C5A 100%);
    }

    .custom-modal .modal-header .modal-title {
        font-weight: 700;
        font-size: 1.25rem;
    }

    .custom-modal .modal-header .btn-close {
        filter: invert(1) brightness(100);
        opacity: 0.8;
        transition: opacity 0.3s ease;
    }

    .custom-modal .modal-header .btn-close:hover {
        opacity: 1;
    }

    .custom-modal .modal-body {
        padding: 2rem;
    }

    .custom-modal .modal-footer {
        border-top: 1px solid #e9ecef;
        padding: 1.5rem 2rem;
        background: #f8f9fa;
    }

    /* Style spécifique pour le modal de mot de passe commande */
    #createPasswordOrderModal .modal-content {
        border: 3px solid var(--primary-color);
    }

    #createPasswordOrderModal .modal-header {
        background: linear-gradient(135deg, var(--primary-color) 0%, #FF8C5A 100%);
    }

    /* Style spécifique pour le modal de mot de passe achat */
    #createPasswordPurchaseModal .modal-content {
        border: 3px solid var(--accent-color);
    }

    #createPasswordPurchaseModal .modal-header {
        background: linear-gradient(135deg, var(--accent-color) 0%, #00cc0b 100%);
    }

    .password-icon {
        color: var(--secondary-color);
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .password-icon-order {
        color: var(--primary-color);
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .password-icon-purchase {
        color: var(--accent-color);
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    /* Formulaires dans modals */
    .modal-form .form-label {
        font-weight: 600;
        color: #333;
        margin-bottom: 0.5rem;
    }

    .modal-form .form-control {
        border: 2px solid #e9ecef;
        border-radius: 8px;
        padding: 0.75rem 1rem;
        transition: all 0.3s ease;
    }

    .modal-form .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.25rem rgba(247, 98, 17, 0.25);
    }

    .purchase-modal .modal-form .form-control:focus {
        border-color: var(--accent-color);
        box-shadow: 0 0 0 0.25rem rgba(0, 151, 11, 0.25);
    }

    .modal-form .input-group {
        border-radius: 8px;
        overflow: hidden;
    }

    .modal-form .input-group .form-control {
        border-right: none;
    }

    .modal-form .input-group .btn-outline-secondary {
        border: 2px solid #e9ecef;
        border-left: none;
        background: white;
        color: #6c757d;
        transition: all 0.3s ease;
    }

    .modal-form .input-group .btn-outline-secondary:hover {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
    }

    .purchase-modal .modal-form .input-group .btn-outline-secondary:hover {
        background: var(--accent-color);
        border-color: var(--accent-color);
    }

    .modal-form .invalid-feedback {
        font-size: 0.85rem;
        margin-top: 0.25rem;
    }

    .modal-form .form-text {
        font-size: 0.85rem;
        color: #6c757d;
    }

    /* Boutons dans modals */
    .modal-btn-primary {
        background: linear-gradient(135deg, var(--primary-color) 0%, #FF8C5A 100%);
        border: none;
        color: white;
        font-weight: 600;
        padding: 0.75rem 2rem;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .modal-btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(247, 98, 17, 0.3);
    }

    .modal-btn-accent {
        background: linear-gradient(135deg, var(--accent-color) 0%, #00cc0b 100%);
        border: none;
        color: white;
        font-weight: 600;
        padding: 0.75rem 2rem;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .modal-btn-accent:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 151, 11, 0.3);
    }

    .modal-btn-secondary {
        background: white;
        border: 2px solid var(--primary-color);
        color: var(--primary-color);
        font-weight: 600;
        padding: 0.75rem 2rem;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .modal-btn-secondary:hover {
        background: var(--primary-color);
        color: white;
        transform: translateY(-2px);
    }

    /* Alertes dans modals */
    .modal-alert {
        border-radius: 8px;
        border: none;
        padding: 1rem 1.25rem;
        margin-bottom: 1.5rem;
    }

    /* Responsive */
    @media (max-width: 1400px) {
        .product-image-wrapper {
            height: 280px;
        }
    }

    @media (max-width: 1200px) {
        .product-image-wrapper {
            height: 240px;
        }

        .product-content {
            padding: 1rem;
        }
    }

    @media (max-width: 992px) {
        .product-image-wrapper {
            height: 220px;
        }

        .product-title {
            font-size: 0.9rem;
            height: 38px;
        }

        .custom-modal .modal-body,
        .custom-modal .modal-footer {
            padding: 1.5rem;
        }
    }

    @media (max-width: 768px) {
        .product-image-wrapper {
            height: 200px;
        }

        .current-price {
            font-size: 1.1rem;
        }

        .product-overlay {
            padding: 15px;
        }

        .product-title-overlay {
            font-size: 0.8rem;
        }

        .custom-modal .modal-dialog {
            margin: 0.5rem;
        }

        .custom-modal .modal-body {
            padding: 1.25rem;
        }

        .modal-btn-primary,
        .modal-btn-accent,
        .modal-btn-secondary {
            padding: 0.625rem 1.5rem;
            width: 100%;
        }
    }

    @media (max-width: 576px) {
        .product-image-wrapper {
            height: 180px;
        }

        .price-info {
            flex-direction: column;
            gap: 5px;
            align-items: flex-start;
        }

        .btn-action-icon {
            padding: 10px;
            min-height: 40px;
        }

        .custom-modal .modal-header {
            padding: 1.25rem;
        }

        .modal-form .row {
            margin: 0 -0.5rem;
        }

        .modal-form .col-md-6,
        .modal-form .col-12 {
            padding: 0 0.5rem;
        }
    }

    @media (max-width: 400px) {
        .product-image-wrapper {
            height: 160px;
        }

        .product-badges {
            bottom: 10px;
            left: 10px;
        }

        .format-badge,
        .subject-badge {
            font-size: 0.6rem;
            padding: 3px 6px;
        }

        .btn-action-icon {
            padding: 8px;
            min-height: 36px;
        }
    }

    /* Styles pour les champs invalides */
    .modal-form .form-control.is-invalid {
        border-color: #dc3545;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right calc(0.375em + 0.1875rem) center;
        background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    }

    .modal-form .form-control.is-invalid:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
    }

    .modal-form .form-control.is-invalid {
        animation: shake 0.5s ease-in-out;
    }

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