/* =========================
   Variables
========================= */
:root {
    --esp-color-primary: #e7be12;
    --esp-color-secondary: #3c3c3f;
}

/* =========================
   Containers
========================= */
.esp-container {
    margin: 15px 0;
    padding: 10px;
}

.esp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.esp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.esp-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.esp-columns label {
    width: 200px;
}

.esp-field {
    display: flex;
    flex-direction: column;
}

.esp-service-group {
    margin: 5px auto;
}

/* =========================
   Buttons
========================= */
.esp-btn {
    display: inline-block;
    background-color: var(--esp-color-primary);
    color: var(--esp-color-secondary);
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.esp-btn:hover,
.esp-btn:focus {
    background-color: var(--esp-color-secondary);
    color: var(--esp-color-primary);
}

/* =========================
   Repeater
========================= */
.esp-group {
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: #fafafa;
    overflow: hidden;
}

.esp-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

.esp-group-title {
    font-weight: 700;
}

.esp-toggle-group {
    border: none;
    background: transparent;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.esp-chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--esp-color-secondary);
    border-bottom: 2px solid var(--esp-color-secondary);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.esp-group.esp-closed .esp-chevron {
    transform: rotate(-135deg);
}

.esp-group-body {
    padding: 10px;
}

.esp-group-body > div {
    margin: 5px auto;
}

.esp-actions {
    margin-top: 8px;
}

.esp-actions .esp-btn {
    margin-right: 5px;
}

.esp-global-actions {
    margin: 10px 0;
}




/* =========================
   Switches
========================= */
.esp-switch {
    line-height: 26px;
}

.esp-switch-wrapper {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.esp-switch-wrapper input {
    opacity: 0;
    width: 0;
    height: 0;
}

.esp-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.esp-switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.esp-switch-wrapper input:checked + .esp-switch-slider {
    background-color: var(--esp-color-primary);
}

.esp-switch-wrapper input:checked + .esp-switch-slider:before {
    transform: translateX(24px);
}

/* =========================
   Inputs & Textareas
========================= */
.esp-container input[type="text"],
.esp-container input[type="number"],
.esp-container select,
.esp-container textarea {
    width: 100%;
    max-width: 100%;
    padding: 5px 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* =========================
   Galerie photos (metabox)
========================= */
.esp-photos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.esp-photo-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    cursor: move;
}

.esp-photo-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 6px;
}

.esp-photo-item .esp-btn {
    width: 100%;
    padding: 4px 6px;
    font-size: 12px;
}

/* =========================
   Media buttons
========================= */
.esp-media-single,
.esp-media-gallery {
    margin-top: 5px;
    margin-bottom: 10px;
}

/* =========================
   Galerie Swiper FRONT
========================= */
.esp-galerie-wrapper {
    width: 100%;
    max-width: 100%;
}

/* Slider principal */
.esp-galerie-slider {
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.esp-galerie-slider .swiper-slide {
    width: 100%;
    height: 100%;
}

.esp-galerie-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Thumbnails */
.esp-galerie-thumbs {
    width: 100%;
    margin-top: 15px;
    height: 100px;
    box-sizing: border-box;
}

.esp-galerie-thumbs .swiper-slide {
    height: 100%;
    opacity: 0.6;
    cursor: pointer;
}

.esp-galerie-thumbs .swiper-slide-thumb-active {
    opacity: 1;
}

.esp-galerie-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Flèches */
.esp-galerie-slider .swiper-button-next,
.esp-galerie-slider .swiper-button-prev,
.esp-galerie-thumbs .swiper-button-next,
.esp-galerie-thumbs .swiper-button-prev {
    color: #000;
}

/* =========================
   Responsive
========================= */
@media (max-width: 600px) {
    .esp-grid,
    .esp-grid-2 {
        grid-template-columns: 1fr;
    }

    .esp-columns label {
        width: 100%;
    }

    .esp-galerie-slider {
        height: 300px;
    }

    .esp-galerie-thumbs {
        height: 80px;
    }
}

