/* Final responsive polish for Sorov portfolio */

html,
body {
    max-width: 100%;
    overflow-x: hidden !important;
}

/* Header / Logo fix */
header,
.header-area,
.site-header,
.custom-header,
.navbar {
    max-width: 100%;
}

header .container,
.header-area .container,
.site-header .container,
.custom-header .container,
.navbar .container,
.navbar .container-fluid {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
}

.navbar-brand,
.logo,
.site-logo,
.header-logo {
    display: inline-flex !important;
    align-items: center !important;
    max-width: 72% !important;
    min-width: 0 !important;
}

.navbar-brand img,
.logo img,
.site-logo img,
.header-logo img,
.custom-logo,
header img.logo,
header img {
    max-height: 54px !important;
    width: auto !important;
    max-width: 220px !important;
    object-fit: contain !important;
}

.navbar-toggler,
.menu-toggle,
.mobile-menu-btn,
.offcanvas-toggle {
    flex: 0 0 auto !important;
    margin-left: auto !important;
}

/* Hide duplicate brand text on mobile when logo already has text */
@media (max-width: 767px) {
    .navbar-brand span,
    .site-title,
    .brand-title,
    .brand-text,
    header .logo-text {
        display: none !important;
    }

    header,
    .header-area,
    .site-header,
    .custom-header {
        padding: 14px 0 !important;
        min-height: auto !important;
    }

    .navbar {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .navbar-brand img,
    .logo img,
    .site-logo img,
    .header-logo img,
    .custom-logo,
    header img.logo,
    header img {
        max-height: 46px !important;
        max-width: 185px !important;
    }

    .navbar-toggler,
    .menu-toggle,
    .mobile-menu-btn,
    .offcanvas-toggle {
        width: 54px !important;
        height: 54px !important;
        border-radius: 15px !important;
    }
}

/* Hero section desktop */
@media (min-width: 992px) {
    .premium-hero {
        padding-top: 105px !important;
        padding-bottom: 75px !important;
    }

    .premium-hero .row {
        align-items: center !important;
    }

    .premium-hero-title {
        max-width: 760px !important;
    }

    .hero-orbit-wrap {
        max-width: 500px !important;
        min-height: 500px !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }
}

/* Hero section mobile */
@media (max-width: 767px) {
    .premium-hero {
        padding-top: 58px !important;
        padding-bottom: 40px !important;
        min-height: auto !important;
    }

    .premium-hero .container {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .premium-hero-badge {
        font-size: 15px !important;
        padding: 10px 16px !important;
        border-radius: 999px !important;
    }

    .premium-hero-title {
        font-size: 54px !important;
        line-height: 0.98 !important;
        letter-spacing: -2.2px !important;
        margin-top: 24px !important;
        margin-bottom: 22px !important;
    }

    .premium-hero-text {
        font-size: 17px !important;
        line-height: 1.75 !important;
        max-width: 100% !important;
        color: rgba(255,255,255,.68) !important;
    }

    .premium-hero .d-flex.flex-wrap.gap-3 {
        gap: 12px !important;
    }

    .premium-hero .btn {
        padding: 15px 22px !important;
        font-size: 15px !important;
        border-radius: 16px !important;
    }
}

@media (max-width: 390px) {
    .premium-hero-title {
        font-size: 48px !important;
    }

    .premium-hero .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Hero image/orbit fix */
.hero-orbit-wrap {
    overflow: visible !important;
}

@media (max-width: 767px) {
    .hero-orbit-wrap {
        width: 100% !important;
        max-width: 390px !important;
        min-height: 430px !important;
        margin: 28px auto 10px !important;
        transform: scale(.86) !important;
        transform-origin: center top !important;
    }

    .hero-orbit-bg {
        width: 300px !important;
        height: 300px !important;
    }

    .hero-orbit-ring {
        width: 380px !important;
        height: 380px !important;
    }

    .hero-person-frame {
        width: 270px !important;
        height: 335px !important;
    }

    .hero-float-card {
        min-width: 140px !important;
        max-width: 150px !important;
        padding: 10px 11px !important;
        gap: 8px !important;
        border-radius: 14px !important;
    }

    .hero-float-card strong {
        font-size: 17px !important;
        line-height: 1.05 !important;
    }

    .hero-float-card span {
        font-size: 11px !important;
        line-height: 1.15 !important;
    }

    .hero-float-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 18px !important;
        border-radius: 10px !important;
    }

    .hero-card-left {
        left: 0 !important;
        top: 225px !important;
    }

    .hero-card-right {
        right: 0 !important;
        bottom: 118px !important;
    }

    .hero-card-top,
    .hero-card-bottom {
        display: none !important;
    }

    .hero-orbit-icon {
        opacity: .22 !important;
    }
}

/* Stats / counter cards fix */
.stats-section,
.counter-section,
.funfact-section,
.premium-counter-section,
.experience-section {
    padding-top: 55px !important;
    padding-bottom: 55px !important;
}

:is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) {
    border-radius: 24px !important;
    padding: 26px !important;
    min-height: auto !important;
}

:is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) h2,
:is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) h3,
:is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) .number,
:is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) .counter,
:is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) .count {
    font-size: clamp(38px, 10vw, 72px) !important;
    line-height: 1 !important;
}

