/* ========================================
   LUMIERE — Адаптивные стили
   Профессиональный мобильный дизайн
   ======================================== */


/* ========== до 1200px — ноутбуки ========== */

@media (max-width: 1200px) {
    .hero {
        gap: 4vh;
        padding: 0 40px;
    }

    .hero_content h1 {
        font-size: 46px;
    }

    .hero_img img {
        width: 440px;
        height: 380px;
    }

    .nav {
        width: auto;
        gap: 4px;
    }

    .catalog_grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 0 40px 64px;
    }

    .catalog_card {
        width: 100%;
    }

    .product_detail {
        gap: 40px;
    }

    .product_img img {
        width: 100%;
        height: 400px;
    }

    .footer_content {
        gap: 60px;
        padding: 0 40px 40px;
    }
}


/* ========== до 768px — планшеты и мобильные ========== */

@media (max-width: 768px) {

    /* --- ШАПКА --- */
    .header {
        height: 56px;
        padding: 0 16px;
        justify-content: space-between;
    }

    .main {
        margin-top: 56px;
    }

    .logo {
        font-size: 18px;
    }

    .nav {
        width: auto;
        gap: 2px;
    }

    .nav a {
        padding: 8px 10px;
        font-size: 22px;
        border-radius: 10px;
    }

    .nav .catalog {
        display: none;
    }

    .admin_link {
        font-size: 11px !important;
        padding: 6px 10px !important;
    }

    /* Бейдж корзины — пропорционален иконке 22px */
    .cart_badge {
        width: 16px;
        height: 16px;
        font-size: 9px;
        top: 2px;
        right: 2px;
    }


    /* --- ГЕРОЙ --- */
    .hero {
        flex-direction: column;
        min-height: auto;
        padding: 80px 20px 40px;
        gap: 28px;
    }

    .hero_content {
        text-align: center;
    }

    .hero_content span {
        font-size: 10px;
        padding: 5px 14px;
    }

    .hero_content h1 {
        font-size: 32px;
    }

    .hero_content p {
        font-size: 14px;
    }

    .hero_actions {
        justify-content: center;
    }

    .hero_catalog,
    .hero_about {
        padding: 14px 28px;
        font-size: 13px;
        width: 100%;
        text-align: center;
    }

    .hero_img img {
        width: 100%;
        max-width: 400px;
        height: auto;
        aspect-ratio: 4/3;
        margin: 0 auto;
        border-radius: 16px;
    }


    /* --- БЕГУЩАЯ СТРОКА --- */
    .marquee {
        padding: 14px;
    }

    .marquee_track {
        font-size: 11px;
        gap: 12px;
    }


    /* --- СЕКЦИИ ГЛАВНОЙ --- */
    .categories,
    .popular_jewelry,
    .new_jewelry {
        padding: 40px 16px;
    }

    .categories h2,
    .popular_jewelry h2,
    .new_jewelry h2,
    .why_us h2,
    .cart_section h2,
    .catalog_header h2,
    .checkout_section h2,
    .admin_container h2,
    .profile_container h2 {
        font-size: 26px;
        margin-bottom: 24px;
    }


    /* --- КАТЕГОРИИ: сетка 2×2 --- */
    .categories_grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category_card {
        width: 100%;
    }

    .category_card img {
        width: 100%;
        height: 180px;
    }

    .category_card h3 {
        font-size: 16px;
        padding: 10px 0;
    }


    /* --- КАРТОЧКИ ТОВАРОВ: сетка 2 колонки --- */
    .popular_grid,
    .new_grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .popular_card,
    .new_card,
    .catalog_card {
        width: 100%;
        height: auto;
    }

    .popular_card img,
    .new_card img,
    .catalog_card img {
        width: 100%;
        height: 180px;
    }

    .popular_card h3,
    .new_card h3,
    .catalog_card h3 {
        font-size: 14px;
        margin: 10px 12px;
    }

    .card_footer,
    .new_card_footer {
        padding: 10px 12px;
        font-size: 16px;
    }

    .card_footer button,
    .new_card_footer button {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .divider span {
        margin: 0 30px;
        font-size: 20px;
    }


    /* --- ПОЧЕМУ МЫ --- */
    .why_us {
        padding: 40px 16px;
    }

    .why_us_cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .why_us_card {
        width: 100%;
        height: auto;
        padding: 20px 16px;
        text-align: center;
        flex-direction: column;
    }

    .why_us_card span {
        font-size: 28px;
        margin-top: 0;
    }

    .why_us_card h3 {
        font-size: 15px;
    }

    .why_us_card p {
        font-size: 12px;
        text-align: center;
        margin: 0;
    }


    /* --- СКИДКА --- */
    .discount {
        height: auto;
        padding: 40px 20px;
    }

    .discount_content h2 {
        font-size: 24px;
        text-align: center;
    }

    .discount_content p {
        font-size: 13px;
        text-align: center;
    }

    .discount_content span {
        font-size: 10px;
    }

    .discount_content button,
    .discount_content a {
        padding: 14px 28px;
        font-size: 13px;
    }


    /* --- КАТАЛОГ --- */
    .catalog_header {
        height: auto;
        padding: 28px 16px 16px;
    }

    .catalog_filters {
        gap: 6px;
    }

    .catalog_filters button {
        padding: 8px 14px;
        font-size: 12px;
    }

    .catalog_sort select {
        font-size: 12px;
        padding: 8px 12px;
    }

    .catalog_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 16px 40px;
    }


    /* --- ТОВАР --- */
    .product {
        padding: 16px;
    }

    .product .back_btn {
        font-size: 13px;
        padding: 8px 10px;
        margin-bottom: 12px;
    }

    .product_detail {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .product_img img {
        width: 100%;
        height: auto;
        aspect-ratio: 4/3;
        border-radius: 16px;
    }

    .product_name {
        font-size: 26px;
    }

    .product_price {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .product_description {
        font-size: 14px;
    }

    .product_actions {
        flex-direction: column;
    }

    .basket_btn {
        width: 100%;
        text-align: center;
    }

    .size_choice_btn {
        width: 44px;
        height: 44px;
        font-size: 13px;
    }


    /* --- КОРЗИНА --- */
    .cart_section {
        padding: 28px 16px 40px;
    }

    .cart_item {
        flex-direction: row;
        padding: 14px;
        gap: 14px;
    }

    .cart_item_image {
        width: 80px;
        height: 80px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .cart_item_name {
        font-size: 15px;
    }

    .cart_item_material {
        font-size: 12px;
    }

    .cart_item_price {
        font-size: 15px;
    }

    .cart_item_actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
        min-width: fit-content;
    }

    .cart_item_qty button {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .cart_item_qty span {
        font-size: 14px;
    }

    .cart_summary {
        padding: 20px;
    }

    .cart_summary_row_total {
        font-size: 17px;
    }

    .cart_summary_row_total span:last-child {
        font-size: 21px;
    }


    /* --- АВТОРИЗАЦИЯ --- */
    .auth_container {
        padding: 24px 16px;
    }

    .auth_card {
        padding: 28px 20px;
        border-radius: 18px;
    }

    .auth_card_icon {
        font-size: 32px;
    }


    /* --- ФОРМЫ --- */
    .form_group input,
    .form_group select,
    .form_group textarea {
        padding: 12px 14px;
        font-size: 14px;
    }

    .form_row {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 14px 24px;
        font-size: 13px;
    }


    /* --- ПРОФИЛЬ --- */
    .profile_container {
        padding: 28px 16px 40px;
    }

    .profile_card {
        padding: 28px 20px;
        border-radius: 18px;
    }

    .profile_avatar {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .profile_card h3 {
        font-size: 22px;
    }

    .order_card_header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }


    /* --- ОФОРМЛЕНИЕ ЗАКАЗА --- */
    .checkout_section {
        padding: 28px 16px 40px;
    }

    .checkout_grid {
        grid-template-columns: 1fr;
    }

    .checkout_aside {
        position: static;
    }

    .checkout_form {
        padding: 20px;
    }

    .checkout_summary {
        padding: 20px;
    }

    .payment_methods {
        grid-template-columns: 1fr 1fr;
    }

    .checkout_summary_item img {
        width: 44px;
        height: 44px;
    }


    /* --- АДМИН-ПАНЕЛЬ --- */
    .admin_container {
        padding: 28px 12px 40px;
    }

    .admin_stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .admin_stat {
        padding: 16px;
    }

    .admin_stat_value {
        font-size: 22px;
    }

    .admin_stat_label {
        font-size: 10px;
    }

    .admin_tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 0;
        -webkit-overflow-scrolling: touch;
    }

    .admin_tab {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 13px;
    }

    .admin_toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin_search {
        min-width: auto;
    }

    /* Карточный вид таблиц на мобильных */
    .admin_table_wrap {
        overflow-x: visible;
    }

    .admin_table {
        display: block;
        border: none;
        background: transparent;
        border-radius: 0;
    }

    .admin_table thead {
        display: none;
    }

    .admin_table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .admin_table tr {
        display: flex;
        flex-direction: column;
        background: #fff;
        border: 1px solid var(--c-border);
        border-radius: 14px;
        padding: 16px;
        gap: 10px;
    }

    .admin_table tr:hover td {
        background: transparent;
    }

    .admin_table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0;
        border-bottom: none;
        font-size: 14px;
        gap: 12px;
    }

    .admin_table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--c-muted);
        flex-shrink: 0;
        min-width: 80px;
    }

    .admin_table td[data-label=""]::before {
        display: none;
    }

    .admin_table td[data-label=""] {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid var(--c-border);
        margin-top: 2px;
    }

    .admin_table img {
        width: 56px;
        height: 56px;
        border-radius: 10px;
    }

    .admin_actions {
        gap: 8px;
    }

    .admin_actions button {
        padding: 8px 16px;
        font-size: 12px;
        border-radius: 10px;
    }

    .status_toggle {
        flex-wrap: wrap;
        gap: 4px;
    }

    .status_toggle_btn {
        font-size: 10px;
        padding: 5px 8px;
    }


    /* --- ПОДВАЛ --- */
    .footer {
        padding-top: 32px;
    }

    .footer_content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 28px;
        padding: 0 16px 28px;
    }

    .footer_column:first-child {
        max-width: 100%;
    }

    .footer_column h1 {
        font-size: 20px;
    }

    .footer_end {
        font-size: 12px;
        padding: 14px 0;
    }


    /* --- МОДАЛКА / ТОСТЫ --- */
    .modal {
        padding: 24px 16px;
        border-radius: 16px;
        max-width: 100%;
        margin: 0 8px;
    }

    .modal h3 {
        font-size: 20px;
    }

    .toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }

    .toast_item {
        text-align: center;
        font-size: 13px;
    }
}


