/* ==========================================================================
   PEP Material Reservation - Frontend Styles
   ========================================================================== */

/* Container principal */
.pmr-products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
}

/* Module de recherche */
.pmr-search-module {
    flex: 0 0 calc(33.333% - 20px);
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.pmr-products-wrapper {
    flex: 0 0 calc(66.666% - 10px);
    padding-bottom: 80px;
}

/* Formulaire de filtres */
.pmr-filter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pmr-search-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.pmr-filter-section {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.pmr-filter-section:first-child {
    border-top: none;
    padding-top: 0;
}

.pmr-filter-section h3 {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
}

/* Groupes de checkbox */
.pmr-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pmr-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
    position: relative;
}

.pmr-checkbox-label:hover {
    background-color: #f5f5f5;
}

/* Labels sélectionnés */
.pmr-checkbox-label.selected {
    background-color: #e3f2fd;
    border: 2px solid #1976d2;
    font-weight: 500;
}

.pmr-checkbox-label.selected .pmr-checkbox-text {
    color: #1976d2;
}

/* Les inputs sont présents et stylisés, donc on masque les pseudo-éléments pour éviter la duplication */
/* Note: Les pseudo-éléments ::before et ::after ne sont pas utilisés car les inputs gèrent l'affichage visuel */

/* Inputs checkbox/radio - Styles personnalisés */
.pmr-checkbox-label input[type="checkbox"],
.pmr-checkbox-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    margin-right: 10px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #ddd;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.pmr-checkbox-label input[type="checkbox"] {
    border-radius: 3px;
}

.pmr-checkbox-label input[type="radio"] {
    border-radius: 50%;
}

.pmr-checkbox-label input[type="checkbox"]:checked,
.pmr-checkbox-label input[type="radio"]:checked {
    background-color: #1976d2;
    border-color: #1976d2;
    border-width: 2px;
}

.pmr-checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: block;
    z-index: 1;
}

.pmr-checkbox-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
    display: block;
    z-index: 1;
}


.pmr-checkbox-text {
    font-size: 14px;
    color: #555;
    flex: 1;
}

/* Grille de produits */
.pmr-products-grid {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.pmr-products-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.pmr-products-list.loading {
    min-height: 300px;
    position: relative;
}

/* Cartes de produits */
.pmr-product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex;
    text-decoration: none;
    color: inherit;
}

.pmr-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.pmr-product-image {
    flex: 0 0 250px;
    /* height: 200px; */
    overflow: hidden;
}

.pmr-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pmr-product-card:hover .pmr-product-image img {
    transform: scale(1.05);
}

