/* Contact Sheet — Bottom sheet overlay for "Hubungi Kami" flow */

/* Backdrop */
.cs-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cs-backdrop.cs-open {
    opacity: 1;
    visibility: visible;
}

/* Sheet container */
.cs-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-radius: 24px 24px 0 0;
    z-index: 100001;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.12), 0 -2px 12px rgba(0,0,0,0.06);
    pointer-events: none;
}

.cs-sheet.cs-open {
    transform: translateY(0);
    pointer-events: auto;
}

/* Drag handle */
.cs-handle {
    width: 36px;
    height: 4px;
    background: #D5D5D5;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

/* Sheet header */
.cs-header {
    display: flex;
    align-items: center;
    padding: 16px 20px 12px;
    gap: 12px;
    flex-shrink: 0;
}

.cs-back,
.cs-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F2F2F2;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.cs-back svg {
    width: 16px;
    height: 16px;
    color: #3F4153;
}

.cs-close svg {
    width: 14px;
    height: 14px;
    color: #8B8C8D;
}

.cs-back[hidden] {
    display: none;
}

.cs-title {
    font-size: 18px;
    font-weight: 700;
    color: #3F4153;
    flex: 1;
    line-height: 1.2;
}

/* Sheet body — scrollable */
.cs-body {
    padding: 4px 20px 28px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Screen 1: Choice buttons (Emergency / Call Center) */
.cs-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1.5px solid #EBEBEB;
    background: #FFFFFF;
    cursor: pointer;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    color: inherit;
}

.cs-choice:active {
    background: #F9F9F9;
}

.cs-choice-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cs-choice-icon--emergency {
    background: #FDF0F0;
}

.cs-choice-icon--callcenter {
    background: #E8F1FA;
}

.cs-choice-icon--janji {
    background: #E8F1FA;
}

.cs-choice-icon--janji svg {
    color: #2B7ACC;
}

.cs-choice-icon svg {
    width: 22px;
    height: 22px;
}

.cs-choice-text {
    flex: 1;
    text-align: left;
}

.cs-choice-title {
    font-size: 16px;
    font-weight: 700;
    color: #3F4153;
    margin-bottom: 2px;
}

.cs-choice-desc {
    font-size: 13px;
    color: #8B8C8D;
    line-height: 1.3;
}

.cs-choice-arrow {
    flex-shrink: 0;
    color: #D5D5D5;
}

.cs-choice-arrow svg {
    width: 18px;
    height: 18px;
}

/* Screen 2B: Type buttons (Hospital / Clinic) */
.cs-type-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1.5px solid #EBEBEB;
    background: #FFFFFF;
    cursor: pointer;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    -webkit-tap-highlight-color: transparent;
}

.cs-type-btn:active {
    background: #F9F9F9;
}

/* Klinik entry appended to end of hospital list — separates visually from cards above */
.cs-type-btn--klinik-entry {
    margin-top: 16px;
}

/* V2: Hospital chooser row on Call Center screen */
.cs-hospital-chooser {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1.5px solid #EBEBEB;
    background: #FFFFFF;
    cursor: pointer;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    -webkit-tap-highlight-color: transparent;
}

.cs-hospital-chooser:active {
    background: #F9F9F9;
}

.cs-hospital-chooser-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #E8F1FA;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cs-hospital-chooser-icon svg {
    width: 18px;
    height: 18px;
    color: #2B7ACC;
}

.cs-hospital-chooser-info {
    flex: 1;
    min-width: 0;
}

.cs-hospital-chooser-name {
    font-size: 14px;
    font-weight: 700;
    color: #3F4153;
    line-height: 1.3;
    margin-bottom: 2px;
}

.cs-hospital-chooser-loc {
    font-size: 12px;
    color: #8B8C8D;
}

/* V2: Section divider between hospitals and the Klinik button on Call Center screen */
.cs-section-divider {
    height: 1px;
    background: #EBEBEB;
    margin: 12px 4px;
}

/* V2: when preceded by a divider, the Klinik button's own top margin is redundant */
.cs-type-btn--with-divider {
    margin-top: 0;
}

/* V2: Subsection label on hospital subpage */
.cs-subsection-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #8B8C8D;
    text-transform: uppercase;
    margin: 22px 0 10px;
    padding: 0 2px;
}

.cs-type-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #E8F1FA;
}

.cs-type-icon svg {
    width: 20px;
    height: 20px;
    color: #2B7ACC;
}

/* V2: Klinik-outside icon — gold/tan accent to differentiate from hospital-blue */
.cs-type-icon--klinik-outside {
    background: #F5EFE3;
}

.cs-type-icon--klinik-outside svg {
    color: #A89374;
}

.cs-type-title {
    font-size: 15px;
    font-weight: 700;
    color: #3F4153;
}

.cs-type-count {
    font-size: 12px;
    color: #8B8C8D;
}

/* Facility cards (used in Emergency, Hospital, Clinic screens) */
.cs-facility-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cs-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: #FFFFFF;
    border: 1.5px solid #EBEBEB;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.cs-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cs-card-info {
    flex: 1;
    min-width: 0;
}

.cs-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #3F4153;
    line-height: 1.3;
    margin-bottom: 2px;
}

