@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');

@media (min-width: 481px) and (max-width: 1279px) {
    
    /* ================================
        TYPOGRAPHY TABLET
        ================================ */
    h1 { font-size: 60px; }
    h2 { font-size: 32px; }
    h3 { font-size: 28px; }
    h4 { font-size: 24px; }
    h5 { font-size: 20px; }
    .body1 { font-size: 18px; }
    .body2 { font-size: 16px; }
    .body3 { font-size: 14px; }
    .body4 { font-size: 12px; }

    /* ================================
        BUTTONS TABLET
        ================================ */
    .button-black,
    .button-white {
        border-radius: 6px;
        padding: 10px 22px;
        gap: 6px;
    }
    
    .button-black p,
    .button-white p {
        font-size: 16px;
        font-weight: 500;
        line-height: 135%;
    }
    
    .button-black img,
    .button-white img {
        width: 20px;
        height: 20px;
    }

    .button-clear {
        border-radius: 6px;
        padding: 10px 0px;
        gap: 6px;
    }

    .button-clear p {
        font-size: 16px;
        font-weight: 500;
        line-height: 135%;
    }
    
    .button-clear img {
        width: 20px;
        height: 20px;
    }

    .button-border {
        border-radius: 6px;
        padding: 10px 22px;
        gap: 6px;
    }
    
    .button-border p {
        font-size: 16px;
        font-weight: 500;
        line-height: 135%;
    }

    /* ================================
        HEADER & NAVIGATION TABLET
        ================================ */
    .top-bar {
        display: none;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .burger-btn {
        display: block;
    }

    .header-icons-and-burger {
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }
    
    .main-header img {
        margin: 0;
        height: 28px;
    }
    
    .header-icons {
        padding-right: 20px;
    }
    
    .mobile-nav a {
        font-size: 18px;
        padding: 18px 0;
    }

    .search-container {
        padding: 20px;
    }
    
    .search-input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .search-submit-btn {
        padding: 14px 16px;
    }
    
    .search-submit-btn img {
        width: 20px;
        height: 20px;
    }
    
    .search-close-btn {
        width: 44px;
        height: 44px;
    }
    
    .search-close-btn img {
        width: 20px;
        height: 20px;
    }

    /* ================================
        CATALOG TABLET
        ================================ */
    .catalog-content {
        flex-direction: column;
        gap: 20px;
    }

    /* Скрываем боковые фильтры */
    .sidebar-filters {
        display: none;
    }

    /* Показываем catalog-controls на планшетах */
    .catalog-controls {
        display: flex !important;
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        margin-bottom: 20px;
    }
    
    .sort-dropdown {
        width: 100%;
    }
    
    .sort-btn {
        width: 100%;
        font-size: 14px;
        padding: 10px 16px;
        justify-content: space-between;
    }
    
    .sort-option {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .catalog-filter-pills {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    .catalog-filter-pills::-webkit-scrollbar {
        display: none;
    }
    
    .catalog-filter-pills .filter-pill {
        padding: 8px 16px;
        font-size: 14px;
        flex-shrink: 0;
        white-space: nowrap;
        min-width: max-content;
    }

    /* Показываем adaptive-filters на планшетах */
    .adaptive-filters {
        display: block !important;
        margin-bottom: 24px;
        overflow: visible !important; /* Позволяем выпадающим элементам выходить за пределы */
    }
    
    .adaptive-filters-scroll {
        display: flex;
        flex-wrap: wrap; 
        gap: 12px;
        overflow-x: auto;
        overflow-y: visible !important; /* Позволяем выпадающим элементам выходить вниз */
        padding: 4px 0 12px 0;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .adaptive-filters-scroll::-webkit-scrollbar {
        display: none;
    }
    
    .adaptive-filter-group {
        position: relative;
        flex-shrink: 0;
    }
    
    .adaptive-filter-pill {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        background: white;
        border: 1px solid #D6D6D6;
        border-radius: 50px;
        color: #808080;
        font-size: 14px;
        font-weight: 400;
        cursor: pointer;
        transition: all 0.3s ease;
        white-space: nowrap;
        min-width: max-content;
    }
    
    .adaptive-filter-pill:hover {
        border-color: #CDA769;
        color: #CDA769;
        background-color: rgba(205, 167, 105, 0.1);
    }
    
    .adaptive-filter-pill.active {
        background: #CDA769;
        color: #FFFFFF;
        border-color: #CDA769;
    }
    
    .adaptive-filter-pill svg {
        transition: transform 0.3s ease;
    }
    
    .adaptive-filter-pill.active svg {
        transform: rotate(180deg);
    }
    
    .adaptive-filter-dropdown {
        position: fixed; /* Изменяем на fixed для позиционирования относительно окна */
        top: auto; /* Будет рассчитываться через JavaScript */
        left: auto; /* Будет рассчитываться через JavaScript */
        background: white;
        border: 1px solid #D6D6D6;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 10000 !important; /* Максимальный z-index */
        min-width: 200px;
        max-height: 250px;
        overflow-y: auto;
        display: none;
        margin-top: 8px;
    }
    
    .adaptive-filter-dropdown.show {
        display: block;
    }
    
    .adaptive-filter-option {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        cursor: pointer;
        border-bottom: 1px solid #F0F0F0;
        transition: background-color 0.2s ease;
    }
    
    .adaptive-filter-option:last-child {
        border-bottom: none;
    }
    
    .adaptive-filter-option:hover {
        background-color: #F9F9F9;
    }
    
    .adaptive-filter-option input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin-right: 12px;
        cursor: pointer;
        accent-color: #CDA769;
    }
    
    .adaptive-filter-option span {
        font-size: 14px;
        color: #333;
        cursor: pointer;
    }
    
    .adaptive-filter-option input[type="checkbox"]:checked + span {
        color: #CDA769;
        font-weight: 500;
    }
    
    /* Специальные стили для фильтра цены */
    .adaptive-price-filter {
        min-width: 220px;
        padding: 16px;
    }
    
    .adaptive-price-inputs {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .adaptive-price-inputs input {
        flex: 1;
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
        text-align: center;
    }
    
    .adaptive-price-separator {
        color: #666;
        font-size: 14px;
    }
    
    .adaptive-price-range {
        display: flex;
        gap: 8px;
        align-items: center;
    }
    
    .adaptive-price-range input[type="range"] {
        flex: 1;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        outline: none;
        appearance: none;
    }
    
    .adaptive-price-range input[type="range"]::-webkit-slider-thumb {
        appearance: none;
        width: 16px;
        height: 16px;
        background: #CDA769;
        border-radius: 50%;
        cursor: pointer;
    }
    
    .adaptive-price-range input[type="range"]::-moz-range-thumb {
        width: 16px;
        height: 16px;
        background: #CDA769;
        border-radius: 50%;
        cursor: pointer;
        border: none;
    }

    .product-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .catalog-header h2 {
        font-size: 24px;
        margin-bottom: 16px;
    }

    /* ================================
        HOME PAGE TABLET
        ================================ */
    .breadcrumbs-margin {
        margin: 112px 0 32px 0;
    }

    .product-filters {
        gap: 8px !important;
        margin-bottom: 24px !important;
    }
    
    .product-filters p {
        font-size: 14px;
    }
    
    .product-filters .filter-pill {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
    
    .empty-products {
        font-size: 16px;
        padding: 40px 20px;
    }

    

    .main-screen {
        height: calc(100vh - 80px);
        margin: 80px 0 0 0;
    }

    .advantages {
        flex-wrap: wrap;
    }

    .product-filters {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: left;
        gap: 12px;
        flex-wrap: wrap;
    }

    .divider {
        margin: 75px 0;
    }

    /* ================================
        SERVICE BANNERS TABLET
        ================================ */
    .service-content1,
    .service-content2,
    .service-content3 {
        width: calc(50% - 32px);
        z-index: 2;
        padding-left: 32px;
    }
    
    .service-content1 h2,
    .service-content2 h2,
    .service-content3 h2 {
        margin-bottom: 24px;
    }
    
    .service-content1 button,
    .service-content2 button,
    .service-content3 button {
        margin-top: 24px;
    }

    .service-image2 img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    /* ================================
        PRODUCTS & BLOG TABLET
        ================================ */

    .product-item {
        margin-bottom: 12px;
    }

    .blog-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .blog-item {
        flex: 1 1 calc(33.33% - 8px);
        max-width: calc(33.33% - 8px);
        min-width: 100px;
    }

    /* ================================
        BLOG ARTICLE TABLET
    ================================ */
    .blog-article-hero {
        height: 300px;
        margin-bottom: 32px;
    }

    .blog-article-header {
        margin-bottom: 40px;
    }

    .blog-article-main {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 75px;
    }

    .blog-article-sidebar {
        flex-direction: row;
        gap: 16px;
    }

    .sidebar-banner {
        flex: 1;
        padding: 20px;
    }

    .other-articles {
        margin-bottom: 75px;
    }

    .other-articles-header {
        margin-bottom: 40px;
    }

    .other-articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .article-card img {
        height: 160px;
    }
    

    /* ================================
        PRODUCT PAGE TABLET
        ================================ */
    .product-page {
        flex-direction: column;
        margin-top: 40px;
    }
    .product-gallery {
        max-width: 100%;
    }
    .product-info-detailed {
        max-width: 100%;
    }
    .product-actions {
        margin-bottom: auto;
        justify-content: flex-start;
    }

    .product-price #current-price {
        font-size: 28px;
    }

    /* ================================
        DELIVERY PAGE TABLET
        ================================ */
    .delivery-content-header {
        margin-bottom: 40px;
    }

    .delivery-content {
        gap: 40px;
    }

    .delivery-content-item1,
    .delivery-content-item2 {
        flex: 1;
    }

    .payment-options {
        gap: 16px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .payment-option {
        gap: 12px;
        width: 100%;
    }

    .payment-content h4 {
        font-size: 20px;
    }

    .payment-content p {
        font-size: 14px;
    }

    /* ================================
        SERVICES PAGE TABLET
        ================================ */
    .opt-about {
        gap: 40px;
    }

    .opt-about-item1,
    .opt-about-item2 {
        flex: 1;
    }

    .main-screen-services {
        height: calc(50vh - 100px);
        margin: 80px 0 50px 0;
    }
    .content-main-screen-services {
        padding: 0 24px;
        box-sizing: border-box;
    }

    .content-main-screen-services h1 {
        font-size: 60px;
    }

    .services-about-header {
        margin-bottom: 40px;
        width: 100%;
    }

    .services-about-content {
        gap: 20px;
    }

    .services-about-content-item2 img {
        display: none;
    }

    .about-item-left {
        flex: 1;
        text-align: left;
    }

    .services-masters-price {
        flex-direction: column;
        gap: 24px;
    }

    .services-about h5 {
        font-size: 20px;
    }

    .services-about-content-item2 img {
        width: 100%;
    }

    .services-masters {
        margin: 75px 0;
        gap: 0;
    }

    .services-masters-header {
        margin-bottom: 40px;
    }

    .services-steps-header {
        margin-bottom: 40px;
    }


    .services-steps-content { 
        display: flex !important;
        flex-direction: row !important;
        gap: 24px !important;
        width: 100% !important;
        align-items: stretch !important;
    }

    .services-steps-content p {
        font-size: 14px;
    }

    .services-masters-cards {
        gap: 24px;
    }

    .services-masters-card1,
    .services-masters-card2 {
        flex: 1;
    }

    .service-banner4 {
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        display: flex;
        align-items: center;
        margin: 75px 0;
        gap: 24px;
    }

    .service-banner4-form {
        max-width: calc(50% - 12px);
    }

    .service-banner4-content {
        display: flex;
        flex-direction: column;
    }

    /* MODALS STYLES TABLET */
    .booking-modal-content {
        max-width: 520px;
        padding: 32px;
    }
    
    .booking-form .form-group {
        margin-bottom: 20px;
    }
    
    .booking-form label {
        font-size: 15px;
    }
    
    .booking-form .checkbox-group {
        margin-bottom: 28px;
        font-size: 13px;
    }

    /*MASTER DETAIL MODAL TABLET*/
    .master-detail-modal-content {
        max-width: 700px;
    }
    
    .master-detail-content {
        padding: 32px;
    }
    
    .master-detail-header {
        gap: 20px;
        margin-bottom: 28px;
    }
    
    .master-detail-header img {
        width: 100px;
        height: 100px;
    }
    
    .master-title h2 {
        font-size: 28px;
    }




    /* ================================
        404 PAGE TABLET
        ================================ */
    .content-main-screen-404 h3 {
        font-size: 28px;
    }

    .content-main-screen-404 h4 {
        font-size: 24px;
    }

    /* ================================
        MODALS TABLET
        ================================ */
    .favorites-modal-content,
    .cart-modal-content {
        width: 90%;
        max-width: 600px;
        max-height: 90vh;
    }

    .favorites-footer,
    .cart-footer {
        padding: 20px 0 0 0;
        gap: 0;
    }

    .cart-total, .favorites-total {
        margin-bottom: 20px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 12px;
        padding: 24px;
        box-sizing: border-box;
    }

    .favorites-total-left p,
    .cart-total-left p {
        font-size: 16px;
    }

    .cart-total-price, .favorites-total-price {
        font-size: 20px;
        justify-content: center;
    }

    .favorites-total-price h3,
    .cart-total-price h3 {
        font-size: 20px;
    }

    .cart-buttons,
    .favorites-buttons {
        gap: 12px;
    }

    .favorite-item,
    .cart-item {
        padding: 16px;
        border-radius: 8px;
        gap: 12px;
    }

    .favorite-item img, .cart-item img {
        width: 80px;
        height: 80px;
    }

    .favorite-item-info h5,
    .cart-item-info h5 {
        font-size: 16px;
    }

    .favorite-item-price,
    .cart-item-price {
        font-size: 16px;
    }

    .favorite-item button p {
        font-size: 14px;
    }

    .favorite-item-price-quantity,
    .cart-item-price-quantity {
        gap: 12px;
    }

    .remove-from-favorites,
    .remove-from-cart {
        padding: 8px;
    }

    .remove-from-favorites img,
    .remove-from-cart img {
        width: 16px;
        height: 16px;
    }

    .recommendation-item-price {
        font-size: 16px;
    }

    .recommendation-item {
        gap: 12px;
    }

    .recommendation-item img {
        width: 80px;
        height: 80px;
    }

    .recommendation-item-info {
        gap: 8px;
    }

    .recommendation-item-actions {
        gap: 8px;
    }

    .recommendation-item-actions button p{
        font-size: 14px;
    }

    /* ================================
        FOOTER TABLET
        ================================ */
    .adress-container {
        margin-top: 75px;
    }

    .adress-header {
        margin-bottom: 40px;
    }

    .contact-info {
        gap: 16px;
        flex-direction: column;
    }

    .contact-container {
        margin: 75px 0;
    }

    .contact-header h2 {
        margin-bottom: 40px;
    }

    .contact-header h3 {
        font-size: 28px;
    }

    .footer-bottom {
        margin-top: 75px;
    }

    .footer-bottom-content {
        gap: 40px;
    }

    .footer-content-chapter1 {
        flex-shrink: 0;
    }

    .footer-content-chapter1 img {
        height: 32px;
    }

    .footer-links-container {
        gap: 24px;
        margin-bottom: 40px;
        flex-wrap: wrap;
    }

    .footer-links-container h5 {
        font-size: 16px;
    }

    .footer-legal-info {
        gap: 16px;
    }

    .footer-legal-links {
        gap: 16px;
    }

    .filter-title {
        font-size: 18px;
    }

    .filter-label {
        font-size: 14px;
    }

    .price-inputs input {
        font-size: 14px;
    }

    /* ================================
        NOTIFICATIONS TABLET
        ================================ */
    #notification-container {
        top: 100px;
        right: 20px;
        max-width: 300px;
    }

    .notification {
        padding: 12px 16px;
        border-radius: 8px;
        margin-bottom: 8px;
        font-size: 14px;
    }

    .notification-icon {
        width: 20px;
        height: 20px;
    }

    .notification-title {
        font-size: 14px;
    }

    .notification-message {
        font-size: 12px;
    }

    .notification-close {
        width: 20px;
        height: 20px;
        top: 8px;
        right: 8px;
    }

    /* ================================
    CHECKOUT PAGE TABLET
    ================================ */

    .checkout-content {
        flex-direction: column;
        gap: 40px;
    }

    .checkout-form-section {
        max-width: 100%;
        width: 100%;
    }

    .checkout-summary {
        width: 100%;
        box-sizing: border-box;
    }

    .checkout-form-section h2 {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .checkout-form-section h3 {
        font-size: 22px;
        margin: 32px 0 20px 0;
    }

    .checkout-summary h3 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .form-row {
        gap: 16px;
    }

    .form-group input,
    .form-group select {
        padding: 10px 14px;
        font-size: 14px;
    }

    .delivery-option label,
    .payment-option label {
        padding: 16px;
    }

    .delivery-option-content h4,
    .payment-content h4 {
        font-size: 14px;
    }

    .delivery-option-content p {
        font-size: 13px;
    }

    .payment-row {
        flex-direction: column;
        gap: 12px;
        width: calc(50% - 8px);
    }

    .payment-option label {
        height: 70px;
    }

    .checkout-item {
        padding: 14px;
    }

    .checkout-item-info h5 {
        font-size: 14px;
    }

    .checkout-item-info p {
        font-size: 12px;
    }

    .checkout-item-price {
        font-size: 16px;
    }

    .checkout-item-quantity button {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .checkout-item-quantity span {
        font-size: 14px;
        min-width: 28px;
    }

    .total-row {
        font-size: 14px;
    }

    .total-final {
        font-size: 18px;
    }

    .privacy-notice {
        font-size: 11px;
    }
}

@media (max-width: 640px) and (min-width: 481px) {
    .favorites-total, .cart-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cart-buttons, 
    .favorites-buttons {
        flex-direction: column;
        width: 100%;
    }

    .favorites-total-price,
    .cart-total-price {
        width: 100%;
    }

    
}

@media (max-width: 780px) and (min-width: 481px) {
    .services-masters-cards {
        flex-direction: column;
    }

    .services-masters-card1 {
        width: 100%;
        box-sizing: border-box;
    }

    .services-masters-card2 {
        width: 100%;
        box-sizing: border-box;
    }

    .service-banner4 {
        flex-direction: column;
    }

    .service-banner4 {
        padding: 48px;
        box-sizing: border-box;
        align-items: center;
        gap: 0;
    }

    .service-banner4-content {
        margin-left: 0;
        text-align: center;
        align-items: center;
        margin-bottom: 48px;
        padding: 0 24px;
        box-sizing: border-box;
    }

    .service-banner4-form {
        max-width: 100%;
        margin: auto;
    }
    .services-steps-content-item1, 
    .services-steps-content-item2, 
    .services-steps-content-item3, 
    .services-steps-content-item4, 
    .services-steps-content-item5, 
    .services-steps-content-item6 {
        flex: 1 1 calc(50% - 12px) !important;
    }
    
}

    /* Убираем отступы catalog-container на мобильных */
    .sidebar-filters {
        display: none;
    }

    .sort-options {
        z-index: 9999 !important;
    }

