/* ======================================
   MOBILE RESPONSIVE STYLES
   Все стили для мобильной версии сайта
   ====================================== */

/* ======================================
   MOBILE LAYOUT
   ====================================== */

@media (max-width: 991px) {
    /* Container adjustments - 95% ширины экрана */
    .container-wide,
    .container {
        width: 95% !important;
        max-width: 95% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Section spacing */
    section {
        padding: 24px 0 !important;
        width: 90% !important;
        margin: 0 auto !important;
    }
    
    section.py-5 {
        padding: 16px 0 !important;
    }
}

/* ======================================
   MOBILE PROMO SLIDER (новая версия)
   ====================================== */

@media (max-width: 991px) {
    .mobile-promo-slider-container {
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 2.5% !important;
    }
    
    .mobile-promo-owl {
        position: relative !important;
    }
    
    .mobile-promo-item {
        width: 100% !important;
    }
    
    .mobile-promo-card {
        background: linear-gradient(135deg, #2549d8 0%, #1a3ba8 100%) !important;
        border-radius: 16px !important;
        padding: 24px 20px !important;
        min-height: 280px !important;
        height: 280px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .mobile-promo-content {
        width: 100% !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
        position: relative !important;
        z-index: 2 !important;
    }
    
    .mobile-promo-title {
        color: white !important;
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        margin: 0 !important;
        line-height: 1.3 !important;
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.8),
            -1px -1px 2px rgba(0, 0, 0, 0.5),
            1px -1px 2px rgba(0, 0, 0, 0.5),
            -1px 1px 2px rgba(0, 0, 0, 0.5),
            1px 1px 2px rgba(0, 0, 0, 0.5) !important;
        -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.3) !important;
    }
    
    .mobile-promo-description {
        color: white !important;
        font-size: 0.9rem !important;
        margin: 0 !important;
        line-height: 1.4 !important;
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.8),
            -1px -1px 2px rgba(0, 0, 0, 0.5),
            1px -1px 2px rgba(0, 0, 0, 0.5),
            -1px 1px 2px rgba(0, 0, 0, 0.5),
            1px 1px 2px rgba(0, 0, 0, 0.5) !important;
        font-weight: 500 !important;
    }
    
    .mobile-promo-discount {
        background: rgba(255, 255, 255, 0.25) !important;
        backdrop-filter: blur(10px) !important;
        color: white !important;
        font-size: 2rem !important;
        font-weight: 800 !important;
        padding: 8px 20px !important;
        border-radius: 12px !important;
        border: 3px solid rgba(255, 255, 255, 0.4) !important;
        box-shadow: 
            0 4px 16px rgba(0, 0, 0, 0.3),
            inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
        margin: 0 !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5) !important;
    }
    
    .mobile-promo-button {
        background: white !important;
        color: #2549d8 !important;
        padding: 10px 24px !important;
        border-radius: 10px !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        display: inline-block !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
        transition: all 0.3s ease !important;
        margin: 0 !important;
    }
    
    .mobile-promo-button:hover {
        background: #f8f9fa !important;
        transform: translateY(-2px) !important;
    }
    
    .mobile-promo-image {
        position: absolute !important;
        bottom: 0 !important;
        right: 0 !important;
        width: 200px !important;
        height: 200px !important;
        display: flex !important;
        align-items: flex-end !important;
        justify-content: flex-end !important;
        z-index: 1 !important;
        opacity: 0.85 !important;
    }
    
    .mobile-promo-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2)) !important;
    }
    
    /* Owl Carousel Navigation for Promo */
    .mobile-promo-owl .owl-nav button {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 40px !important;
        height: 40px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: none !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #2549d8 !important;
        font-size: 1rem !important;
        cursor: pointer !important;
        z-index: 10 !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    }
    
    .mobile-promo-owl .owl-nav button:hover {
        background: white !important;
    }
    
    .mobile-promo-owl .owl-nav button.owl-prev {
        left: 12px !important;
    }
    
    .mobile-promo-owl .owl-nav button.owl-next {
        right: 12px !important;
    }
    
    .mobile-promo-owl .owl-nav button i {
        margin: 0 !important;
    }
    
    /* Owl Carousel Dots for Promo */
    .mobile-promo-owl .owl-dots {
        position: absolute !important;
        bottom: 16px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        gap: 8px !important;
        z-index: 10 !important;
    }
    
    .mobile-promo-owl .owl-dot {
        width: 8px !important;
        height: 8px !important;
        background: rgba(255, 255, 255, 0.4) !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .mobile-promo-owl .owl-dot.active {
        background: white !important;
        width: 24px !important;
        border-radius: 4px !important;
    }
    
    .mobile-promo-owl .owl-dot span {
        display: none !important;
    }
}