.cs-card-loc {
    font-size: 12px;
    color: #8B8C8D;
    margin-bottom: 4px;
}

.cs-card-number {
    font-size: 13px;
    color: #8B8C8D;
    letter-spacing: 0.3px;
}

.cs-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* Emergency call button (red, 44x44) */
.cs-btn-emergency {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #CD2122;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(205,33,34,0.25);
    text-decoration: none;
}

.cs-btn-emergency:active {
    transform: scale(0.95);
}

.cs-btn-emergency svg {
    width: 20px;
    height: 20px;
    color: #FFFFFF;
}

/* WA button (green, primary) */
.cs-btn-wa {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    background: #26AD61;
    color: #FFFFFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(38,173,97,0.25);
    text-decoration: none;
    white-space: nowrap;
}

.cs-btn-wa:active {
    background: #1E9B53;
}

.cs-btn-wa svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Buat Janji button (blue, same width as WA) */
.cs-btn-janji {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    background: #2B7ACC;
    color: #FFFFFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(43,122,204,0.25);
    text-decoration: none;
    white-space: nowrap;
}

.cs-btn-janji:active {
    background: #2468B0;
}

.cs-btn-janji svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Phone button (ghost, small icon) */
.cs-btn-phone {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    border: 1.5px solid #D5D5D5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    text-decoration: none;
    padding: 0;
}

.cs-btn-phone:active {
    background: #F2F2F2;
}

.cs-btn-phone svg {
    width: 16px;
    height: 16px;
    color: #3F4153;
}

/* Expandable button indicator (shared between phone and janji) */
.cs-btn-phone--expand,
.cs-btn-janji--expand {
    position: relative;
}

.cs-btn-phone--expand::after,
.cs-btn-janji--expand::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #8B8C8D;
    border-bottom: 1.5px solid #8B8C8D;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.cs-btn-janji--expand::after {
    border-color: rgba(255,255,255,0.6);
}

.cs-btn-phone--expand.cs-expanded::after,
.cs-btn-janji--expand.cs-expanded::after {
    transform: rotate(-135deg);
    bottom: 3px;
}

.cs-btn-phone--expand.cs-expanded {
    background: #E8F1FA;
    border-color: #4A9FE5;
}

.cs-btn-phone--expand.cs-expanded svg {
    color: #2B7ACC;
}

.cs-btn-janji--expand.cs-expanded {
    background: #2468B0;
}

.cs-btn-janji--expand.cs-expanded::after {
    border-color: rgba(255,255,255,0.8);
}

/* Expanded location rows */
.cs-locations {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.cs-locations.cs-expanded {
    display: flex;
}

.cs-loc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #F9F9F9;
    border: 1px solid #EBEBEB;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.cs-loc-row:active {
    background: #F2F2F2;
}

.cs-loc-tag {
    font-size: 11px;
    font-weight: 700;
    color: #2B7ACC;
    background: #E8F1FA;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    min-width: 48px;
    text-align: center;
}

.cs-loc-number {
    font-size: 13px;
    color: #111111;
    letter-spacing: 0.3px;
    flex: 1;
}

.cs-loc-call {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1.5px solid #D5D5D5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    padding: 0;
}

.cs-loc-call:active {
    background: #F2F2F2;
}

.cs-loc-call svg {
    width: 14px;
    height: 14px;
    color: #3F4153;
}

/* Janji-style location row action */
.cs-loc-call--janji {
    background: #E8F1FA;
    border-color: #2B7ACC;
}

.cs-loc-call--janji svg {
    color: #2B7ACC;
}

/* Force consistent colors on all interactive states (prevents mobile sticky hover/visited) */
.cs-btn-wa,
.cs-btn-wa:visited,
.cs-btn-wa:hover,
.cs-btn-wa:focus {
    color: #FFFFFF;
    outline: none;
}

.cs-btn-janji,
.cs-btn-janji:visited,
.cs-btn-janji:hover,
.cs-btn-janji:focus {
    color: #FFFFFF;
    outline: none;
}

.cs-btn-phone:focus,
.cs-btn-phone:hover {
    outline: none;
}

.cs-btn-emergency,
.cs-btn-emergency:visited,
.cs-btn-emergency:hover,
.cs-btn-emergency:focus {
    outline: none;
}

.cs-choice:visited,
.cs-choice:hover,
.cs-choice:focus {
    color: inherit;
    outline: none;
}

.cs-loc-row:visited,
.cs-loc-row:hover,
.cs-loc-row:focus {
    color: inherit;
    outline: none;
}

.cs-loc-call:visited,
.cs-loc-call:hover,
.cs-loc-call:focus {
    outline: none;
}

.cs-back:focus,
.cs-close:focus {
    outline: none;
}

/* Body scroll lock */
body.cs-noscroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Desktop: centered modal instead of bottom sheet */
@media (min-width: 768px) {
    .cs-sheet {
        bottom: auto;
        left: 50%;
        right: auto;
        top: 50%;
        max-width: 420px;
        width: 90%;
        border-radius: 24px;
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
        transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1),
                    opacity 0.25s ease;
    }

    .cs-sheet.cs-open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .cs-handle {
        display: none;
    }
}
