/* Основные стили для контейнера */
.grid-master-selection {
    position: relative;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1C2526 0%, #1A1A1A 50%, #2A1A2E 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

.grid-card-container {
    width: 100%;
    max-width: 900px;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

.grid-card-container::-webkit-scrollbar {
    width: 6px;
}

.grid-card-container::-webkit-scrollbar-track {
    background: #333;
}

.grid-card-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.grid-card-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.grid-card {
    width: 45%;
    max-width: 400px;
    height: auto;
    background-color: #000;
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    touch-action: auto;
}

.grid-card .photo-slider-container {
    position: relative;
    width: 100%;
    height: 60%;
    overflow: hidden;
}

.grid-card .photo-slider-track {
    display: block;
    height: 100%;
    width: 100%;
}

.grid-card .photo-slide {
    margin: 0;
    padding: 0;
    position: relative;
    height: 100%;
    width: 100%;
}

.grid-card .slider-photo {
    object-fit: contain; /* Изменено с cover на contain, чтобы фото показывалось полностью */
    display: block;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    width: 100%;
    height: 100%;
    touch-action: auto;
    margin: 0;
}

.grid-card .magnifier-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: white;
    cursor: pointer;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.grid-card .header-container {
    position: absolute;
 bottom: 40px;
    left: 10px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.grid-card .name-age {
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.grid-card .about-section {
    padding: 0 20px;
    text-align: left;
    color: white;
    overflow-y: auto;
}

.grid-card .about-section h4 {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0 5px;
}

.grid-card .about-section p {
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.grid-card .photo-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    overflow-y: auto;
    display: none;
}

.grid-card .photo-gallery img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    touch-action: manipulation;
}

.grid-card .interests-section {
    padding: 0 20px;
    text-align: left;
    color: white;
    overflow-y: auto;
	height: 170px;
}

.grid-card .interests-section h4 {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0 5px;
}

.grid-card .interests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.grid-card .interest-item {
    background-color: #333;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.grid-card .book-button {
    margin: 10px;
    padding: 8px 16px;
    background-color: #fe3c72;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    touch-action: manipulation;
}

.grid-card .book-button:hover {
    background-color: #e03562;
}

/* Адаптация для мобильных устройств */
@media (max-width: 600px) {
    .grid-card {
        width: 90%;
        height: 580px;
        touch-action: auto;
    }

    .grid-card .photo-slider-container {
        height: 55%;
        overflow: hidden;
    }

    .grid-card .slider-photo {
        object-fit: contain; /* Изменено с cover на contain */
        touch-action: auto;
    }

    .grid-card .name-age {
        font-size: 16px;
    }

    .grid-card .photo-gallery img {
        width: 30px;
        height: 50px;
    }

    .grid-card .about-section h4,
    .grid-card .interests-section h4 {
        display: none;
        font-size: 16px;
    }

    .grid-card .about-section p {
        font-size: 12px;
        display: none;
    }

    .grid-card .interest-item {
        font-size: 12px;
        padding: 4px 12px;
    }

    .grid-card .book-button {
             padding: 6px 25px;
        font-size: 18px;
    }

    .grid-card .magnifier-icon {
        font-size: 20px;
        top: 8px;
        right: 8px;
    }
}

@media (max-width: 400px) {
    .grid-card-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .grid-card {
        width: 100%;
       height: 680px;
        touch-action: auto;
    }
.grid-card .about-section {

    padding-top: 40px;
}
    .grid-card .photo-slider-container {
        height: 500px;
        overflow: hidden;
    }

    .grid-card .slider-photo {
        object-fit: contain; /* Изменено с cover на contain */
        touch-action: auto;
    }

    .grid-card .name-age {
        font-size: 20px;
    }

    .grid-card .photo-gallery img {
        width: 45px;
        height: 45px;
    }

    .grid-card .book-button {
        padding: 5px 10px;
        font-size: 11px;
    }

    .grid-card .magnifier-icon {
        font-size: 18px;
    }
}