.pmr-product-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.pmr-product-indicators {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pmr-availability-status {
    background-color: #e3f2fd;
    color: #1565c0;
}

.pmr-availability-status.available {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.pmr-availability-status.reserved {
    background-color: #ffebee;
    color: #c62828;
}

.pmr-product-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.pmr-product-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.pmr-product-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.pmr-product-button,
.pmr-product-link {
    display: inline-block;
    padding: 8px 20px;
    background-color: #1976d2;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pmr-product-button:hover,
.pmr-product-link:hover {
    background-color: #1565c0;
    color: #fff;
}

/* Pagination */
.pmr-pagination {
    text-align: center;
    margin-top: 40px;
}

.pmr-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pmr-pagination .page-numbers.current {
    background-color: #1976d2;
    color: #fff;
    border-color: #1976d2;
}

.pmr-pagination .page-numbers:hover:not(.current) {
    background-color: #f5f5f5;
    border-color: #ccc;
}

/* Rappel de disponibilité */
.pmr-availability-reminder {
    max-width: 800px;
    margin: 60px auto 40px;
    padding: 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.pmr-availability-reminder.available {
    background-color: #e8f5e9;
    border: 2px solid #2e7d32;
}

.pmr-availability-reminder.reserved {
    background-color: #ffebee;
    border: 2px solid #c62828;
}

.pmr-availability-reminder-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.pmr-availability-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: white;
}

.pmr-availability-reminder.available .pmr-availability-icon {
    color: #2e7d32;
}

.pmr-availability-reminder.reserved .pmr-availability-icon {
    color: #c62828;
}

.pmr-availability-icon svg {
    width: 32px;
    height: 32px;
}

.pmr-availability-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.pmr-availability-reminder.available .pmr-availability-text h3 {
    color: #1b5e20;
}

.pmr-availability-reminder.reserved .pmr-availability-text h3 {
    color: #b71c1c;
}

.pmr-availability-text p {
    margin: 0;
    color: #555;
    font-size: 0.95em;
    line-height: 1.4;
}

/* Page single produit */
.pmr-single-product {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.pmr-single-product-header {
    margin-bottom: 30px;
}

.pmr-single-product-title {
    margin-bottom: 20px;
}

.pmr-single-product-title h1 {
    font-size: 32px;
    color: #333;
    margin: 0 0 15px 0;
}

.pmr-single-product-description {
    margin-bottom: 40px;
    font-size: 16px;
    line-height: 1.6;
    color: #555;

    h2{
        margin:30px 0;
        color: #57BFC7;;
    }
}

/* Section des composants */
.pmr-single-product-components {
    margin: 70px 0 0;
    max-width: 820px;
}

.pmr-single-product-components h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 25px;
}

.pmr-components-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.pmr-component-card {
    display: flex;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #eaeaea;
}

.pmr-component-image {
    flex: 0 0 300px;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.pmr-component-image::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #eaeaea;
}

.pmr-component-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pmr-component-description {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pmr-component-description p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

/* Bouton de retour */
.pmr-single-product-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pmr-back-link {
    display: inline-flex;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.pmr-back-link:hover {
    color: #1976d2;
}

/* Modalités de l'occasion */
.pmr-occasion-terms {
    background-color: #e3f2fd;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.pmr-single-product .pmr-occasion-terms {
    margin-top: 30px;
}

.pmr-products-container .pmr-occasion-terms {
    flex: 0 0 100%;
}

.pmr-occasion-terms-content {
    color: #1565c0;
    font-size: 15px;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
}

.pmr-occasion-terms-content p:last-child {
    margin-bottom: 0;
}

.pmr-occasion-terms-content h1,
.pmr-occasion-terms-content h2,
.pmr-occasion-terms-content h3,
.pmr-occasion-terms-content h4,
.pmr-occasion-terms-content h5,
.pmr-occasion-terms-content h6 {
    color: #1565c0;
    margin-top: 0;
}

/* Formulaire de réservation */
.pmr-reservation-form-container {
    margin-top: 40px;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pmr-reservation-form-container h2 {
    margin: 0 0 25px 0;
    font-size: 24px;
    color: #333;
}

.pmr-reservation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pmr-form-layout {
    display: flex;
    column-gap: 100px;
    row-gap: 30px;
    align-items: flex-start;
}

.pmr-form-left {
    flex: 0 0 calc(50% - 15px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pmr-form-right {
    flex: 0 0 calc(50% - 15px);
    display: flex;
    flex-direction: column;
}

.pmr-form-row {
    display: flex;
    gap: 20px;
}

.pmr-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pmr-form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.pmr-form-group input[type="text"],
.pmr-form-group input[type="email"],
.pmr-form-group input[type="tel"],
.pmr-form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}

.pmr-form-group input[type="text"]:focus,
.pmr-form-group input[type="email"]:focus,
.pmr-form-group input[type="tel"]:focus,
.pmr-form-group textarea:focus {
    border-color: #1976d2;
    outline: none;
}

.pmr-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.pmr-submit-button {
    background: #1976d2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pmr-submit-button:hover {
    background: #1565c0;
}

.pmr-product-unavailable {
    margin-top: 20px;
    padding: 20px;
    background: #ffebee;
    border-radius: 8px;
    color: #c62828;
    text-align: center;
    font-weight: 500;
}

/* Bouton d'effacement des filtres */
.pmr-filter-actions {
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.pmr-clear-filters-btn {
    display: none;
    width: 100%;
    padding: 10px 15px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
}

.pmr-clear-filters-btn.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.pmr-clear-filters-btn:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.pmr-clear-filters-btn:active {
    transform: translateY(0);
}

.pmr-clear-icon {
    font-size: 12px;
    font-weight: bold;
}

/* Calendrier Flatpickr */
#reservation_date.flatpickr-input[readonly] {
    display: none !important;
}

.flatpickr-calendar.inline {
    position: static !important;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    background: white !important;
    margin-top: 10px !important;
}

.flatpickr-day.selected {
    background: #1976d2 !important;
    border-color: #1976d2 !important;
}

.flatpickr-day.selected:hover {
    background: #1565c0 !important;
    border-color: #1565c0 !important;
}

.flatpickr-day.inRange {
    background: #e3f2fd !important;
    border-color: #1976d2 !important;
    color: #1976d2 !important;
}

.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #1976d2 !important;
    border-color: #1976d2 !important;
    color: white !important;
}

.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #1565c0 !important;
    border-color: #1565c0 !important;
}

.flatpickr-months{
    position: relative;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1024px) {
    .pmr-products-container {
        padding: 15px;
        gap: 20px;
    }

    .pmr-search-module {
        flex: 0 0 calc(40% - 10px);
    }

    .pmr-products-wrapper {
        flex: 0 0 calc(60% - 10px);
    }

    .pmr-form-layout{
        column-gap: 30px;
    }
}

@media (max-width: 768px) {
    .pmr-products-container {
        flex-direction: column;
        padding: 10px;
    }

    .pmr-search-module {
        flex: 0 0 100%;
        position: relative;
        top: 0;
        margin-bottom: 20px;
    }

    .pmr-products-wrapper {
        flex: 0 0 100%;
    }

    .pmr-product-card {
        flex-direction: column;
    }

    .pmr-product-image {
        flex: none;
        height: 200px;
        width: 100%;
    }

    .pmr-product-content {
        padding: 15px;
    }

    .pmr-product-indicators {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pmr-availability-status {
        font-size: 12px;
        padding: 4px 8px;
    }

    .pmr-product-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .pmr-product-description {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .pmr-single-product {
        padding: 15px;
    }

    .pmr-single-product-title h1 {
        font-size: 24px;
    }

    .pmr-components-grid {
        gap: 20px;
    }

    .pmr-component-card {
        flex-direction: column;
    }

    .pmr-component-image {
        flex: none;
        height: 200px;
        width: 100%;
    }

    .pmr-component-image::after {
        display: none;
    }

    .pmr-component-description {
        padding: 20px;
    }

    .pmr-occasion-terms {
        padding: 20px;
        margin-bottom: 20px;
    }

    .pmr-occasion-terms-content {
        font-size: 14px;
    }

    .pmr-occasion-terms-content h1,
    .pmr-occasion-terms-content h2,
    .pmr-occasion-terms-content h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .pmr-availability-reminder {
        margin: 30px 20px 30px;
    }

    .pmr-availability-reminder-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .pmr-availability-icon {
        margin: 0 auto;
    }

    .pmr-form-layout {
        flex-direction: column;
        gap: 20px;
    }

    .pmr-form-left,
    .pmr-form-right {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    .pmr-form-row {
        flex-direction: column;
        gap: 15px;
    }

    .pmr-reservation-form-container {
        padding: 20px;
        margin-top: 30px;
    }

    .pmr-reservation-form-container h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .pmr-form-group input[type="text"],
    .pmr-form-group input[type="email"],
    .pmr-form-group input[type="tel"],
    .pmr-form-group textarea {
        font-size: 16px;
    }

    .pmr-submit-button {
        width: 100%;
        padding: 15px;
    }

    .pmr-clear-filters-btn {
        font-size: 13px;
        padding: 8px 12px;
    }

    .pmr-products-list.loading {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .pmr-products-container {
        padding: 10px 5px;
    }

    .pmr-search-module {
        padding: 15px;
        margin-bottom: 15px;
    }

    .pmr-filter-section {
        padding-top: 12px;
        margin-top: 12px;
    }

    .pmr-filter-section h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .pmr-checkbox-group {
        gap: 8px;
    }

    .pmr-checkbox-label {
        padding: 4px 6px;
        font-size: 13px;
    }

    .pmr-checkbox-label input[type="checkbox"],
    .pmr-checkbox-label input[type="radio"] {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }

    .pmr-search-field input {
        padding: 8px;
        font-size: 14px;
    }

    .pmr-pagination {
        margin-top: 20px;
    }

    .pmr-pagination .page-numbers {
        padding: 6px 10px;
        font-size: 14px;
    }
}

/* Amélioration de l'accessibilité tactile */
@media (hover: none) {
    .pmr-checkbox-label {
        padding: 8px;
    }

    .pmr-product-card {
        transform: none !important;
    }

    .pmr-pagination .page-numbers {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
