/*
 * Lepurity Booking — frontend styles
 * -------------------------------------------------
 * Scoped under .lep-booking-module and .lep-modal
 * so it blends with the Ecomus / Lepurity theme.
 */

:root {
    --lep-bg: #ffffff;
    --lep-bg-soft: #f5f3f0;
    --lep-bg-muted: #efeceb;
    --lep-text: #111111;
    --lep-text-soft: #4a4a4a;
    --lep-text-muted: #8a8a8a;
    --lep-border: #e6e3df;
    --lep-accent: #111111;
    --lep-accent-contrast: #ffffff;
    --lep-link: #2563eb;
    --lep-danger: #c0392b;
    --lep-success: #1e8e3e;
    --lep-radius: 14px;
    --lep-radius-sm: 8px;
    --lep-shadow: 0 6px 24px rgba(17, 17, 17, .06);
    --lep-shadow-hover: 0 12px 32px rgba(17, 17, 17, .12);
    --lep-transition: 0.25s ease;
}

/* ---------- Module container ---------- */
.lep-booking-module {
    font-family: inherit;
    color: var(--lep-text);
    width: 100%;
    box-sizing: border-box;
}

.lep-booking-module *,
.lep-booking-module *::before,
.lep-booking-module *::after {
    box-sizing: border-box;
}

/* ---------- Filter bar ---------- */
.lep-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 28px;
    padding: 14px 18px;
    background: var(--lep-bg-soft);
    border-radius: 999px;
}

.lep-filter-bar__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--lep-text-soft);
    padding: 8px 14px;
    background: #fff;
    border-radius: 999px;
}

.lep-filter-bar__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lep-filter-btn {
    border: 0;
    background: transparent;
    color: var(--lep-text-soft);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 9px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--lep-transition), color var(--lep-transition), transform var(--lep-transition);
    letter-spacing: .2px;
}

.lep-filter-btn:hover {
    background: #fff;
    color: var(--lep-text);
}

.lep-filter-btn.is-active {
    background: var(--lep-accent);
    color: var(--lep-accent-contrast);
}

.lep-filter-btn:focus-visible {
    outline: 2px solid var(--lep-text);
    outline-offset: 2px;
}

/* ---------- Grid ---------- */
.lep-treatment-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
}

.lep-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.lep-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lep-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lep-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1200px) {
    .lep-treatment-grid,
    .lep-cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .lep-treatment-grid,
    .lep-cols-4,
    .lep-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .lep-treatment-grid,
    .lep-cols-4,
    .lep-cols-3,
    .lep-cols-2 { grid-template-columns: 1fr; }
    .lep-filter-bar { border-radius: var(--lep-radius); padding: 14px; }
    .lep-filter-bar__label { width: 100%; text-align: center; }
}

/* ---------- Card ---------- */
.lep-card {
    background: var(--lep-bg);
    border-radius: var(--lep-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--lep-shadow);
    transition: box-shadow var(--lep-transition), transform var(--lep-transition);
    border: 1px solid var(--lep-border);
}

.lep-card:hover {
    box-shadow: var(--lep-shadow-hover);
    transform: translateY(-2px);
}

.lep-card[hidden] { display: none !important; }

.lep-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--lep-bg-muted);
}

.lep-card__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.lep-card:hover .lep-card__img {
    transform: scale(1.04);
}

.lep-card__img--placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eee, #ddd);
}

.lep-card__body {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-grow: 1;
}

.lep-card__title {
    margin: 0;
    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    line-height: 1.25;
    color: var(--lep-text);
}

.lep-card__desc {
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--lep-text-soft);
    position: relative;
}

.lep-card__desc-short p,
.lep-card__desc-full p { margin: 0 0 10px; }
.lep-card__desc-short p:last-child,
.lep-card__desc-full p:last-child { margin-bottom: 0; }

/*
 * Read More — reset the theme's default <button> hover styles.
 * Some themes apply a dark background on button hover; we force transparent here.
 */
.lep-card .lep-readmore,
.lep-card .lep-readmore:link,
.lep-card .lep-readmore:visited {
    display: inline-block;
    margin-top: 6px;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: var(--lep-link) !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: color var(--lep-transition) !important;
    min-height: 0 !important;
    line-height: 1.4 !important;
}

.lep-card .lep-readmore:hover,
.lep-card .lep-readmore:focus,
.lep-card .lep-readmore:focus-visible,
.lep-card .lep-readmore:active {
    background: transparent !important;
    color: #1d4ed8 !important;
    text-decoration: underline !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
}

/* ---------- Meta ---------- */
.lep-card__meta {
    display: flex;
    gap: 16px;
    padding: 10px 0 4px;
    border-top: 1px solid var(--lep-border);
    color: var(--lep-text-soft);
    font-size: 14px;
    margin-top: auto;
}

.lep-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.lep-icon-clock,
.lep-icon-phone,
.lep-icon-calendar {
    width: 16px;
    height: 16px;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    vertical-align: middle;
}

