.merchant-detail {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.merchant-header {
    position: relative;
    height: 550px;
    /* Augmenté pour voir plus de contenu vertical */
    background: #020617;
    /* Fond sombre pour le mode contain */
}

.merchant-hero-image {
    height: 100%;
}

.merchant-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Retour au mode remplissage */
    /* Évite de couper les bords */
    object-position: center;
    /* Centrage parfait */
}

.image-placeholder-large {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    font-size: 8rem;
    font-weight: 800;
    color: white;
}

.merchant-title-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    color: white;
}

.detail-category {
    background: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1rem;
}

.merchant-title-box h1 {
    font-size: 3rem;
    margin: 0;
}

.merchant-body {
    padding: 3rem;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    min-width: 0;
    /* Empêche l'expansion forcée */
}

.merchant-main {
    min-width: 0;
    /* Crucial pour que le carrousel ne pousse pas les colonnes */
}

.detail-section {
    margin-bottom: 3rem;
}

.detail-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.detail-description {
    font-size: 1.125rem;
    color: var(--text-main);
    line-height: 1.8;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: rgba(2, 6, 23, 0.4);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.contact-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.contact-item .icon {
    font-size: 1.75rem;
}

.contact-item strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.contact-item p {
    margin: 0;
    font-weight: 600;
    color: var(--text-main);
}

/* Specific styling for the email contact item */
.contact-item.email-contact-item {
    flex-direction: column;
    /* Stack icon and text vertically */
    align-items: flex-start;
    /* Align everything to the left */
    gap: 0.5rem;
    /* Reduce gap between icon and text */
}

.contact-item.email-contact-item .icon {
    margin-bottom: 0.5rem;
    /* Space below the icon */
}

.contact-item.email-contact-item .email-text-wrapper {
    width: 100%;
    /* Ensure text wrapper takes full width */
}

.contact-item.email-contact-item p {
    font-size: 0.9rem;
    /* Smaller font size for email text */
    word-break: break-all;
    /* Allow long emails to break to new line */
    text-align: left;
    /* Ensure left alignment */
}

.contact-item.email-contact-item p a {
    display: block;
    /* Ensure the link takes up the full width */
}

.map-container {
    margin-top: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

/* Styles pour les Produits & Services */
.offers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.offer-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: var(--transition);
}

.offer-card:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--primary-color);
    transform: scale(1.01);
}

.offer-info {
    flex: 1;
}

.offer-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.service-type .offer-badge {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.offer-card h4 {
    font-size: 1.25rem;
    margin: 0 0 0.25rem 0;
    color: white;
}

.offer-desc {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0;
}

.offer-image {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    /* Hidden by default */
    margin-left: 1.5rem;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    display: block;
    position: relative;
    transition: all 0.3s ease;
}

.offer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: zoom-in;
}

/* Effat d'agrandissement au survol */
.offer-image:hover {
    overflow: visible;
    /* Permet à l'image de sortir du cadre */
    z-index: 100;
    /* Passe au-dessus de tout le reste */
}

.offer-image:hover img {
    transform: scale(2.75);
    /* 80px * 2.75 = 220px */
    opacity: 0.92;
    /* Légèrement transparent comme demandé */
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.offer-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-left: 1.5rem;
    /* Matches padding-right of .offer-card (1.5rem) */
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-card {
    background: rgba(2, 6, 23, 0.3);
    padding: 2rem 1.75rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.sidebar-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    color: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-btn:hover {
    transform: translateX(8px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.back-link {
    display: inline-block;
    color: var(--secondary-color);
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Styles for Opening Hours */
.opening-hours {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 1rem;
}

.hour-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
}

.hour-row:last-child {
    border-bottom: none;
}

.hour-row .day {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

.hour-row .hours {
    color: var(--text-muted);
    text-align: right;
    word-break: break-word;
    /* Safety for very long words */
}

@media (max-width: 992px) {
    .merchant-body {
        grid-template-columns: 1fr;
    }

    .merchant-header {
        height: 300px;
    }

    .merchant-title-box h1 {
        font-size: 2rem;
    }
}

/* Styles pour le formulaire de contact - NORMALISÉ */
.contact-form-section {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    margin-top: 4rem;
}

.contact-form-section h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    border-bottom: none;
    padding-bottom: 0;
}

.contact-form-section .section-intro {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    max-width: 600px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 0;
}

.contact-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-form label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-left: 0.25rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(2, 6, 23, 0.5);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(2, 6, 23, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.contact-form select option {
    background: #0f172a;
    color: white;
    padding: 0.5rem;
}

/* Style des groupes d'options (Produits/Services) */
.contact-form select optgroup {
    background: #1e293b;
    color: var(--secondary-color);
    font-weight: 700;
    font-style: normal;
}

.contact-form .error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.contact-form .error-message::before {
    content: "⚠️";
    font-size: 0.75rem;
}

.contact-form button[type="submit"] {
    padding: 1rem;
    font-size: 1rem;
    margin-top: 1rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

@media (max-width: 768px) {
    .contact-form-section {
        padding: 1.5rem;
    }

    .contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

}

/* GALERIE D'IMAGES - VERSION CARROUSEL */
.gallery-section {
    margin-bottom: 2.5rem;
}

.gallery-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(2, 6, 23, 0.4);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    overflow: hidden;
    /* Garantit que rien ne dépasse du cadre arrondi */
    width: 100%;
}

.merchant-gallery {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    width: 100%;
}

.merchant-gallery::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.gallery-nav {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: absolute;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.gallery-nav:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.gallery-nav.prev {
    left: 10px;
}

.gallery-nav.next {
    right: 10px;
}

.gallery-thumbnail {
    width: 100px;
    height: 75px;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition);
    opacity: 0.6;
    flex: 0 0 100px;
    /* Taille fixe pour le carrousel */
}

.gallery-thumbnail:hover,
.gallery-thumbnail.active {
    opacity: 1;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .gallery-nav {
        display: none !important;
        /* On utilise le scroll tactile sur mobile */
    }

    .gallery-container {
        padding: 0;
        border: none;
        background: transparent;
    }

    .gallery-thumbnail {
        width: 80px;
        height: 60px;
        flex: 0 0 80px;
    }
}