/* css/frontend.css */

#gr-reservation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Section Calendrier */
.gr-calendar-section {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gr-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.gr-calendar-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.gr-nav-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.gr-nav-btn:hover {
    background: #005a87;
}

.gr-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.gr-calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
    padding: 4px 2px;
    min-height: 45px;
}

.gr-calendar-day:hover {
    background: #e6f3ff;
}

.gr-calendar-day.selected {
    background: #0073aa;
    color: white;
    font-weight: bold;
}

.gr-calendar-day.disabled {
    background: #f8f9fa;
    color: #999;
    cursor: not-allowed;
}

.gr-calendar-day.closed {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    position: relative;
}

.gr-calendar-day.closed::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 1px;
    background: #dc3545;
    transform: translateY(-50%);
}

.gr-calendar-day.closed::after {
    content: 'Fermé';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #dc3545;
    font-weight: bold;
    text-transform: uppercase;
}

/* Créneaux occupés dans le calendrier */
.gr-occupied-slots {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 2px;
    width: 100%;
}

.gr-occupied-slot {
    background: #dc3545;
    color: white;
    font-size: 8px;
    padding: 1px 2px;
    border-radius: 2px;
    text-align: center;
    line-height: 1;
    font-weight: 500;
}

.gr-occupied-slot.gr-more {
    background: #6c757d;
    font-size: 7px;
}

.gr-calendar-day.selected .gr-occupied-slot {
    background: rgba(255,255,255,0.3);
    color: white;
}

.gr-calendar-day.other-month {
    color: #ccc;
    background: #f8f9fa;
}

.gr-calendar-day.today {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.gr-calendar-day.header {
    background: #f8f9fa;
    font-weight: bold;
    color: #666;
    cursor: default;
    font-size: 12px;
    min-height: auto;
    aspect-ratio: auto;
    padding: 8px 4px;
}

/* Horaires disponibles */
.gr-hours-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.gr-hours-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.gr-hours-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.gr-hour-slot {
    padding: 8px 4px;
    background: #e6f3ff;
    border: 1px solid #0073aa;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.gr-hour-slot:hover {
    background: #0073aa;
    color: white;
}

.gr-hour-slot.selected {
    background: #0073aa;
    color: white;
    font-weight: bold;
}

/* Horaires indisponibles */
.gr-unavailable-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gr-unavailable-slot {
    padding: 8px 12px;
    background: #f8d7da;
    border: 1px solid #dc3545;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    color: #721c24;
    font-weight: 500;
}

.no-unavailable {
    text-align: center;
    color: #28a745;
    font-weight: 500;
    padding: 15px;
    background: #d4edda;
    border-radius: 4px;
    margin: 0;
}

/* Messages informatifs pour les créneaux */
.no-hours {
    text-align: center;
    color: #dc3545;
    font-weight: 500;
    padding: 15px;
    background: #f8d7da;
    border-radius: 4px;
    margin: 0;
}

.no-hours small {
    color: #721c24;
    font-weight: normal;
}

.select-prestation {
    text-align: center;
    color: #0073aa;
    font-weight: 500;
    padding: 15px;
    background: #e6f3ff;
    border-radius: 4px;
    margin: 0;
}

.slots-info {
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    background: #e6f3ff;
    border-radius: 4px;
    color: #0073aa;
    font-size: 12px;
}

/* Section Formulaire */
.gr-form-section {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gr-form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.gr-form-group {
    margin-bottom: 15px;
}

.gr-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.gr-form-group input,
.gr-form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.gr-form-group input:focus,
.gr-form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.gr-form-group input[readonly] {
    background: #f8f9fa;
    color: #6c757d;
}

/* Saisie d'heure manuelle */
.heure-input-container {
    position: relative;
}

.heure-help {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
}

#gr-heure {
    background: #fff !important;
    color: #333 !important;
}

#gr-heure:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

#gr-heure.error {
    border-color: #dc3545;
    background-color: #f8d7da;
}

#gr-heure.success {
    border-color: #28a745;
    background-color: #d4edda;
}

.heure-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.heure-success {
    color: #28a745;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.gr-submit-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: background 0.3s ease;
}

.gr-submit-btn:hover {
    background: #005a87;
}

.gr-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Prestations Cards */
.prestations-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    margin: 0 auto 10px auto;
    padding: 0;
    max-width: 1200px;
}

#gr-reservation-container .prestations-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

.prestation-card {
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.prestation-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 8px rgba(0,115,170,0.2);
    transform: translateY(-2px);
}

.prestation-card.selected {
    border-color: #0073aa;
    background: #f0f8ff;
    box-shadow: 0 4px 8px rgba(0,115,170,0.3);
}

.prestation-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 15px;
    background: #0073aa;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.prestation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.prestation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 12px;
    color: #646970;
    margin-top: 0;
}

.prestation-duration {
    background: #f0f0f1;
    padding: 4px 8px;
    border-radius: 4px;
}

.prestation-price {
    background: #0073aa;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: auto;
}

.prestation-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.2;
}

.prestation-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-top: auto;
    margin-bottom: 12px;
}

/* Messages d'erreur pour prestations */
.prestation-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}
.gr-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
}

.gr-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.gr-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.gr-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Loading */
.gr-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: gr-spin 1s linear infinite;
}

