/* ===== ОСНОВНЫЕ ПЕРЕМЕННЫЕ ===== */
:root {
    --primary: #8b5cf6;
    --primary-light: #c4b5fd;
    --primary-dark: #6d4aff;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray-dark: #374151;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --light: #f9fafb;
    --white: #ffffff;
    
    --verified: #3b82f6;
    --neon-primary: rgba(139, 92, 246, 0.6);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-sm: 4px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===== ШАПКА ===== */
.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.header::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-light), var(--primary), var(--primary-light));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}
.header:hover {
    box-shadow: 0 0 20px var(--neon-primary);
}
.header:hover::before {
    opacity: 0.8;
    animation: neon-pulse 1.5s infinite;
}
@keyframes neon-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}
.logo:hover a {
    background-color: rgba(255, 255, 255, 0.1);
}
.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}
.logo:hover .logo-text {
    text-shadow: 0 0 20px var(--neon-primary), 0 0 30px var(--neon-primary);
    color: var(--primary-light);
    transform: scale(1.05);
}

.header-slogan {
    display: flex;
    align-items: center;
    margin-left: 2px;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
    text-shadow: 0 0 5px var(--neon-primary), 0 0 10px var(--neon-primary);
    transition: text-shadow 0.2s;
}
.header-slogan:hover {
    text-shadow: 0 0 10px var(--neon-primary), 0 0 20px var(--neon-primary), 0 0 30px var(--neon-primary);
}
.header-slogan-text {
    font-weight: 700;
    color: white;
}
@media (max-width: 992px) {
    .header-slogan { display: none; }
}

.nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
}
.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.nav a:hover {
    color: var(--primary-dark);
    background-color: white;
    box-shadow: 0 0 15px white;
}
.nav .active {
    color: var(--primary-dark);
    background-color: white;
    font-weight: 600;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: white;
    transition: all 0.2s ease;
    border-radius: 50%;
    position: relative;
}
.icon-link:hover {
    color: var(--primary-light);
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.1);
}
.icon {
    width: 24px;
    height: 24px;
    display: block;
}
.cart-link { position: relative; }
.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    z-index: 2;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}
.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 0 15px var(--neon-primary);
}
.btn-secondary {
    background-color: var(--white);
    color: var(--gray-dark);
    border: 1px solid var(--gray-light);
}
.btn-secondary:hover {
    background-color: var(--gray-light);
    box-shadow: 0 0 10px var(--gray-light);
}
.btn-success {
    background-color: var(--secondary);
    color: white;
}
.btn-success:hover {
    background-color: #059669;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}
.btn-danger {
    background-color: var(--danger);
    color: white;
}
.btn-danger:hover {
    background-color: #dc2626;
}
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.1rem; }

/* ===== ФИЛЬТРЫ ===== */
.filter-form {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-light);
}
.filter-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.filter-group {
    flex: 1 1 180px;
}
.filter-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    color: var(--gray-dark);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.filter-group input,
.filter-group select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}
.filter-group small {
    display: block;
    margin-top: 3px;
    color: var(--gray);
    font-size: 0.7rem;
}
.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    justify-content: flex-end;
}
.filter-actions .btn {
    padding: 6px 16px;
    font-size: 0.9rem;
}

/* ===== УПРАВЛЕНИЕ КОЛИЧЕСТВОМ ===== */
.per-page-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.per-page-control select {
    padding: 5px 10px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    background-color: var(--white);
}

/* ===== КАРТОЧКИ НОМЕРОВ ===== */
.numbers-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 20px 0;
}
.number-card {
    background: transparent;
    border: none;
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    transition: all 0.2s;
    border-bottom: 1px dashed rgba(139, 92, 246, 0.2);
}
.number-card:hover {
    background: rgba(139, 92, 246, 0.02);
}
.number-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    flex-wrap: wrap;
}
.number-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    min-width: 120px;
    transition: text-shadow 0.2s;
}
.number-card:hover .number-number { text-shadow: 0 0 8px var(--neon-primary); }
.number-price {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-dark);
    min-width: 80px;
    transition: text-shadow 0.2s;
}
.number-card:hover .number-price { text-shadow: 0 0 8px var(--neon-primary); }
.number-operator {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 70px;
}
.operator-logo {
    max-height: 20px;
    width: auto;
    transition: filter 0.2s;
}
.number-card:hover .operator-logo { filter: drop-shadow(0 0 6px var(--neon-primary)); }
.operator-name {
    font-weight: 400;
    color: var(--gray);
    font-size: 0.9rem;
}
.number-region {
    color: var(--gray);
    font-size: 0.9rem;
    min-width: 110px;
}
.number-seller {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 100px;
    font-size: 0.9rem;
}
.seller-gigafon {
    font-weight: 500;
    color: var(--primary);
}
.seller-dealer {
    font-weight: 500;
    color: var(--gray-dark);
}
.verified-badge {
    color: var(--verified);
    font-size: 1rem;
    margin-left: 3px;
}
.number-card:hover .seller-gigafon,
.number-card:hover .seller-dealer {
    text-shadow: 0 0 8px var(--neon-primary);
}
.card-actions {
    display: flex;
    gap: 8px;
    min-width: 160px;
    justify-content: flex-end;
    flex-shrink: 0;
}
.card-actions .btn {
    padding: 5px 12px;
    font-size: 0.85rem;
}