@media (max-width: 767px) {
    .stats-section,
    .counter-section,
    .funfact-section,
    .premium-counter-section,
    .experience-section {
        padding-top: 38px !important;
        padding-bottom: 38px !important;
    }

    :is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) {
        padding: 22px 24px !important;
        border-radius: 20px !important;
        margin-bottom: 16px !important;
    }

    :is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) h2,
    :is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) h3,
    :is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) .number,
    :is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) .counter,
    :is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) .count {
        font-size: 44px !important;
    }

    :is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) p,
    :is(.stat-card, .stats-card, .counter-card, .counter-item, .funfact-card, .funfact-item, .premium-stat-card, .experience-card) span {
        font-size: 17px !important;
        line-height: 1.35 !important;
    }
}

/* Section spacing and headings */
@media (max-width: 767px) {
    .premium-section {
        padding-top: 64px !important;
        padding-bottom: 64px !important;
    }

    .premium-section-title,
    .case-study-title {
        font-size: 42px !important;
        line-height: 1.08 !important;
        letter-spacing: -1.6px !important;
    }

    .premium-section-subtitle {
        font-size: 16px !important;
        line-height: 1.75 !important;
    }

    .case-study-hero {
        padding-top: 70px !important;
        padding-bottom: 45px !important;
    }
}

/* Portfolio mobile card fix */
@media (max-width: 767px) {
    .premium-behance-grid {
        column-count: 1 !important;
        display: block !important;
    }

    .premium-project-card {
        width: 100% !important;
        margin-bottom: 22px !important;
        border-radius: 22px !important;
        padding: 12px !important;
    }

    .premium-project-image img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 4 / 3 !important;
        object-fit: cover !important;
        border-radius: 16px !important;
    }

    .premium-project-meta {
        padding: 18px 2px 4px !important;
        align-items: center !important;
    }

    .premium-project-meta h3 {
        font-size: 24px !important;
        line-height: 1.18 !important;
    }

    .premium-project-meta p {
        font-size: 15px !important;
    }

    .button-group,
    .filter-button-group {
        display: flex !important;
        overflow-x: auto !important;
        gap: 10px !important;
        padding-bottom: 6px !important;
        margin-top: 28px !important;
    }

    .filter-button-group .btn,
    .btn-filter {
        flex: 0 0 auto !important;
        padding: 14px 18px !important;
        font-size: 14px !important;
        border-radius: 15px !important;
    }
}

/* Contact form readability + overflow fix */
.case-study-panel,
.case-study-panel * {
    min-width: 0;
}

.case-study-panel label,
#contact label,
.contact label {
    color: rgba(255,255,255,.82) !important;
}

.case-study-panel input,
.case-study-panel textarea,
.case-study-panel select {
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
}

.case-study-panel h4,
.case-study-panel p,
.case-study-panel a,
#contact h4,
#contact p,
#contact a {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

@media (max-width: 767px) {
    #contact .case-study-info-grid,
    .contact .case-study-info-grid {
        grid-template-columns: 1fr !important;
        gap: 22px !important;
    }

    #contact .case-study-panel,
    .contact .case-study-panel {
        padding: 24px !important;
        border-radius: 24px !important;
        overflow: hidden !important;
    }

    #contact .row,
    .contact .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #contact [class*="col-"],
    .contact [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #contact h4,
    .contact h4,
    .case-study-panel h4 {
        font-size: 24px !important;
        line-height: 1.25 !important;
    }

    #contact input,
    #contact textarea,
    #contact select {
        padding: 15px 16px !important;
        border-radius: 15px !important;
    }

    #contact .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Direct contact button */
@media (max-width: 767px) {
    .case-study-panel .btn.w-100 {
        white-space: normal !important;
        text-align: center !important;
    }
}

/* Back to top button fix */
.scroll-top,
.back-to-top,
#backToTop,
.backtop,
.to-top {
    width: 54px !important;
    height: 54px !important;
    right: 18px !important;
    bottom: 22px !important;
    border-radius: 16px !important;
    z-index: 80 !important;
}

@media (max-width: 767px) {
    .scroll-top,
    .back-to-top,
    #backToTop,
    .backtop,
    .to-top {
        width: 50px !important;
        height: 50px !important;
        right: 14px !important;
        bottom: 18px !important;
    }
}

/* Desktop polish */
@media (min-width: 1200px) {
    .container {
        max-width: 1180px !important;
    }

    .premium-project-card {
        break-inside: avoid !important;
    }

    .case-study-panel {
        padding: 34px !important;
    }

    #contact .case-study-panel h4 {
        font-size: 28px !important;
    }
}

/* Prevent mobile browser selected text weird overflow */
img,
video,
iframe {
    max-width: 100% !important;
}
