/* =============================================
   page-perfil.css — Perfil page specific styles
   ============================================= */

/* --- Bento Gallery hover / pointer --- */
.bento-gallery [data-index],
.bento-gallery .bento-overlay {
    cursor: pointer;
}

/* --- Public appointment calendar --- */
.profile-booking-grid {
    display: grid;
    grid-template-columns: minmax(280px, .95fr) minmax(280px, 1.05fr);
    gap: 2rem;
}

.profile-calendar-header {
    display: grid;
    grid-template-columns: 38px 1fr 38px;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    text-align: center;
}

.profile-calendar-arrow {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1.5px solid #2c65f5;
    border-radius: 50%;
    background: #fff;
    color: #2c65f5;
    transition: background .2s ease, color .2s ease, opacity .2s ease;
}

.profile-calendar-arrow:hover:not(:disabled) { background: #2c65f5; color: #fff; }
.profile-calendar-arrow:disabled { opacity: .3; cursor: not-allowed; }

.profile-calendar-weekdays,
.profile-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .35rem;
}

.profile-calendar-weekdays {
    margin-bottom: .5rem;
    color: #0b1a42;
    font-size: .7rem;
    font-weight: 800;
    text-align: center;
}

.profile-calendar-day {
    width: 34px;
    height: 34px;
    justify-self: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #aab2c3;
    font-size: .8rem;
    font-weight: 600;
}

