#contact {
    padding: 100px 0 40px;
    min-height: auto;
    position: relative;
}

@media (min-width: 769px) {
    #contact.section.active {
        display: block !important;
    }

    body.tab-contact #contact {
        min-height: 0;
        padding-bottom: 40px;
    }
}

#contact > .container {
    width: 100%;
}

#contact > .container + .container {
    margin-top: 2rem;
}

.contact-rules {
    max-height: none;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.rules-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    /* без padding-left — заголовок по центру, кнопка absolute слева */
    padding-left: 0;
}

.rules-header h2 {
    margin: 0;
    color: white;
    font-size: 1.8rem;
    text-align: center;
    width: 100%;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0);
    border: 1px solid rgba(255, 255, 255, 0);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 10;
}

.toggle-btn:hover {
    background: rgba(57, 0, 1, 0.8);
}

.rules-content {
    max-height: none;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.rules-content.collapsed {
    max-height: 0;
    padding: 0;
    margin: 0;
}

.rules-content p,
.rules-content h4,
.rules-content ul {
    color: white;
    margin-bottom: 1rem;
}

.rules-content ul {
    padding-left: 1.5rem;
}

.rules-content li {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.rules-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.oferta-btn {
    display: inline-block;
    background: rgb(57, 0, 1);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s ease;
    font-weight: bold;
}

.oferta-btn:hover {
    background: rgba(57, 0, 1, 0);
}

#contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: white;
}

.contact-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    justify-content: center;
    max-width: 100%;
}

.contact-info {
    flex: 1;
    text-align: center;
}

.contact-info h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.contact-info p {
    color: white;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.contact-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    height: 40px;
    padding: 0 12px 0 0;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.btn-icon {
    height: 100%;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.btn-text {
    white-space: nowrap;
}

@media (max-width: 768px) {
    #contact {
        padding: 0 !important;
        min-height: auto;
        margin: 0 0 24px 0 !important;
    }

    #contact.section,
    #contact.section.active {
        display: block !important;
    }

    #contact > .container + .container {
        margin-top: 24px;
    }

    .rules-header {
        padding-left: 0;
    }

    .toggle-btn {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
    }

    .rules-header h2 {
        font-size: 1.4rem;
        text-align: center;
        width: 100%;
        /* небольшой запас, чтобы длинный заголовок не налезал на + */
        padding: 0 2rem;
        box-sizing: border-box;
    }

    #contact h2 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .contact-content {
        flex-direction: column;
        gap: 1.5rem;
        justify-content: center;
        align-items: center;
    }

    .contact-info {
        flex: 1 1 100%;
        text-align: center;
    }

    .contact-info h3 {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }

    .contact-info p {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    }

    .contact-buttons {
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
        justify-content: center;
        align-items: center;
    }

    .contact-btn {
        height: 48px;
        padding: 0 16px 0 0;
        font-size: 1rem;
    }

    .btn-icon {
        height: 100%;
        max-width: 28px;
    }

    .oferta-btn {
        width: 100%;
        text-align: center;
    }
}