/* ===== КАРТОЧКИ ТАРИФОВ ===== */
.tariffs-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 20px 0;
}
.tariff-card {
    background: transparent;
    border: none;
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    transition: all 0.2s;
    border-bottom: 1px dashed rgba(139, 92, 246, 0.2);
}
.tariff-card:hover { background: rgba(139, 92, 246, 0.02); }
.tariff-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    flex-wrap: wrap;
}
.tariff-image-small {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.tariff-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s;
}
.tariff-card:hover .tariff-image-small img { filter: drop-shadow(0 0 6px var(--neon-primary)); }
.tariff-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    min-width: 120px;
}
.tariff-card:hover .tariff-name { text-shadow: 0 0 8px var(--neon-primary); }
.tariff-price {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-dark);
    min-width: 90px;
}
.tariff-card:hover .tariff-price { text-shadow: 0 0 8px var(--neon-primary); }
.tariff-operator {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 70px;
}
.tariff-operator .operator-logo { max-height: 20px; }
.tariff-card:hover .tariff-operator .operator-logo { filter: drop-shadow(0 0 6px var(--neon-primary)); }
.tariff-conditions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--gray-dark);
    font-size: 0.85rem;
}
.condition {
    background-color: transparent;
    color: var(--gray);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 400;
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.tariff-card:hover .condition {
    border-color: var(--neon-primary);
    color: var(--dark);
}
.tariff-region {
    color: var(--gray);
    font-size: 0.85rem;
    min-width: 100px;
}
.tariff-seller {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 100px;
    font-size: 0.85rem;
}
.tariff-card:hover .tariff-seller .seller-gigafon,
.tariff-card:hover .tariff-seller .seller-dealer {
    text-shadow: 0 0 8px var(--neon-primary);
}

/* ===== КНОПКА ПОКАЗАТЬ БОЛЬШЕ ===== */
.show-more {
    text-align: center;
    margin: 30px 0;
}
.show-more .btn { padding: 12px 30px; font-size: 1rem; }

/* ===== ПАГИНАЦИЯ ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 12px;
    background-color: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    color: var(--gray-dark);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.pagination a:hover {
    background-color: var(--primary-light);
    color: white;
    border-color: var(--primary);
}
.pagination .active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}
.pagination .disabled {
    color: var(--gray);
    pointer-events: none;
    opacity: 0.5;
}

/* ===== КАРУСЕЛЬ БАННЕРОВ ===== */
.banner-carousel-section {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--light) 0%, #f0f2f5 100%);
}
.banner-carousel-section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: var(--primary);
}
.carousel-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    padding: 0 40px;
}
.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    gap: 20px;
}
.carousel-slide {
    flex: 0 0 auto;
    width: 240px;
    height: 240px;
    list-style: none;
}
.carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}
.carousel-slide.feature-card {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 0;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}
.carousel-slide.feature-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-light), var(--primary), var(--primary-light));
    border-radius: calc(var(--radius) + 2px);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}
.carousel-slide.feature-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.4);
    border-color: var(--primary);
}
.carousel-slide.feature-card:hover::before {
    opacity: 1;
    animation: neon-pulse 1.5s infinite;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.banner-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.carousel-slide:hover .banner-title { opacity: 1; }
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--white);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-arrow:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--neon-primary);
    transform: translateY(-50%) scale(1.1);
}
.carousel-prev { left: 0; }
.carousel-next { right: 0; }

/* ===== ЗАГЛУШКА ДЛЯ БАННЕРОВ ===== */
.banner-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f2f5, #e0e4e8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 1rem;
    text-align: center;
    border-radius: var(--radius);
}
.banner-placeholder small { font-size: 0.8rem; margin-top: 5px; }

/* ===== КАРУСЕЛЬ ТАРИФОВ (ВЕРТИКАЛЬНЫЕ ФОТО) ===== */
.tariff-card.carousel-slide {
    width: 240px;
    height: 300px;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}
.tariff-card.carousel-slide::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-light), var(--primary), var(--primary-light));
    border-radius: calc(var(--radius) + 2px);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}
