/**
 * Responsive Styles — All Media Queries
 * 
 * Breakpoints:
 * - 1280px: Large desktop
 * - 1024px: Desktop / Tablet landscape
 * - 900px: Tablet / Mobile landscape
 * - 768px: Tablet portrait
 * - 600px: Mobile landscape
 * - 480px: Mobile portrait
 * 
 * @package Biolocus
 * @version 1.0.0
 */

/* ========================================
   LARGE DESKTOP (max-width: 1280px)
   ======================================== */

@media (max-width: 1280px) {
    /* Container */
    .container {
        max-width: 100%;
    }
}

/* ========================================
   DESKTOP / TABLET LANDSCAPE (max-width: 1024px)
   ======================================== */

@media (max-width: 1024px) {
    /* Products Grid: 4 -> 3 columns */
    .products__grid,
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Before/After Grid: 4 -> 2 columns */
    .before-after__grid,
    .ba-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Numbers Grid: 4 -> 2 columns */
    .numbers__grid,
    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer Grid: 4 -> 2 columns */
    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Header phones hide */
    .header__phones {
        display: none;
    }
    
    /* Callback button hide */
    .btn-callback {
        display: none;
    }
    
    /* Hero adjustments */
    .hero__title {
        font-size: 36px;
    }
    
    .hero__image,
    .hero__form {
        flex: 0 0 340px;
    }
}

/* ========================================
   TABLET / MOBILE LANDSCAPE (max-width: 900px)
   ======================================== */