.profile-calendar-day.is-available { color: #0b1a42; }
.profile-calendar-day.is-available:hover { background: #eef4ff; color: #2c65f5; }
.profile-calendar-day.is-selected { background: #2c65f5; color: #fff; box-shadow: 0 5px 12px rgba(44, 101, 245, .26); }

.profile-branch-select { width: auto; max-width: 180px; border-radius: 999px; }
.profile-slots-panel { min-width: 0; }
.profile-slots { max-height: 250px; overflow-y: auto; padding-right: .35rem; scrollbar-width: thin; }

.profile-slot {
    width: 100%;
    min-height: 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .55rem;
    padding: .55rem .9rem;
    border: 1.5px solid #2c65f5;
    border-radius: 999px;
    background: #fff;
    color: #2c65f5;
    font-weight: 700;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.profile-slot span { display: inline-flex; align-items: center; gap: .5rem; }
.profile-slot small { padding: .18rem .55rem; border-radius: 999px; background: #e8fbf6; color: #00a982; font-weight: 700; }
.profile-slot:hover, .profile-slot:focus-visible { background: #00b996; border-color: #00b996; color: #fff; transform: translateY(-1px); }
.profile-slot:hover small, .profile-slot:focus-visible small { background: rgba(255,255,255,.2); color: #fff; }

.profile-empty-slots {
    min-height: 150px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: .75rem;
    color: #7c879e;
    text-align: center;
    font-size: .85rem;
}
.profile-empty-slots i { font-size: 1.7rem; color: #b8c0cf; }

.profile-appointment-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 16px;
    background: #f1f6ff;
    color: #0b1a42;
}
.profile-appointment-summary > i { font-size: 1.5rem; color: #2c65f5; }
.profile-appointment-summary strong, .profile-appointment-summary span { display: block; }
.profile-appointment-summary span { margin-top: .15rem; color: #68738a; font-size: .8rem; }

/* --- Patient opinions --- */
.profile-rating-number { color: #0b1a42; font-size: 3rem; font-weight: 800; line-height: 1; }
.profile-rating-stars, .profile-opinion-stars { color: #ffb400; letter-spacing: .08em; }
.profile-rating-stars { margin: .5rem 0; font-size: 1.1rem; }
.profile-rating-row { display: grid; grid-template-columns: 30px 1fr 38px; align-items: center; gap: .75rem; margin: .45rem 0; color: #68738a; font-size: .75rem; font-weight: 700; }
.profile-rating-row i { color: #ffb400; }
.profile-rating-row .progress { height: 5px; background: #e8edf5; }
.profile-rating-row .progress-bar { background: #ffb400; }

.profile-opinion-form { padding: 1.25rem; border: 1px solid #e3e9f2; border-radius: 18px; background: #f9fbfe; }
.profile-opinion-form fieldset:disabled { opacity: .78; }
.profile-star-input { display: inline-flex; flex-direction: row; gap: .2rem; }
.profile-star-input button { padding: 0; border: 0; background: transparent; color: #aab2c3; font-size: 1.2rem; }
.profile-star-input button:hover, .profile-star-input button.is-active { color: #ffb400; }
.profile-opinion-form textarea { border-color: #e3e9f2; border-radius: 12px; resize: vertical; }

.profile-opinion-card { padding: 1.15rem 0; border-top: 1px solid #edf0f5; }
.profile-opinion-card:first-child { border-top: 0; }
.profile-opinion-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #eef2f7; }

.profile-login-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: #edf3ff; color: #2c65f5; font-size: 1.35rem; }

.profile-feedback {
    position: fixed;
    z-index: 11000;
    right: 20px;
    bottom: 20px;
    max-width: min(420px, calc(100vw - 40px));
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    border-radius: 14px;
    background: #0b1a42;
    color: #fff;
    box-shadow: 0 14px 36px rgba(11,26,66,.25);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .2s ease, transform .2s ease;
}
.profile-feedback.is-visible { opacity: 1; transform: translateY(0); }
.profile-feedback-success i { color: #35d6ac; }
.profile-feedback-error i { color: #ff7880; }

@media (max-width: 767.98px) {
    .profile-booking-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .profile-calendar-day { width: 32px; height: 32px; }
    .profile-slots { max-height: 225px; }
    .profile-feedback { bottom: 84px; }
}

.bento-gallery [data-index]:hover img {
    filter: brightness(0.85);
    transition: filter 0.3s ease;
}

.bento-gallery .bento-overlay:hover {
    background: rgba(0, 0, 0, 0.75);
}

.profile-gallery-preview.bento-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 190px 80px;
    gap: 8px;
    overflow: visible;
    border-radius: 0;
}

.profile-gallery-item {
    position: relative;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #eef2f7;
}

.profile-gallery-item.profile-gallery-main {
    grid-column: 1 / -1;
}

.profile-gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: filter .2s ease, transform .2s ease;
}

.profile-gallery-item:hover img,
.profile-gallery-item:focus-visible img {
    filter: brightness(.82);
    transform: scale(1.025);
}

.profile-gallery-item:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: 2px;
}

.profile-gallery-zoom {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(15, 23, 42, .68);
    color: #fff;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease;
}

.profile-gallery-item:hover .profile-gallery-zoom,
.profile-gallery-item:focus-visible .profile-gallery-zoom {
    opacity: 1;
    transform: translateY(0);
}

.profile-gallery-preview .bento-overlay {
    gap: 2px;
    background: rgba(11, 26, 66, .68);
    pointer-events: none;
}

.profile-gallery-preview .bento-overlay strong {
    font-size: 1.25rem;
}

.profile-gallery-preview .bento-overlay small {
    font-weight: 700;
}

/* --- Clinical cases --- */
.profile-case-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-case-media > .row {
    position: relative;
    transition: box-shadow .2s ease, transform .2s ease;
}

.profile-case-media:hover > .row,
.profile-case-media:focus-visible > .row {
    box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
    transform: translateY(-2px);
}

.profile-case-media:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .28);
    outline-offset: 3px;
    border-radius: 1rem;
}

.profile-case-expand {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(11, 26, 66, .78);
    color: #fff;
    opacity: 0;
    transform: translate(-50%, -45%);
    transition: opacity .2s ease, transform .2s ease;
}

.profile-case-media:hover .profile-case-expand,
.profile-case-media:focus-visible .profile-case-expand {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.profile-case-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.profile-case-modal-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    background: #eef2f7;
}

.profile-case-modal-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: filter .2s ease, transform .2s ease;
}

.profile-case-modal-image .badge {
    position: absolute;
    top: 14px;
    left: 14px;
}

.profile-case-modal-image > i {
    position: absolute;
    top: 50%;
    left: 50%;
    color: #fff;
    font-size: 2rem;
    opacity: 0;
    transform: translate(-50%, -40%);
    transition: opacity .2s ease, transform .2s ease;
}

.profile-case-modal-image:hover img,
.profile-case-modal-image:focus-visible img {
    filter: brightness(.65);
    transform: scale(1.02);
}

.profile-case-modal-image:hover > i,
.profile-case-modal-image:focus-visible > i {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.profile-case-full-description {
    white-space: pre-line;
}

/* --- Lightbox --- */
.dt-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dt-lightbox-overlay.dt-lightbox-open {
    opacity: 1;
    visibility: visible;
}

.dt-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(6px);
}

.dt-lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90vw;
    height: 90vh;
}

.dt-lightbox-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 85vh;
}

.dt-lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    user-select: none;
    cursor: zoom-in;
    transition: transform .18s ease;
}

.dt-lightbox-img.is-zoomed {
    cursor: zoom-out;
}

.dt-lightbox-zoom-controls {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: flex;
    gap: 8px;
}

.dt-lightbox-zoom-controls button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1rem;
}

.dt-lightbox-zoom-controls button:hover,
.dt-lightbox-zoom-controls button:focus-visible {
    background: rgba(255, 255, 255, .25);
}

.dt-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}

.dt-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.dt-lightbox-prev,
.dt-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.25rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.dt-lightbox-prev:hover,
.dt-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.dt-lightbox-prev {
    left: 16px;
}

.dt-lightbox-next {
    right: 16px;
}

.dt-lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 16px;
    border-radius: 20px;
    user-select: none;
}

/* --- Sticky bottom action bar --- */
.profile-action-bar {
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

body.has-profile-bar {
    padding-bottom: 80px;
}

/* --- Formulario de contacto del especialista --- */
.profile-contact-modal {
    background: #fff;
    box-shadow: 0 30px 80px rgba(11, 26, 66, .24);
}

.profile-contact-heading {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 15%, rgba(255,255,255,.2), transparent 25%),
        linear-gradient(135deg, #173d78, #2c65f5 68%, #41b6e6);
}

.profile-contact-heading::after {
    position: absolute;
    right: -42px;
    bottom: -80px;
    width: 180px;
    height: 180px;
    border: 28px solid rgba(255,255,255,.08);
    border-radius: 50%;
    content: '';
}

.profile-contact-heading p {
    color: #fff;
}

.profile-contact-icon {
    position: relative;
    z-index: 1;
    display: inline-grid;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 14px;
    background: rgba(255,255,255,.14);
    font-size: 1.25rem;
}

.profile-contact-control {
    position: relative;
}

.profile-contact-control > i {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 15px;
    color: #718096;
    transform: translateY(-50%);
    pointer-events: none;
}

.profile-contact-control .form-control,
.profile-contact-control .form-select {
    min-height: 48px;
    padding-left: 42px;
    border-color: #dfe6ef;
    border-radius: 12px;
    background-color: #f9fbfd;
}

.profile-contact-modal textarea.form-control {
    border-color: #dfe6ef;
    border-radius: 12px;
    background-color: #f9fbfd;
}

@media (min-width: 992px) {
    .profile-action-bar {
        position: sticky;
        bottom: 0;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(10px);
    }

    body.has-profile-bar {
        padding-bottom: 0;
    }
}

@media (max-width: 576px) {
    .dt-lightbox-prev,
    .dt-lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .dt-lightbox-prev { left: 8px; }
    .dt-lightbox-next { right: 8px; }

    .dt-lightbox-close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .dt-lightbox-counter {
        bottom: 16px;
        font-size: 0.75rem;
        padding: 4px 12px;
    }
}
