.main-clinic-card {
    padding: 30px;
    margin-bottom: 30px;
    background-color: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;

    /* Mobil uchun flex va balandlik */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.main-clinic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.main-card-header {
    display: flex;
    gap: 15px;

    /* Agar .clinic-list-button absolyut bo'lsa joylashuv o'zgarmasligi uchun kerak */
    position: relative;
}

.clinic-rating {
    margin-top: 5px;
    margin-bottom: 10px;
    /*text-align: center;*/
    margin-left: 9px;
}

.clinic-rating i {
    color: #f39c12;
    font-size: 14px;
}

.clinic-rating span {
    color: var(--gray-color);
    font-size: 14px;
    margin-left: 5px;
}

.clinic-logo {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-right: 20px;
    border: 1px solid var(--light-dark);
    padding: 10px;
    background-color: white;
}

.fa-stars {
    position: relative;
    display: inline-block;
    font-size: 24px;
    line-height: 1;
}

.fa-stars .stars-empty i {
    color: #ccc;
}

.fa-stars .stars-filled {
    color: gold;
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
}

.main-clinic-name {
    margin: 0;
    color: var(--primary-color);
}

.main-clinic-address,
.main-clinic-location {
    margin: 3px 0;
    font-size: 14px;
    color: #555;
}


.clinic-list-button {
    position: absolute;
    top: 2rem;
    right: 3rem;
    text-align: left;
    max-width: 102px;
}

.main-clinic-contact {
    margin-top: 20px;
}

.clinic-list-button .working-time {
    margin-top: 15px;
}

.record-button {
    background-color: #4a6cf7;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-block;
}

.record-button:hover {
    background-color: #3a5bd9;
}

.main-highlight {
    background-color: #ffffcc;
    padding: 3px 5px;
    display: inline-block;
    font-size: 13px;
    margin: 5px 0;
}

.directory-container {
    column-count: 4;
    column-gap: 40px;
    margin-bottom: 40px;
}

.letter-section {
    break-inside: avoid;
    margin-bottom: 30px;
    background: #fff;
}

.letter-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 8px;
    display: inline-block;
}

.specialty-list {
    list-style: none;
    margin-bottom: 30px;
    padding-left: 0;
}

.specialty-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
    cursor: pointer;
}

.specialty-item:hover {
    background-color: #f8f9fa;
    padding-left: 15px;
    border-radius: 6px;
    margin-left: -15px;
    margin-right: -15px;
    padding-right: 15px;
}

.specialty-item:last-child {
    border-bottom: none;
}

.specialty-name {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.specialty-more {
    color: #828ea5;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.specialty-name:hover {
    color: #2980b9;
    text-decoration: underline;
}

.specialty-count {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

@media (max-width: 576px) {
    .main-clinic-card {
        padding: 15px;
    }

    .clinic-info {
        display: flex;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .clinic-info span {
        display: block;

    }

    .clinic-info .clinic-rating {
        display: block;
        position: relative;
        right: 8px;
    }

    .clinic-logo {
        width: 100px;
        height: 100px;
        margin: 0 auto 15px;
        padding: 0;
        object-fit: cover;

    }

    .nimadir {
        max-width: 60%;
        text-align: center;
    }


    /* === Mobil uchun === */
    .main-clinic-card {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: auto; /* zarur bo‘lsa */
        padding: 15px;
    }

    /* .clinic-list-button oqimga qaytsin va pastga tushsin */
    .clinic-list-button {
        position: static;

        display: flex;
        flex-direction: column-reverse; /* button pastda, p tepada */
        align-items: center;
        gap: 10px;
        text-align: center;
        max-width: 100%;
    }

    /* Tugma to‘liq kenglikda va markazda */
    .record-button {
        width: 100%;
        max-width: 300px;
        padding: 12px 0;
        font-size: 16px;
        border-radius: 6px;
    }

    .working-time {
        font-size: 14px;
        color: #333;
        margin: 0;
    }

    .main-card-header {
        display: flex;
        flex-direction: column;

    }

    .nimadir {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .directory-container {
        column-count: 2;
    }

    .container {
        padding: 20px 15px;
    }

    .letter-header {
        font-size: 1rem;
    }

}

@media (max-width: 480px) {
    .specialty-item {
        /*flex-direction: column;*/
        /*align-items: flex-start;*/
        gap: 10px;
    }

    .specialty-count {
        align-self: flex-end;
        background: none;
    }

}