.tariff-card.carousel-slide:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.4);
    border-color: var(--primary);
}
.tariff-card.carousel-slide:hover::before {
    opacity: 1;
    animation: neon-pulse 1.5s infinite;
}
.tariff-card.carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}
.tariff-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tariff-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f2f5, #e0e4e8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 1rem;
    text-align: center;
    border-radius: var(--radius);
}
.tariff-placeholder small { font-size: 0.8rem; margin-top: 5px; }
.tariff-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.tariff-card.carousel-slide:hover .tariff-caption { opacity: 1; }

/* ===== БЛОК БЫСТРОГО ПОИСКА ===== */
.quick-search-section {
    padding: 40px 0;
    background: linear-gradient(135deg, var(--light) 0%, #f0f2f5 100%);
}
.mask-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}
.mask-def, .mask-number {
    display: flex;
    align-items: center;
    gap: 15px;
}
.mask-label {
    font-weight: 600;
    color: var(--gray-dark);
    font-size: 1rem;
}
.mask-def-boxes, .mask-number-boxes {
    display: flex;
    gap: 8px;
}
.mask-digit {
    width: 50px;
    height: 50px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
    background-color: var(--white);
    transition: all 0.2s;
    outline: none;
    box-shadow: 0 0 0 0 var(--neon-primary);
}
.mask-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--neon-primary);
}
.mask-digit:hover { border-color: var(--primary-light); }
.mask-hint {
    text-align: center;
    margin-top: 15px;
    color: var(--gray);
}
#mask-search-btn { padding: 12px 30px; font-size: 1rem; }

/* ===== ФОРМЫ АВТОРИЗАЦИИ ===== */
.auth-form {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 25px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.auth-form h1 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary);
    font-size: 2rem;
}
.auth-form .form-group { margin-bottom: 20px; }
.auth-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--gray-dark);
    font-size: 0.9rem;
}
.auth-form .form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background-color: var(--light);
    font-size: 1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 0 0 0 var(--neon-primary);
}
.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--neon-primary);
}
.auth-form .form-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
}
.auth-form .btn-primary { flex: 1; padding: 12px; font-size: 1rem; }
.auth-links { margin-top: 20px; text-align: center; color: var(--gray); }
.auth-links a {
    color: var(--primary);
    text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }

.btn-yandex-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: #fc3f1d;
    border-radius: var(--radius);
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(252, 63, 29, 0.3);
}
.btn-yandex-icon:hover {
    background-color: #d83212;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(252, 63, 29, 0.5);
}
.yandex-icon {
    font-family: Arial, sans-serif;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

/* ===== ФУТЕР ===== */
.footer {
    background-color: var(--dark);
    color: var(--gray-light);
    padding: 30px 0;
    margin-top: auto;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.footer-contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-light);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
}
.contact-link:hover { color: var(--primary-light); }
.contact-link .icon { width: 20px; height: 20px; }
.footer-copyright { text-align: center; font-size: 0.9rem; }
.footer-copyright a {
    color: var(--primary-light);
    text-decoration: none;
}
.footer-copyright a:hover { text-decoration: underline; }
@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .footer-contacts { justify-content: flex-start; }
}

/* ===== АДМИНКА ===== */
.admin-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.admin-header {
    background-color: var(--dark);
    color: white;
    padding: 10px 0;
    border-bottom: 1px solid var(--primary);
}
.admin-header .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-header .logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}
.admin-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}
.admin-nav a:hover { background-color: var(--primary); }
.admin-main { flex: 1; padding: 20px 0; }
.admin-footer {
    background-color: var(--dark);
    color: var(--gray-light);
    padding: 15px 0;
    text-align: center;
}

