/* ═══════════════════════════════════════════════════════════════════════════════
   YGC — Mobile & Tablet Styles
   ═══════════════════════════════════════════════════════════════════════════════ */

@import url('./variables.css');

/* ═══════════════════════════════════════════════════════════════════════════════
   TABLET (768px - 1023px)
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1023px) {
    .container {
        padding: 0 20px;
    }
    
    .nav {
        display: none;
    }
    
    .burger {
        display: flex;
    }
    
    .hero {
        padding: 120px 0 80px;
        min-height: auto;
    }
    
    .hero__content {
        max-width: 100%;
    }
    
    .hero__title {
        font-size: 2.5rem;
    }
    
    .hero__subtitle {
        font-size: 1rem;
        max-width: 100%;
    }
    
    .hero__stats {
        flex-wrap: wrap;
        gap: 0;
    }
    
    .stat-item {
        padding: 14px 20px;
    }
    
    .stat-item__value {
        font-size: 1.25rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .steps {
        gap: 0;
    }
    
    .step {
        padding: 24px 16px;
        max-width: 250px;
    }
    
    .step__connector {
        width: 40px;
    }
    
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer__nav {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header__support-btn .icon {
        display: none;
    }
    
    .header__support-btn {
        padding: 8px 14px;
        font-size: 0.8125rem;
    }
    
    .lang-switcher__code {
        display: none;
    }
    
    .lang-switcher__btn {
        padding: 8px 10px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MOBILE (до 767px)
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    html {
        scroll-padding-top: calc(var(--header-height) + 16px);
    }
    
    .container {
        padding: 0 16px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section__header {
        margin-bottom: 32px;
    }
    
    .section__title {
        font-size: 1.5rem;
    }
    
    .section__desc {
        font-size: 0.9375rem;
    }
    
    .header {
        height: var(--header-height-mobile, 56px);
    }
    
    .header__inner {
        height: var(--header-height-mobile, 56px);
    }
    
    .header__actions .lang-switcher {
        display: none;
    }
    
    .header__actions {
        gap: 8px;
    }
    
    .logo__icon {
        width: 32px;
        height: 32px;
    }
    
    .logo__icon svg {
        width: 18px;
        height: 18px;
    }
    
    .logo__text {
        font-size: 1.125rem;
    }
    
    .hero {
        padding: 100px 0 60px;
        text-align: center;
    }
    
    .hero__content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero__badges {
        justify-content: center;
        margin-bottom: 24px;
    }
    
    .badge {
        padding: 6px 12px;
        font-size: 0.6875rem;
    }
    
    .hero__title {
        font-size: 1.875rem;
        margin-bottom: 16px;
    }
    
    .hero__subtitle {
        font-size: 0.9375rem;
        margin-bottom: 28px;
        line-height: 1.6;
    }
    
    .hero__buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
        margin-bottom: 40px;
    }
    
    .hero__buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero__stats {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        border-radius: var(--radius-lg);
    }
    
    .stat-item {
        padding: 12px 16px;
        flex: 1;
    }
    
    .stat-item__value {
        font-size: 1.125rem;
    }
    
    .stat-item__label {
        font-size: 0.625rem;
    }
    
    .stat-item__divider {
        width: 1px;
        height: 32px;
    }
    
    .hero__glow--green {
        width: 300px;
        height: 300px;
        top: -100px;
        right: -100px;
    }
    
    .hero__glow--blue {
        width: 250px;
        height: 250px;
        bottom: -50px;
        left: -50px;
    }
    
    .hero__glow--purple,
    .hero__glow--orange {
        display: none;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .project-card__body {
        padding: 14px;
    }
    
    .project-card__name {
        font-size: 0.9375rem;
    }
    
    .project-card__desc {
        font-size: 0.8125rem;
        margin-bottom: 12px;
    }
    
    .project-card__meta {
        font-size: 0.6875rem;
    }
    
    .steps {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    
    .step {
        width: 100%;
        max-width: 100%;
        padding: 24px 20px;
    }
    
    .step__num {
        top: -8px;
        right: 16px;
        width: 28px;
        height: 28px;
        font-size: 0.6875rem;
    }
    
    .step__icon {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
    }
    
    .step__icon svg {
        width: 20px;
        height: 20px;
    }
    
    .step__title {
        font-size: 0.9375rem;
    }
    
    .step__text {
        font-size: 0.8125rem;
    }
    
    .step__connector {
        width: auto;
        height: 32px;
        transform: rotate(90deg);
    }
    
    .faq-list {
        gap: 8px;
    }
    
    .faq-item__q {
        padding: 16px;
        font-size: 0.875rem;
    }
    
    .faq-item__a p {
        padding: 0 16px 16px;
        font-size: 0.8125rem;
    }
    
    .footer {
        padding: 40px 0 0;
    }
    
    .footer__grid {
        gap: 32px;
    }
    
    .footer__nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .footer__title {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }
    
    .footer__list a {
        font-size: 0.8125rem;
    }
    
    .footer__list li {
        margin-bottom: 8px;
    }
    
    .footer__desc {
        font-size: 0.8125rem;
        max-width: 100%;
    }
    
    .social__link {
        width: 44px;
        height: 44px;
    }
    
    .footer__bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 16px 0;
    }
    
    .footer__legal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    
    /* Modal Mobile */
    .modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal__content {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        transform: translateY(100%);
    }
    
    .modal.active .modal__content {
        transform: translateY(0);
    }
    
    .modal__header {
        padding: 16px;
    }
    
    .modal__logo {
        width: 40px;
        height: 40px;
    }
    
    .modal__title {
        font-size: 0.9375rem;
    }
    
    .modal__subtitle {
        font-size: 0.75rem;
    }
    
    .modal__breadcrumbs {
        padding: 12px 16px;
        gap: 2px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .crumb {
        padding: 6px 10px;
        font-size: 0.6875rem;
        white-space: nowrap;
    }
    
    .crumb__icon {
        width: 12px;
        height: 12px;
    }
    
    .crumb-sep svg {
        width: 12px;
        height: 12px;
    }
    
    .modal__body {
        padding: 16px;
    }
    
    .modal__footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }
    
    .modal__footer-info {
        font-size: 0.75rem;
        text-align: center;
    }
    
    #modalBack {
        width: 100%;
        justify-content: center;
    }
    
    .server-item {
        padding: 12px 14px;
    }
    
    .server-item__name {
        font-size: 0.875rem;
    }
    
    .server-item__online {
        font-size: 0.6875rem;
    }
    
    .server-item__btn {
        padding: 6px 12px;
        font-size: 0.6875rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .product-card {
        padding: 14px;
    }
    
    .product-card__name {
        font-size: 0.875rem;
    }
    
    .product-card__desc {
        font-size: 0.6875rem;
        margin-bottom: 10px;
    }
    
    .product-card__price {
        font-size: 1rem;
    }
    
    .checkout {
        gap: 14px;
    }
    
    .checkout__summary {
        padding: 14px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .checkout__summary-price {
        font-size: 1.25rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .form-group input,
    .form-group select {
        padding: 14px;
        font-size: 1rem;
    }
    
    .checkout__total {
        padding: 14px;
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
    
    .checkout__total-value {
        font-size: 1.25rem;
    }
    
    /* Toast Mobile */
    .toasts {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    
    .toast {
        padding: 12px 14px;
    }
    
    .toast span {
        font-size: 0.8125rem;
    }
    
    /* Buttons Mobile */
    .btn {
        padding: 12px 20px;
        font-size: 0.875rem;
    }
    
    .btn--lg {
        padding: 14px 24px;
        font-size: 0.9375rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SMALL MOBILE (до 480px)
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .hero {
        padding: 90px 0 50px;
    }
    
    .hero__title {
        font-size: 1.625rem;
    }
    
    .hero__subtitle {
        font-size: 0.875rem;
    }
    
    .hero__badges {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        padding: 10px 12px;
    }
    
    .stat-item__value {
        font-size: 1rem;
    }
    
    .stat-item__label {
        font-size: 0.5625rem;
    }
    
    .footer__nav {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer__info {
        text-align: center;
    }
    
    .footer__info .logo {
        justify-content: center;
    }
    
    .social {
        justify-content: center;
    }
    
    .section__title {
        font-size: 1.375rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOUCH OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
    .nav__link,
    .footer__list a,
    .footer__legal a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .project-card:hover {
        transform: none;
    }
    
    .step:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .project-card:active {
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.96);
    }
    
    .server-item:active,
    .product-card:active {
        transform: scale(0.98);
    }
    
    .hero__grid {
        display: none;
    }
    
    .hero__glow {
        animation: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LANDSCAPE MODE
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 0 40px;
    }
    
    .hero__stats {
        margin-bottom: 0;
    }
    
    .modal__content {
        max-height: 95vh;
    }
    
    .modal__body {
        max-height: 40vh;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SAFE AREA (iPhone X+)
   ═══════════════════════════════════════════════════════════════════════════════ */

@supports (padding: max(0px)) {
    .header {
        padding-top: max(0px, env(safe-area-inset-top));
    }
    
    .footer__bottom {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .modal__content {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .toasts {
        bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .mobile-nav {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

@media print {
    .header,
    .hero__bg,
    .hero__grid,
    .modal,
    .toasts,
    .burger,
    .mobile-nav,
    .mobile-nav__backdrop {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero {
        padding-top: 20px;
        min-height: auto;
    }
    
    .text-gradient {
        -webkit-text-fill-color: black;
        background: none;
    }
}