/* ======================================
   MOBILE PRODUCTS SECTION
   ====================================== */

@media (max-width: 991px) {
    /* Products section - 95% ширины */
    .products-section,
    section[class*="product"],
    .products-carousel-section {
        width: 95% !important;
        margin: 0 auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Container inside carousel section */
    .products-carousel-section > div {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    /* Products section title */
    .section-title,
    h2.text-center {
        font-size: 1.5rem !important;
        margin-bottom: 20px !important;
    }
    
    /* Products grid */
    .products-grid,
    .row.g-4 {
        gap: 16px !important;
    }
    
    /* Product cards */
    .product-card {
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    /* Product image - 100% ширины с обрезкой по высоте */
    .product-image {
        width: 100% !important;
        height: 200px !important;
        max-height: 200px !important;
        background: #f8f9fa !important;
        display: block !important;
        overflow: hidden !important;
        position: relative !important;
    }
    
    .product-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    /* Product info - компактный стиль */
    .product-info {
        padding: 10px !important;
    }
    
    /* SKU и рейтинг - компактно */
    .product-sku {
        font-size: 0.7rem !important;
        margin-bottom: 4px !important;
    }
    
    .product-rating {
        margin-bottom: 6px !important;
    }
    
    .product-title {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
        margin-bottom: 8px !important;
        min-height: unset !important;
        max-height: unset !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    
    /* Цена и атрибуты в одну линию */
    .product-card .product-title {
        margin-bottom: 8px !important;
    }
    
    /* Цена - компактно */
    .product-card .product-price {
        display: inline-flex !important;
        flex-direction: column !important;
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        margin-bottom: 8px !important;
        margin-right: 10px !important;
        vertical-align: top !important;
    }
    
    /* Селектор единиц на одной линии с ценой */
    .product-card .unit-selector {
        display: inline-flex !important;
        gap: 4px !important;
        align-items: center !important;
        margin-bottom: 8px !important;
        vertical-align: top !important;
        flex-wrap: wrap !important;
    }
    
    .product-card .unit-btn {
        font-size: 0.7rem !important;
        padding: 3px 8px !important;
        white-space: nowrap !important;
    }
    
    /* Кнопка В корзину - компактнее */
    .product-card .add-to-cart-btn {
        width: 100% !important;
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
        margin-top: 6px !important;
    }
    
    /* Swiper products slider - 100% ширины внутри 95% контейнера */
    .swiper-container,
    .products-swiper {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    
    .swiper-wrapper {
        padding: 12px 0 !important;
        align-items: stretch !important;
    }
    
    .swiper-slide {
        width: 280px !important;
        max-width: 85% !important;
        height: auto !important;
    }
    
    /* Carousel product card */
    .carousel-product-card {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .swiper-button-prev,
    .swiper-button-next {
        width: 36px !important;
        height: 36px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 50% !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    .swiper-button-prev::after,
    .swiper-button-next::after {
        font-size: 14px !important;
        color: #2549d8 !important;
        font-weight: bold !important;
    }
    
    /* Pagination dots */
    .swiper-pagination {
        bottom: 10px !important;
    }
    
    .swiper-pagination-bullet {
        width: 8px !important;
        height: 8px !important;
        background: rgba(37, 73, 216, 0.3) !important;
        opacity: 1 !important;
    }
    
    .swiper-pagination-bullet-active {
        background: #2549d8 !important;
        width: 20px !important;
        border-radius: 4px !important;
    }
}

/* ======================================
   MOBILE CATEGORIES SECTION
   ====================================== */

@media (max-width: 991px) {
    /* Categories section - 95% ширины */
    .categories-section,
    section[class*="categor"] {
        width: 95% !important;
        margin: 0 auto !important;
    }
    
    /* Categories grid */
    .categories-grid,
    .category-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
    }
    
    /* Category card */
    .category-card {
        border-radius: 12px !important;
        padding: 16px !important;
        min-height: 120px !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    }
    
    .category-card:active {
        transform: scale(0.98);
    }
    
    .category-icon {
        font-size: 2rem !important;
        margin-bottom: 8px !important;
    }
    
    .category-name {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
    }
    
    .category-count {
        font-size: 0.75rem !important;
    }
}

/* ======================================
   MOBILE BRANDS SECTION
   ====================================== */

@media (max-width: 991px) {
    /* Brands section - 95% ширины */
    .brands-section,
    section[class*="brand"] {
        width: 95% !important;
        margin: 0 auto !important;
    }
    
    /* Brand slider */
    .brand-slider-container,
    .brand-slider-container-full {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .brand-slider {
        padding: 20px 0 !important;
        width: 100% !important;
    }
    
    .brand-item {
        padding: 12px !important;
        margin: 0 8px !important;
        min-width: 120px !important;
        border-radius: 12px !important;
    }
    
    .brand-logo {
        max-height: 40px !important;
    }
}

/* ======================================
   MOBILE PROMOTIONS SECTION
   ====================================== */

@media (max-width: 991px) {
    /* Promo section - 95% ширины */
    .promotions-section,
    section[class*="promo"],
    .sales-section,
    section[class*="sale"] {
        width: 95% !important;
        margin: 0 auto !important;
    }
    
    /* Promo banners */
    .promo-banner {
        border-radius: 12px !important;
        padding: 24px 20px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
    }
    
    .promo-banner h3 {
        font-size: 1.3rem !important;
    }
    
    .promo-banner p {
        font-size: 0.9rem !important;
    }
    
    /* Акции и хиты продаж - карточки */
    .promo-cards-container,
    .sales-cards-container {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 0 !important;
    }
    
    .promo-card-item,
    .sale-card-item {
        width: 100% !important;
        border-radius: 16px !important;
        overflow: hidden !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Блоки акций (actions-first, actions-half-card) */
    .actions-first {
        width: 100% !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        margin-bottom: 12px !important;
        padding: 16px !important;
        min-height: 180px !important;
    }
    
    .actions-half-card {
        width: 100% !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        padding: 16px !important;
        min-height: 200px !important;
    }
    
    .actions-title,
    .actions-half-title {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
        line-height: 1.2 !important;
    }
    
    .percent {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
    }
    
    .actions-half-badge {
        font-size: 1.2rem !important;
        font-weight: 700 !important;
    }
    
    /* Капсулы в акциях */
    .capsules {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
        margin-top: 8px !important;
    }
    
    .capsule {
        max-width: 80px !important;
        max-height: 80px !important;
    }
    
    .capsule img {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .actions-half-capsule {
        max-width: 100px !important;
        max-height: 100px !important;
        margin: 8px auto !important;
    }
    
    .actions-half-capsule img {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        max-height: 100px !important;
    }
    
    /* Действия в акциях - компактнее */
    .actions-left {
        margin-bottom: 8px !important;
    }
    
    /* ======================================
       MOBILE ACTIONS SLIDER
       ====================================== */
    
    .mobile-actions-slider-container {
        width: 95% !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }
    
    .mobile-actions-owl {
        position: relative !important;
    }
    
    .mobile-action-item {
        width: 100% !important;
    }
    
    .mobile-action-card {
        background: linear-gradient(135deg, #2549d8 0%, #1a3ba8 100%) !important;
        border-radius: 16px !important;
        padding: 24px 20px !important;
        min-height: 220px !important;
        height: 220px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    .mobile-action-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 20px !important;
    }
    
    .mobile-action-title {
        color: white !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    .mobile-action-badge {
        background: rgba(255, 255, 255, 0.2) !important;
        backdrop-filter: blur(10px) !important;
        color: white !important;
        font-size: 1.8rem !important;
        font-weight: 800 !important;
        padding: 8px 16px !important;
        border-radius: 12px !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
    }
    
    .mobile-action-products {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        flex-wrap: wrap !important;
    }
    
    .mobile-action-products img {
        width: 80px !important;
        height: 80px !important;
        object-fit: contain !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 12px !important;
        padding: 8px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    
    .mobile-action-products.single img {
        width: 120px !important;
        height: 120px !important;
    }
    
    /* Owl Carousel Navigation for Actions */
    .mobile-actions-owl .owl-nav button {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 36px !important;
        height: 36px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: none !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #2549d8 !important;
        font-size: 0.9rem !important;
        cursor: pointer !important;
        z-index: 10 !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    }
    
    .mobile-actions-owl .owl-nav button:hover {
        background: white !important;
    }
    
    .mobile-actions-owl .owl-nav button.owl-prev {
        left: 12px !important;
    }
    
    .mobile-actions-owl .owl-nav button.owl-next {
        right: 12px !important;
    }
    
    .mobile-actions-owl .owl-nav button i {
        margin: 0 !important;
    }
    
    /* Owl Carousel Dots for Actions */
    .mobile-actions-owl .owl-dots {
        position: absolute !important;
        bottom: 16px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        gap: 8px !important;
        z-index: 10 !important;
    }
    
    .mobile-actions-owl .owl-dot {
        width: 8px !important;
        height: 8px !important;
        background: rgba(255, 255, 255, 0.4) !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .mobile-actions-owl .owl-dot.active {
        background: white !important;
        width: 24px !important;
        border-radius: 4px !important;
    }
    
    .mobile-actions-owl .owl-dot span {
        display: none !important;
    }
}

/* ======================================
   MOBILE FOOTER
   ====================================== */

@media (max-width: 991px) {
    .footer {
        padding: 32px 16px !important;
    }
    
    .footer-content {
        flex-direction: column !important;
        gap: 24px !important;
    }
    
    .footer-section {
        width: 100% !important;
        text-align: center !important;
    }
    
    .footer-left {
        margin-bottom: 20px !important;
    }
    
    .contact-info {
        text-align: center !important;
    }
    
    .footer-bottom {
        margin-top: 24px !important;
        padding-top: 20px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .footer-bottom .row {
        flex-direction: column !important;
        gap: 12px !important;
        text-align: center !important;
    }
    
    .footer-bottom .col-md-4 {
        text-align: center !important;
    }
}

/* ======================================
   MOBILE BUTTONS & FORMS
   ====================================== */

@media (max-width: 991px) {
    /* Buttons */
    .btn {
        padding: 12px 24px !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
    }
    
    .btn-lg {
        padding: 14px 28px !important;
        font-size: 1rem !important;
    }
    
    .btn-sm {
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
    }
    
    /* Forms */
    .form-control {
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
        border-radius: 10px !important;
    }
    
    .form-label {
        font-size: 0.9rem !important;
        margin-bottom: 8px !important;
    }
}

/* ======================================
   MOBILE CARDS & MODALS
   ====================================== */

@media (max-width: 991px) {
    /* Cards */
    .card {
        border-radius: 12px !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    }
    
    .card-body {
        padding: 16px !important;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 16px !important;
    }
    
    .modal-content {
        border-radius: 16px !important;
    }
    
    .modal-header,
    .modal-footer {
        padding: 16px !important;
    }
    
    .modal-body {
        padding: 20px 16px !important;
    }
}

/* ======================================
   MOBILE HOME PAGE SPECIFIC BLOCKS
   ====================================== */

@media (max-width: 991px) {
    /* Блок "Сеть магазинов" и подобные */
    .info-block,
    .stores-block,
    .services-block {
        width: 95% !important;
        margin: 24px auto !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }
    
    /* Специальные предложения */
    .special-offers-section {
        width: 95% !important;
        margin: 24px auto !important;
    }
    
    /* Все основные контейнеры главной страницы */
    .main-content > section,
    .home-section,
    .page-section {
        width: 95% !important;
        max-width: 95% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Карточки в блоках акций */
    .action-card,
    .discount-card {
        width: 100% !important;
        border-radius: 16px !important;
        overflow: hidden !important;
        margin-bottom: 16px !important;
    }
}

/* ======================================
   MOBILE UTILITIES
   ====================================== */

@media (max-width: 991px) {
    /* Text utilities */
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    h4 {
        font-size: 1.1rem !important;
    }
    
    h5 {
        font-size: 1rem !important;
    }
    
    h6 {
        font-size: 0.9rem !important;
    }
    
    /* Spacing utilities */
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* ======================================
   MOBILE TOUCH IMPROVEMENTS
   ====================================== */

@media (max-width: 991px) {
    /* Увеличиваем области нажатия */
    a, button, .btn, .clickable {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Убираем hover эффекты на touch устройствах */
    @media (hover: none) {
        a:hover,
        button:hover,
        .btn:hover {
            transform: none;
        }
        
        a:active,
        button:active,
        .btn:active {
            transform: scale(0.98);
        }
    }
    
    /* Плавная прокрутка */
    html {
        scroll-behavior: smooth;
    }
    
    /* Убираем outline на touch устройствах */
    *:focus {
        outline: none;
    }
    
    /* Предотвращаем зум при фокусе на input */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