/* ===== ДЕТАЛЬНАЯ СТРАНИЦА НОМЕРА ===== */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
}
.product-gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 400px;
    overflow: hidden;
    border-radius: var(--radius);
    background-color: var(--white);
}
.product-image {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.number-display {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    width: 100%;
}
.large-number {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-family: 'Courier New', monospace;
    word-break: keep-all;
}
.product-info h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--primary);
}
.product-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: var(--gray);
}
.product-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
}
.product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.product-actions .btn-primary { flex: 1; }
.product-actions .btn-secondary { flex: 0 0 auto; }

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 992px) {
    .cabinet-grid { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .filter-row { flex-direction: column; }
    .per-page-control { justify-content: center; }

    /* Карточки номеров на мобильных – всё в одну строку */
    .number-card {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    .number-info {
        justify-content: space-between;
        width: 100%;
    }
    .number-number { min-width: auto; }
    .number-price { min-width: auto; }
    .number-details {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        width: 100%;
    }
    .number-operator,
    .number-region,
    .number-seller {
        min-width: auto;
        flex-shrink: 0;
    }
    .card-actions {
        width: 100%;
        justify-content: stretch;
        gap: 5px;
    }
    .card-actions .btn { flex: 1; }

    /* Страница номера – оператор, регион, статус в одну строку */
    .product-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    .product-meta .operator,
    .product-meta .region,
    .product-meta .status {
        display: inline-block;
    }

    /* Маска: объединяем окошки в один ряд, кнопка снизу */
    .mask-input-container {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .mask-def, .mask-number {
        gap: 5px;
        width: 100%;
        justify-content: center;
    }
    .mask-def-boxes, .mask-number-boxes {
        display: flex;
        gap: 4px;
        flex: 1;
        justify-content: center;
    }
    .mask-digit {
        width: calc((100vw - 40px) / 10);
        height: 40px;
        font-size: 1rem;
    }
    .mask-label { display: none; } /* прячем подписи DEF и Номер */
    #mask-search-btn {
        width: 100%;
        margin-top: 5px;
    }

    /* Фильтр уже нормальный, оставляем как есть */
}

/* Принудительное сближение логотипа и слогана */
.logo a { margin-right: -15px; }
.header-slogan {
    margin-left: 0;
    position: relative;
    left: -10px;
}
.number-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

@media (max-width: 768px) {
    .filter-group {
        width: 100% !important;
        flex: none !important;
    }
    .filter-actions {
        justify-content: space-between;
    }
}
@media (max-width: 768px) {
    .number-display {
        overflow-x: auto;           /* добавляем прокрутку */
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;        /* запрещаем перенос */
        padding: 20px 1.5px;          /* уменьшаем отступы по бокам */
    }
    .large-number {
        font-size: 2rem;            /* подберите размер под свой экран */
        letter-spacing: 0.1px;
        display: inline-block;
        white-space: nowrap;
    }
}
/* Выравнивание ячеек в корзине */
.cart-table td {
    vertical-align: top !important; /* прижимаем содержимое к верху */
}
.cart-table .item-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.stat-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-light);
}
.stat-content h3 {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 5px;
}
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
/* ===== ЛИЧНЫЙ КАБИНЕТ (ФИОЛЕТОВЫЙ ДИЗАЙН) ===== */
.cabinet-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.cabinet-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.cabinet-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.cabinet-header .logo a {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.cabinet-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cabinet-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}
.cabinet-nav a:hover {
    color: white;
    border-bottom-color: white;
}
.user-info {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Второе меню (разделы кабинета) */
.cabinet-sections {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.5rem 0;
}
.cabinet-sections .container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}
.cabinet-sections a {
    color: #495057;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s;
}
.cabinet-sections a:hover {
    background: #e9ecef;
    color: #212529;
}
.cabinet-sections a.active {
    background: #667eea;
    color: white;
}

/* Дебиторская задолженность компактно */
.debt-info {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}
.debt-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.debt-label {
    font-weight: 500;
    color: #6c757d;
}
.debt-value {
    font-weight: 700;
    color: #dc3545;
}
.debt-value.paid {
    color: #28a745;
}

/* Карточки для статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}
.stat-card h3 {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.cabinet-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    background: #f8f9fa;
}
.cabinet-footer {
    background: #343a40;
    color: white;
    padding: 1rem 0;
    text-align: center;
}
/* Тарифы в табличном виде */
.tariffs-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 20px 0;
}
.tariff-card {
    background: transparent;
    border: none;
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    transition: all 0.2s;
    border-bottom: 1px dashed rgba(139, 92, 246, 0.2);
}
.tariff-card:hover {
    background: rgba(139, 92, 246, 0.02);
}
.tariff-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    flex-wrap: wrap;
}
.tariff-image-small {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.tariff-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tariff-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    min-width: 120px;
}
.tariff-price {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-dark);
    min-width: 80px;
}
.tariff-setup-price {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--primary);
    min-width: 70px;
}
.tariff-operator {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 70px;
}
.tariff-operator .operator-logo {
    max-height: 20px;
}
.tariff-conditions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--gray-dark);
    font-size: 0.85rem;
}
.condition {
    background-color: transparent;
    color: var(--gray);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 400;
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.tariff-region {
    color: var(--gray);
    font-size: 0.85rem;
    min-width: 100px;
}
.tariff-seller {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 100px;
    font-size: 0.85rem;
}
.card-actions {
    display: flex;
    gap: 8px;
    min-width: 160px;
    justify-content: flex-end;
    flex-shrink: 0;
}
.card-actions .btn {
    padding: 5px 12px;
    font-size: 0.85rem;
}
.compact-settings .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.compact-settings .form-group {
    margin-bottom: 0;
}
.compact-settings .full-width {
    grid-column: 1 / -1;
}