.lep-meta-item--price {
    font-weight: 600;
    color: #111;
    margin-left: auto;
}

.lep-icon-clock {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15.5 14'/%3E%3C/svg%3E");
}

.lep-icon-phone {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4398b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92V21a1 1 0 0 1-1.11 1A19.86 19.86 0 0 1 2 3.11 1 1 0 0 1 3 2h4.09A1 1 0 0 1 8 2.74l1 3a1 1 0 0 1-.29 1L7 8.46a16 16 0 0 0 8.54 8.54l1.7-1.7a1 1 0 0 1 1-.29l3 .9A1 1 0 0 1 22 16.92Z'/%3E%3C/svg%3E");
}

.lep-icon-calendar {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c92d4b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

/* ---------- Actions — clear visual hierarchy ---------- */
.lep-card__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--lep-border);
    padding-top: 16px;
    margin-top: 4px;
}

/* Base reset for both actions — neutralise theme defaults */
.lep-card .lep-action,
.lep-card .lep-action:link,
.lep-card .lep-action:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 18px !important;
    border-radius: 999px !important;
    font: inherit !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: .3px !important;
    text-transform: none !important;
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
    box-shadow: none !important;
    transition:
        background var(--lep-transition),
        color var(--lep-transition),
        border-color var(--lep-transition),
        transform var(--lep-transition) !important;
    box-sizing: border-box;
    min-height: 0;
}

/* "Свържи се" — secondary / outlined */
.lep-card .lep-action--phone,
.lep-card .lep-action--phone:link,
.lep-card .lep-action--phone:visited {
    background: #fff !important;
    color: #111 !important;
    border: 1.5px solid #e6e3df !important;
}

.lep-card .lep-action--phone:hover,
.lep-card .lep-action--phone:focus,
.lep-card .lep-action--phone:focus-visible {
    background: #faf8f5 !important;
    color: #111 !important;
    border-color: #111 !important;
    text-decoration: none !important;
    outline: none !important;
    transform: translateY(-1px);
}

/* "Запази час" — primary / filled (main call-to-action) */
.lep-card .lep-action--book,
.lep-card .lep-action--book:link,
.lep-card .lep-action--book:visited {
    background: #111 !important;
    color: #fff !important;
    border: 1.5px solid #111 !important;
}

.lep-card .lep-action--book:hover,
.lep-card .lep-action--book:focus,
.lep-card .lep-action--book:focus-visible {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
    text-decoration: none !important;
    outline: none !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(17, 17, 17, .18) !important;
}

/* Make the primary button's calendar icon white */
.lep-card .lep-action--book .lep-icon-calendar {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

/* Phone icon in secondary button — dark */
.lep-card .lep-action--phone .lep-icon-phone {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92V21a1 1 0 0 1-1.11 1A19.86 19.86 0 0 1 2 3.11 1 1 0 0 1 3 2h4.09A1 1 0 0 1 8 2.74l1 3a1 1 0 0 1-.29 1L7 8.46a16 16 0 0 0 8.54 8.54l1.7-1.7a1 1 0 0 1 1-.29l3 .9A1 1 0 0 1 22 16.92Z'/%3E%3C/svg%3E");
}

/* ---------- Empty state ---------- */
.lep-no-treatments {
    text-align: center;
    padding: 40px 20px;
    color: var(--lep-text-muted);
    background: var(--lep-bg-soft);
    border-radius: var(--lep-radius);
}

/* =========================================================
 * MODAL
 * ========================================================= */
.lep-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: inherit;
    color: var(--lep-text);
}

.lep-modal.is-open {
    display: flex;
    animation: lepFadeIn .25s ease;
}

.lep-modal *,
.lep-modal *::before,
.lep-modal *::after {
    box-sizing: border-box;
}

.lep-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.lep-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: var(--lep-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: auto;
    animation: lepSlideUp .3s ease;
}

.lep-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--lep-text);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--lep-transition);
    z-index: 2;
}

.lep-modal__close:hover { background: var(--lep-bg-soft); }

.lep-modal__header {
    padding: 28px 32px 6px;
}

.lep-modal__title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--lep-text);
}

.lep-modal__subtitle {
    margin: 6px 0 0;
    color: var(--lep-text-soft);
    font-size: 14px;
}

/* ---------- Form ---------- */
.lep-form {
    padding: 18px 32px 28px;
}

.lep-form__row {
    display: block;
}

.lep-form__row--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 480px) {
    .lep-form__row--split { grid-template-columns: 1fr; }
    .lep-modal__header,
    .lep-form { padding-left: 20px; padding-right: 20px; }
}

.lep-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.lep-form__field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--lep-text-soft);
    letter-spacing: .2px;
}

.lep-required { color: var(--lep-danger); }