@media (max-width: 900px) {
    /* Topbar left hide */
    .topbar__left {
        display: none;
    }
    
    /* Header icons hide */
    .header__icons {
        display: none;
    }
    
    /* Menus horizontal scroll */
    .menu-primary,
    .menu-categories {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .menu-primary__inner,
    .menu-categories__inner {
        flex-wrap: nowrap;
    }
    
    /* Search full width */
    .search-box {
        max-width: 100%;
    }
    
    /* Header inner gap */
    .header__inner {
        gap: 10px;
    }
    
    /* Sticky phone hide */
    .sticky-header__phone {
        display: none;
    }
    
    /* Hero: hide image and form */
    .hero__image,
    .hero__form {
        display: none !important;
    }
    
    .hero__slide {
        min-height: 320px;
    }
    
    .hero__title {
        font-size: 28px;
    }
    
    .hero__subtitle {
        font-size: var(--font-size-base);
    }
    
    .hero__stats {
        gap: var(--spacing-md);
    }
    
    .hero__stat-num {
        font-size: var(--font-size-xl);
    }
    
    /* Mobile bar appears */
    .mobile-bar {
        display: block;
    }
    
    /* Content padding for mobile bar */
    .site-content {
        padding-bottom: var(--mobile-bar-height);
    }
    
    /* Footer padding for mobile bar */
    .footer {
        padding-bottom: calc(var(--spacing-xl) + var(--mobile-bar-height));
    }
    
    /* Scroll top offset */
    .scroll-top {
        bottom: calc(var(--mobile-bar-height) + 20px);
    }
    
    /* Toast offset */
    .toast {
        right: 10px;
        left: 10px;
        top: auto;
        bottom: calc(var(--mobile-bar-height) + 20px);
    }
}

/* ========================================
   TABLET PORTRAIT (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    /* Root font size adjustment */
    :root {
        --font-size-base: 16px;
    }
    
    /* Section padding */
    .section {
        padding-top: var(--spacing-xl);
        padding-bottom: var(--spacing-xl);
    }
    
    /* Section header */
    .sec-head h2 {
        font-size: var(--font-size-2xl);
    }
    
    /* Products Grid: 3 -> 2 columns */
    .products__grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    /* Categories Grid: 3 -> 2 columns */
    .categories__grid,
    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    /* Advantages Grid: 3 -> 2 columns */
    .advantages__grid,
    .adv-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    /* Promos Grid: 3 -> 1 column */
    .promos__grid,
    .promo-grid {
        grid-template-columns: 1fr;
    }
    
    /* Bundles Grid: 3 -> 1 column */
    .bundles__grid,
    .bundles-grid {
        grid-template-columns: 1fr;
    }
    
    /* Before/After, Numbers: 2 columns with smaller gap */
    .before-after__grid,
    .ba-grid,
    .numbers__grid,
    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    /* Footer Grid: 2 -> 1 column */
    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Help block stack */
    .help__block,
    .help-block {
        flex-direction: column;
        padding: var(--spacing-lg);
    }
    
    .help__form,
    .help-block__form {
        flex: auto;
        width: 100%;
    }
    
    /* Season banner stack */
    .season-banner__inner {
        flex-direction: column;
        padding: var(--spacing-lg);
        text-align: center;
    }
    
    .season-banner__image {
        flex: auto;
        width: 100%;
        height: 180px;
    }
    
    .season-banner__title {
        font-size: var(--font-size-2xl);
    }
    
    /* Two columns stack */
    .two-cols {
        flex-direction: column;
    }
    
    .two-cols__sidebar {
        flex: auto;
        width: 100%;
    }
    
    /* Footer bottom stack */
    .footer__bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer__payments {
        flex-direction: column;
    }
    
    /* Product card adjustments */
    .p-card__image {
        height: 180px;
    }
    
    .p-card__name {
        font-size: var(--font-size-sm);
    }
    
    .p-card__price {
        font-size: var(--font-size-lg);
    }
    
    .p-card__actions {
        flex-direction: column;
    }
    
    .p-card__btn-quick {
        display: none;
    }
    
    /* Category card adjustments */
    .cat-card {
        height: 160px;
    }
    
    /* Numbers card adjustments */
    .num-card {
        padding: var(--spacing-lg);
    }
    
    .num-card__value {
        font-size: var(--font-size-2xl);
    }
    
    /* Timer adjustments */
    .timer__block {
        padding: 8px 10px;
        min-width: 48px;
    }
    
    .timer__num {
        font-size: var(--font-size-xl);
    }
    
    /* Modal adjustments */
    .modal {
        padding: var(--spacing-lg);
        margin: var(--spacing-md);
        max-width: calc(100% - var(--spacing-xl));
    }
    
    /* Breadcrumbs wrap */
    .breadcrumbs {
        font-size: var(--font-size-xs);
    }

    /* ========================================
   BREADCRUMBS MOBILE (добавить в секцию 768px)
   ======================================== */

/* Хлебные крошки - уменьшенные */
.breadcrumbs {
    font-size: 11px;
    padding: 8px 0;
}

.breadcrumbs__list {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.breadcrumbs__list::-webkit-scrollbar {
    display: none;
}

.breadcrumbs__item {
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumbs__sep {
    margin: 0 4px;
}
    
    /* Pagination smaller */
    .pagination__item {
        min-width: 36px;
        height: 36px;
        font-size: var(--font-size-xs);
    }
}

/* ========================================
   MOBILE LANDSCAPE (max-width: 600px)
   ======================================== */

@media (max-width: 600px) {
    /* Primary menu hide */
    .menu-primary {
        display: none;
    }
    
    /* Categories menu hide */
    .menu-categories {
        display: none;
    }
    
    /* Logo smaller */
    .logo {
        font-size: var(--font-size-xl);
    }
    
    .logo__icon {
        width: 24px;
        height: 24px;
    }
    
    /* Cart button simplified */
    .cart-btn__info {
        display: none;
    }
    
    .cart-btn {
        padding: 10px 14px;
    }
    
    /* Header simplified */
    .header {
        padding: 10px 0;
    }
    
    /* Search smaller */
    .search-box__input {
        padding: 10px 40px 10px 14px;
        font-size: var(--font-size-sm);
    }
    
    .search-box__btn {
        width: 32px;
        height: 32px;
    }
    
    /* Hero further simplified */
    .hero__slide {
        min-height: 280px;
    }
    
    .hero__inner {
        padding: var(--spacing-lg) var(--container-padding);
    }
    
    .hero__label {
        font-size: var(--font-size-xs);
    }
    
    .hero__title {
        font-size: var(--font-size-2xl);
    }
    
    .hero__cta {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: var(--font-size-base);
    }
    
    .hero__stats {
        justify-content: space-between;
    }
    
    /* Advantages Grid: 2 -> 1 column */
    .advantages__grid,
    .adv-grid {
        grid-template-columns: 1fr;
    }
    
    /* Advantage card horizontal on mobile */
    .adv-card {
        display: flex;
        align-items: center;
        text-align: left;
        padding: var(--spacing-md);
        gap: var(--spacing-md);
    }
    
    .adv-card__icon {
        margin: 0;
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }
    
    .adv-card__icon svg {
        width: 28px;
        height: 28px;
    }
    
    /* Bundle card adjustments */
    .bundle-card__items {
        flex-wrap: wrap;
    }
    
    .bundle-card__item {
        width: 60px;
        height: 60px;
    }
    
    /* BA card adjustments */
    .ba-card__slider {
        height: 160px;
    }
    
    /* Alert adjustments */
    .alert {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   MOBILE PORTRAIT (max-width: 480px)
   ======================================== */

@media (max-width: 480px) {
    /* Container padding */
    .container {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
    
    /* Products Grid: 2 -> 1 column */
    .products__grid,
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    /* Categories Grid: 2 -> 1 column */
    .categories__grid,
    .cat-grid {
        grid-template-columns: 1fr;
    }
    
    /* Before/After Grid: 2 -> 1 column */
    .before-after__grid,
    .ba-grid {
        grid-template-columns: 1fr;
    }
    
    /* Product card full width adjustments */
    .p-card__image {
        height: 200px;
    }
    
    .p-card__body {
        padding: var(--spacing-md);
    }
    
    .p-card__actions {
        flex-direction: row;
    }
    
    .p-card__btn-quick {
        display: flex;
    }
    
    /* Category card taller */
    .cat-card {
        height: 180px;
    }
    
    /* Hero minimal */
    .hero__slide {
        min-height: 260px;
    }
    
    .hero__stats {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }
    
    .hero__stat {
        display: flex;
        align-items: baseline;
        gap: var(--spacing-xs);
    }
    
    .hero__stat-num {
        font-size: var(--font-size-xl);
    }
    
    .hero__stat-label {
        margin-top: 0;
    }
    
    /* Timer smaller */
    .timer__block {
        padding: 6px 8px;
        min-width: 40px;
    }
    
    .timer__num {
        font-size: var(--font-size-lg);
    }
    
    .timer__label {
        font-size: 9px;
    }
    
    /* Numbers: values smaller */
    .num-card__value {
        font-size: var(--font-size-xl);
    }
    
    /* Хлебные крошки - ещё меньше */
.breadcrumbs {
    font-size: 10px;
    padding: 6px 0;
}

.breadcrumbs__sep {
    margin: 0 3px;
}

    .num-card__icon {
        width: 48px;
        height: 48px;
    }
    
    .num-card__icon svg {
        width: 24px;
        height: 24px;
    }
    
    /* Help form full padding */
    .help__form {
        padding: var(--spacing-md);
    }
    
    /* Section header emojis hide */
    .sec-head h2 {
        font-size: var(--font-size-xl);
    }
    
    /* Modal full width */
    .modal {
        padding: var(--spacing-md);
        margin: var(--spacing-sm);
        max-width: calc(100% - var(--spacing-md));
        border-radius: var(--radius-lg);
    }
    
    .modal__title {
        font-size: var(--font-size-lg);
    }
    
    /* Mobile menu adjustments */
    .mobile-menu {
        width: 100%;
        max-width: none;
    }
    
    /* Quantity selector smaller */
    .qty-selector__btn {
        width: 32px;
        height: 32px;
    }
    
    .qty-selector__input {
        width: 40px;
        height: 32px;
        font-size: var(--font-size-sm);
    }
}

/* ========================================
   TOUCH DEVICES
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch */
    .p-card:hover,
    .cat-card:hover,
    .adv-card:hover,
    .bundle-card:hover,
    .num-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Ensure clickable areas are large enough */
    .icon-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .mobile-bar__item {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover state on buttons for touch */
    .btn:hover,
    .btn--primary:hover,
    .btn--secondary:hover {
        transform: none;
    }
    
    /* Active state for touch feedback */
    .btn:active {
        transform: scale(0.98);
    }
    
    .p-card:active,
    .cat-card:active {
        transform: scale(0.99);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    /* Hide interactive elements */
    .topbar,
    .sticky-header,
    .mobile-bar,
    .mobile-menu-overlay,
    .modal-backdrop,
    .toast,
    .scroll-top,
    .hero__dots,
    .p-card__fav,
    .p-card__btn-quick,
    .btn-callback,
    .header__icons,
    .cart-btn,
    .search-box,
    .footer__social,
    .footer__payments {
        display: none !important;
    }
    
    /* Reset backgrounds */
    body,
    .section,
    .section-alt,
    .footer {
        background: white !important;
    }
    
    /* Reset colors */
    * {
        color: black !important;
    }
    
    /* Show full URLs */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    /* Avoid page breaks */
    .p-card,
    .cat-card,
    .adv-card {
        page-break-inside: avoid;
    }
    
    /* Grid simplification */
    .products__grid,
    .categories__grid,
    .advantages__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero__track {
        transition: none;
    }
    
    .fade-in {
        opacity: 1;
        transform: none;
    }
    
    .fade-in-stagger > * {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: high) {
    :root {
        --card-border: #000;
        --text-light: #333;
    }
    
    .btn--primary,
    .btn--accent {
        border: 2px solid currentColor;
    }
    
    .p-badge,
    .badge {
        border: 1px solid currentColor;
    }
}

/* ========================================
   DARK MODE PREPARATION (Future)
   ======================================== */

/*
@media (prefers-color-scheme: dark) {
    :root {
        --body-bg: #1A1A1A;
        --card-bg: #2D2D2D;
        --card-border: #404040;
        --section-alt: #242424;
        --text-dark: #F5F5F5;
        --text-mid: #CCCCCC;
        --text-light: #999999;
        --header-bg: #2D2D2D;
        --topbar-bg: #1A1A1A;
    }
}
*/