/* ========== до 480px — маленькие мобильные ========== */

@media (max-width: 480px) {
    .header {
        height: 50px;
        padding: 0 12px;
    }

    .main {
        margin-top: 50px;
    }

    .logo {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .nav a {
        padding: 6px 8px;
        font-size: 20px;
    }

    /* Бейдж корзины — пропорционален иконке 20px */
    .cart_badge {
        width: 14px;
        height: 14px;
        font-size: 8px;
        top: 1px;
        right: 1px;
    }

    .hero {
        padding: 66px 16px 30px;
        gap: 20px;
    }

    .hero_content h1 {
        font-size: 26px;
    }

    .hero_content p {
        font-size: 13px;
    }

    .hero_catalog,
    .hero_about {
        padding: 12px 20px;
        font-size: 12px;
        border-radius: 12px;
    }

    .marquee {
        padding: 10px;
    }

    .marquee_track {
        font-size: 10px;
        gap: 8px;
    }

    .categories,
    .popular_jewelry,
    .new_jewelry {
        padding: 28px 12px;
    }

    .categories h2,
    .popular_jewelry h2,
    .new_jewelry h2,
    .why_us h2,
    .cart_section h2,
    .catalog_header h2,
    .checkout_section h2,
    .admin_container h2,
    .profile_container h2 {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .category_card img {
        height: 140px;
    }

    .category_card h3 {
        font-size: 14px;
        padding: 8px 0;
    }

    .popular_card img,
    .new_card img,
    .catalog_card img {
        height: 150px;
    }

    .popular_card h3,
    .new_card h3,
    .catalog_card h3 {
        font-size: 13px;
        margin: 8px 10px;
    }

    .card_footer,
    .new_card_footer {
        padding: 8px 10px;
        font-size: 14px;
    }

    .card_footer button,
    .new_card_footer button {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .divider span {
        margin: 0 20px;
        font-size: 16px;
    }

    .why_us {
        padding: 28px 12px;
    }

    .why_us_cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .why_us_card {
        flex-direction: row;
        text-align: left;
        gap: 14px;
        padding: 16px;
    }

    .why_us_card span {
        font-size: 24px;
        flex-shrink: 0;
    }

    .why_us_card h3 {
        font-size: 14px;
    }

    .why_us_card p {
        font-size: 11px;
        text-align: left;
    }

    .discount {
        padding: 32px 16px;
    }

    .discount_content h2 {
        font-size: 20px;
    }

    .discount_content p {
        font-size: 12px;
    }

    .catalog_header {
        padding: 20px 12px 12px;
    }

    .catalog_filters button {
        padding: 6px 10px;
        font-size: 11px;
    }

    .catalog_grid {
        gap: 10px;
        padding: 0 12px 24px;
    }

    .product {
        padding: 12px;
    }

    .product_name {
        font-size: 22px;
    }

    .product_price {
        font-size: 18px;
    }

    .product_description {
        font-size: 13px;
    }

    .basket_btn {
        padding: 13px 24px;
        font-size: 13px;
    }

    .cart_section {
        padding: 20px 12px 32px;
    }

    .cart_item_image {
        width: 70px;
        height: 70px;
    }

    .cart_item_name {
        font-size: 14px;
    }

    .cart_item_price {
        font-size: 14px;
    }

    .cart_summary {
        padding: 16px;
    }

    .auth_card {
        padding: 24px 16px;
        border-radius: 14px;
    }

    .form_group input,
    .form_group select,
    .form_group textarea {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 10px;
    }

    .form_group label {
        font-size: 11px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 12px;
        border-radius: 12px;
    }

    .profile_card {
        padding: 20px 14px;
        border-radius: 14px;
    }

    .profile_avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .profile_card h3 {
        font-size: 20px;
    }

    .checkout_form,
    .checkout_summary {
        padding: 16px;
        border-radius: 12px;
    }

    .checkout_form h3 {
        font-size: 18px;
    }

    .checkout_summary_item img {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .admin_container {
        padding: 20px 10px 32px;
    }

    .admin_stats {
        gap: 8px;
    }

    .admin_stat {
        padding: 12px;
    }

    .admin_stat_value {
        font-size: 18px;
    }

    .admin_table tr {
        padding: 12px;
        gap: 8px;
    }

    .admin_table td {
        font-size: 13px;
    }

    .admin_table td::before {
        font-size: 10px;
        min-width: 70px;
    }

    .admin_table img {
        width: 48px;
        height: 48px;
    }

    .modal {
        padding: 20px 14px;
        border-radius: 14px;
    }

    .modal h3 {
        font-size: 18px;
    }

    .modal_close {
        top: 10px;
        right: 12px;
        font-size: 22px;
    }

    .footer_column h1 {
        font-size: 18px;
    }

    .footer_column p,
    .footer_column ul li {
        font-size: 13px;
    }
}