.lep-form input[type="text"],
.lep-form input[type="email"],
.lep-form input[type="tel"],
.lep-form textarea {
    width: 100%;
    font: inherit;
    font-size: 15px;
    color: var(--lep-text);
    background: #fff;
    border: 1.5px solid var(--lep-border);
    border-radius: var(--lep-radius-sm);
    padding: 12px 14px;
    transition: border-color var(--lep-transition), box-shadow var(--lep-transition);
    -webkit-appearance: none;
    appearance: none;
}

.lep-form input:focus,
.lep-form textarea:focus {
    outline: none;
    border-color: var(--lep-accent);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.lep-form textarea { resize: vertical; min-height: 80px; }

.lep-form__hint {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--lep-text-muted);
}

.lep-form__hint--contact {
    margin: -6px 0 14px;
    padding-left: 2px;
}

/* Honeypot — invisible */
.lep-hp {
    position: absolute !important;
    left: -10000px !important;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Field error state */
.lep-form__field.has-error input,
.lep-form__field.has-error textarea {
    border-color: var(--lep-danger);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

/* Messages */
.lep-form__messages {
    margin: 8px 0 14px;
}

.lep-form__messages:empty { margin: 0; }

.lep-form__messages .lep-alert {
    padding: 10px 14px;
    border-radius: var(--lep-radius-sm);
    font-size: 14px;
    line-height: 1.45;
}

.lep-alert--error {
    background: #fdecea;
    color: #8a1c10;
    border: 1px solid #f5c9c2;
}

.lep-alert--success {
    background: #e8f5ed;
    color: #1e4d2b;
    border: 1px solid #bfe0cb;
}

/* Actions */
.lep-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.lep-btn {
    border: 0;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: var(--lep-radius-sm);
    cursor: pointer;
    transition: background var(--lep-transition), transform var(--lep-transition), color var(--lep-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lep-btn--primary {
    background: var(--lep-accent);
    color: var(--lep-accent-contrast);
}

.lep-btn--primary:hover { background: #000; transform: translateY(-1px); }

.lep-btn--primary[disabled],
.lep-btn--primary.is-loading {
    opacity: .7;
    cursor: wait;
    transform: none;
}

.lep-btn--ghost {
    background: transparent;
    color: var(--lep-text-soft);
}

.lep-btn--ghost:hover {
    background: var(--lep-bg-soft);
    color: var(--lep-text);
}

/* Spinner inside button */
.lep-btn .lep-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lepSpin .7s linear infinite;
}

/* ---------- Success panel ---------- */
.lep-success {
    padding: 36px 32px 34px;
    text-align: center;
}

.lep-success[hidden] { display: none; }

.lep-success__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e8f5ed;
    color: var(--lep-success);
    font-size: 32px;
    line-height: 64px;
    margin: 0 auto 14px;
    font-weight: bold;
}

.lep-success__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.lep-success__text {
    margin: 0 0 22px;
    color: var(--lep-text-soft);
    font-size: 15px;
    line-height: 1.55;
}

.lep-success .lep-btn { margin: 0 auto; }

/* ---------- Animations ---------- */
@keyframes lepFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes lepSpin {
    to { transform: rotate(360deg); }
}

/* ---------- Scroll lock when modal open ---------- */
body.lep-modal-open {
    overflow: hidden;
}

/* ---------- WooCommerce: quote price + button ---------- */
.lep-quote-price {
    display: inline-block;
    font-weight: 600;
    color: #111;
    font-size: inherit;
    letter-spacing: .3px;
}

.lep-quote-wrap {
    margin: 14px 0 6px;
}

.woocommerce .lep-quote-btn,
.lep-quote-btn,
button.lep-quote-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #111 !important;
    color: #fff !important;
    border: 1.5px solid #111 !important;
    border-radius: 999px !important;
    padding: 12px 26px !important;
    font: inherit !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: .3px !important;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease !important;
    line-height: 1.2 !important;
    min-height: 0 !important;
}

.woocommerce .lep-quote-btn:hover,
.lep-quote-btn:hover,
button.lep-quote-btn:hover,
.woocommerce .lep-quote-btn:focus,
.lep-quote-btn:focus {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
    box-shadow: 0 6px 16px rgba(17, 17, 17, .18) !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

/* ---------- Modal: hide booking-only fields in quote mode ---------- */
.lep-modal[data-mode="quote"] [data-lep-booking-only] {
    display: none !important;
}

/* ---------- Login-only brand: link button (shares .lep-quote-btn look) ---------- */
.lep-login-wrap {
    margin: 14px 0 6px;
}

a.lep-login-btn,
a.lep-quote-btn.lep-login-btn,
.woocommerce a.lep-login-btn {
    text-decoration: none !important;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lep-modal.is-open,
    .lep-modal__dialog,
    .lep-card,
    .lep-card__img,
    .lep-btn,
    .lep-action,
    .lep-filter-btn {
        animation: none !important;
        transition: none !important;
    }
}