@keyframes gr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Affichage des prestations par catégories */
.gr-prestations-display {
    margin: 20px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.gr-categorie-section {
    margin-bottom: 40px;
    padding: 20px;
}

.gr-categorie-title {
    display: none;
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    padding-left: 15px;
    font-weight: 600;
}

/* Affichage en cartes */
.gr-prestations-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    margin: 0 auto;
    padding: 0;
    max-width: 1200px;
}

.gr-prestations-display .gr-prestations-cards {
    grid-template-columns: repeat(2, 1fr) !important;
}

.gr-prestation-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.gr-prestation-card:hover {
    box-shadow: 0 4px 8px rgba(0,115,170,0.2);
    transform: translateY(-2px);
}

.gr-prestation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.gr-prestation-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.gr-prestation-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    margin-left: 10px;
    margin-top: 0;
}

.gr-duration {
    background: #f0f0f1;
    padding: 4px 8px;
    border-radius: 4px;
    color: #646970;
}

.gr-price {
    background: #0073aa;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.gr-prestation-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: auto 0 12px 0;
}

/* Affichage en liste */
.gr-prestations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gr-prestation-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.gr-prestation-item:hover {
    box-shadow: 0 2px 4px rgba(0,115,170,0.1);
}

.gr-prestation-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.gr-prestation-item .gr-prestation-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.gr-prestation-details {
    display: flex;
    gap: 10px;
    font-size: 12px;
}

.gr-prestation-item .gr-prestation-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Liste des catégories */
.gr-categories-list {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Affichage en grille */
.gr-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.gr-categorie-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.gr-categorie-item:hover {
    box-shadow: 0 4px 8px rgba(0,115,170,0.2);
    transform: translateY(-2px);
}

.gr-categorie-name {
    font-size: 18px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.gr-categorie-description {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    line-height: 1.4;
}

.gr-categorie-count {
    font-size: 12px;
    color: #999;
    margin: 10px 0;
    font-style: italic;
}

.gr-categorie-actions {
    margin-top: 15px;
}

/* Affichage en liste simple */
.gr-categories-list-simple {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gr-categorie-list-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.gr-categorie-list-item:hover {
    box-shadow: 0 2px 4px rgba(0,115,170,0.1);
}

.gr-categorie-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.gr-categorie-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.gr-categorie-content {
    flex: 1;
}

.gr-categorie-list-item .gr-categorie-name {
    font-size: 16px;
    margin: 0 0 5px 0;
}

.gr-categorie-list-item .gr-categorie-description {
    margin: 0;
    font-size: 13px;
}

.gr-categorie-list-item .gr-categorie-count {
    margin: 5px 0 0 0;
    font-size: 11px;
}

/* Affichage en boutons */
.gr-categories-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gr-btn-category {
    background: #fff;
    border: 2px solid #0073aa;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gr-btn-category:hover {
    background: var(--border-color, #0073aa);
    color: white !important;
}

.gr-btn-category .gr-count {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 5px;
}

/* Boutons génériques */
.gr-btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gr-btn-primary {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.gr-btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
    color: white;
    text-decoration: none;
}

.gr-btn-outline {
    background: transparent;
    color: #0073aa;
    border-color: #0073aa;
}

.gr-btn-outline:hover {
    background: #0073aa;
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .gr-categories-grid {
        grid-template-columns: 1fr;
    }
    
    .gr-categorie-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .gr-categories-buttons {
        justify-content: center;
    }
    
    .gr-btn-category {
        font-size: 12px;
        padding: 8px 12px;
    }
}
@media (max-width: 768px) {
    .prestations-grid,
    .gr-prestations-cards {
        grid-template-columns: 1fr !important;
        padding: 0;
        gap: 15px !important;
    }

    .gr-prestations-display {
        padding: 0;
    }

    .gr-categorie-section {
        padding: 15px;
    }

    .gr-prestation-header,
    .prestation-header {
        flex-direction: column;
        gap: 8px;
    }

    .gr-prestation-meta,
    .prestation-meta {
        margin-left: 0;
    }

    .gr-prestation-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
@media (max-width: 768px) {
    #gr-reservation-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gr-calendar-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .gr-calendar-day {
        font-size: 12px;
    }
    
    .gr-hours-list {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .gr-hour-slot {
        font-size: 12px;
        padding: 6px 2px;
    }
}

@media (max-width: 480px) {
    .gr-calendar-section,
    .gr-form-section {
        padding: 15px;
    }
    
    .gr-calendar-grid {
        gap: 0;
    }

    .gr-calendar-day {
        font-size: 11px;
    }

    .gr-nav-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ========================================
   FORFAITS HOMEPAGE - Shortcode [forfaits_homepage]
   ======================================== */

/* Container principal - Utilise le même style que prestations_categories */
.gr-forfaits-homepage {
    width: 100%;
    margin: 20px 0;
}

/* Les cartes utilisent le même style que .gr-prestations-cards existant */
.gr-forfaits-homepage .gr-prestations-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    margin: 0 auto;
    padding: 0;
    max-width: 1200px;
}

/* Bouton spécifique au shortcode homepage */
.gr-forfait-homepage-button {
    display: inline-block;
    background: #0073aa;
    color: white;
    text-align: center;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.gr-forfait-homepage-button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

/* Message si aucune prestation */
.gr-forfaits-homepage .gr-no-prestations {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
    font-size: 16px;
    background: #f0f0f1;
    border-radius: 8px;
}

/* ========================================
   RESPONSIVE - Forfaits Homepage
   ======================================== */

@media (max-width: 768px) {
    .gr-forfaits-homepage .gr-prestations-cards {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}