/* ============================================
   COUNTRY PAGE VIEW
   Full-page country view replacing modal
   ============================================ */

/* Hide main content when country page is active */
body.country-page-active .category-buttons-section,
body.country-page-active .category-content,
body.country-page-active .contact-section,
body.country-page-active .info-modal,
body.country-page-active > .calculator-box-section {
    display: none !important;
}

/* Show country page */
.country-page {
    display: none;
    padding-top: 20px;
}

body.country-page-active .country-page {
    display: block;
}

/* ============================================
   COUNTRY HERO IMAGE
   ============================================ */
.country-page-hero {
    max-width: 1440px;
    width: calc(100% - 80px);
    margin: 0 auto 40px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    height: 480px;
}

.country-page-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.country-page-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 48px 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    color: white;
}

.country-page-hero-overlay h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.country-page-hero-overlay p {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.9;
    max-width: 700px;
}

/* Back button */
.country-page-back {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.country-page-back:hover {
    background: rgba(255, 255, 255, 0.25);
}

.country-page-back svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   COUNTRY INFO CARDS (stats row)
   ============================================ */
.country-page-info {
    max-width: 1440px;
    width: calc(100% - 80px);
    margin: 0 auto 48px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.country-info-stat {
    background: var(--glass-bg, rgba(255, 255, 255, 0.8));
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.06));
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.country-info-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.country-info-stat .stat-label {
    font-size: 16px;
    color: var(--color-text-secondary, #6b7280);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.country-info-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary, #151419);
    margin-bottom: 4px;
}

.country-info-stat .stat-desc {
    font-size: 14px;
    color: var(--color-text-secondary, #9ca3af);
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.country-page-services {
    max-width: 1440px;
    width: calc(100% - 80px);
    margin: 0 auto 48px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.8));
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.06));
    border-radius: 24px;
    padding: 48px;
}

.country-page-services .section-heading {
    margin-bottom: 12px;
    text-align: center;
}

.country-page-services .section-heading h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text-primary, #151419);
}

.country-page-services .section-heading p {
    font-size: 17px;
    color: var(--color-text-secondary, #6b7280);
    margin-top: 8px;
    line-height: 1.5;
}

.country-page-services-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 32px;
}

/* Service card */
.cp-service-card {
    background: var(--color-bg, #fff);
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.06));
    border-radius: 20px;
    padding: 32px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cp-service-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.cp-service-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.cp-service-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6666FF, #4541F1);
    color: white;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
}

.cp-service-card-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary, #151419);
    line-height: 1.4;
}

.cp-service-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-secondary, #6b7280);
    margin-bottom: 20px;
}

.cp-service-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border, rgba(0, 0, 0, 0.06));
}

.cp-service-price {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-primary, #6666FF);
}

.cp-service-order-btn {
    padding: 12px 28px;
    border: 2px solid var(--color-primary, #6666FF);
    border-radius: 12px;
    background: transparent;
    color: var(--color-primary, #6666FF);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cp-service-order-btn:hover {
    background: var(--color-primary, #6666FF);
    color: white;
}

/* ============================================
   FAQ SECTION
   ============================================ */
.country-page-faq {
    max-width: 1440px;
    width: calc(100% - 80px);
    margin: 0 auto 48px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.8));
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.06));
    border-radius: 24px;
    padding: 48px;
}

.country-page-faq .section-heading {
    text-align: center;
}

.country-page-faq .section-heading h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text-primary, #151419);
    margin-bottom: 8px;
}

.country-page-faq .section-heading p {
    font-size: 17px;
    color: var(--color-text-secondary, #6b7280);
    line-height: 1.5;
}

.cp-faq-list {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cp-faq-item {
    border-bottom: 1px solid var(--glass-border, rgba(0, 0, 0, 0.06));
}

.cp-faq-item:last-child {
    border-bottom: none;
}

.cp-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--color-text-primary, #151419);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    gap: 16px;
}

.cp-faq-question svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary, #6b7280);
    transition: transform 0.3s ease;
}

.cp-faq-item.active .cp-faq-question svg {
    transform: rotate(180deg);
}

.cp-faq-answer {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
}

.cp-faq-answer p {
    padding: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-secondary, #6b7280);
}

/* ============================================
   CALCULATOR BOX (COUNTRY PAGE)
   ============================================ */
.country-page-calculator {
    max-width: 1440px;
    width: calc(100% - 80px);
    margin: 0 auto 48px;
}

.country-page-calculator .calculator-box-content {
    text-align: center;
}

.country-page-calculator .calculator-box {
    width: 100%;
    grid-template-columns: 1fr;
}

.country-page-calculator .calculator-box-visual {
    display: none;
}

/* ============================================
   CONTACT SECTION (COUNTRY PAGE)
   ============================================ */
.country-page-contact {
    max-width: 1440px;
    width: calc(100% - 80px);
    margin: 0 auto 48px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.8));
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.06));
    border-radius: 24px;
    padding: 48px;
    text-align: center;
}

.country-page-contact h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary, #151419);
    margin-bottom: 12px;
}

.country-page-contact p {
    font-size: 17px;
    color: var(--color-text-secondary, #6b7280);
    margin-bottom: 28px;
    line-height: 1.5;
}

.cp-contact-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.cp-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.cp-contact-btn.whatsapp {
    background: #25D366;
    color: white;
}

.cp-contact-btn.whatsapp:hover {
    background: #1fba59;
}

.cp-contact-btn.telegram {
    background: #2AABEE;
    color: white;
}

.cp-contact-btn.telegram:hover {
    background: #229ed9;
}

.cp-contact-btn.email-btn {
    background: var(--color-primary, #6666FF);
    color: white;
}

.cp-contact-btn.email-btn:hover {
    background: #4541F1;
}

.cp-contact-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   OTHER COUNTRIES CAROUSEL
   ============================================ */
.country-page-carousel {
    max-width: 1440px;
    width: calc(100% - 80px);
    margin: 0 auto 60px;
}

.country-page-carousel .section-heading {
    margin-bottom: 24px;
    text-align: center;
}

.country-page-carousel .section-heading h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary, #151419);
}

.country-page-carousel .section-heading p {
    font-size: 16px;
    color: var(--color-text-secondary, #6b7280);
    margin-top: 6px;
}

.cp-countries-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    scroll-behavior: auto;
}

.cp-countries-scroll::-webkit-scrollbar {
    display: none;
}

.cp-country-card {
    flex-shrink: 0;
    width: 240px;
    height: 160px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cp-country-card:hover {
    transform: scale(1.03);
}

.cp-country-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-country-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.cp-country-card-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

/* ============================================
   VISA ORDER BUTTON (ВИЗЫ & ПРОЧЕЕ sections)
   ============================================ */
.visa-order-btn {
    flex-shrink: 0;
    padding: 10px 22px;
    border: 2px solid var(--color-primary, #6666FF);
    border-radius: 12px;
    background: transparent;
    color: var(--color-primary, #6666FF);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    align-self: center;
}

.visa-order-btn:hover {
    background: var(--color-primary, #6666FF);
    color: white;
}

@media (max-width: 768px) {
    .visa-item {
        flex-wrap: wrap;
    }

    .visa-order-btn {
        width: 100%;
        text-align: center;
        padding: 10px 16px;
        margin-top: 8px;
    }
}

/* ============================================
   CONTACT CHOICE MODAL
   ============================================ */
.contact-choice-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.contact-choice-modal.active {
    opacity: 1;
    pointer-events: all;
}

.contact-choice-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.contact-choice-box {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    max-width: 420px;
    width: calc(100% - 40px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    text-align: center;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-choice-modal.active .contact-choice-box {
    transform: scale(1) translateY(0);
}

.contact-choice-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.contact-choice-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.contact-choice-close svg {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

.contact-choice-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary, #151419);
    margin-bottom: 8px;
}

.contact-choice-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary, #6b7280);
    margin-bottom: 28px;
    line-height: 1.5;
}

.contact-choice-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-choice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.contact-choice-btn.whatsapp {
    background: #25D366;
    color: white;
}

.contact-choice-btn.whatsapp:hover {
    background: #1fba59;
}

.contact-choice-btn.telegram {
    background: #2AABEE;
    color: white;
}

.contact-choice-btn.telegram:hover {
    background: #229ed9;
}

.contact-choice-btn.email-btn {
    background: var(--color-primary, #6666FF);
    color: white;
}

.contact-choice-btn.email-btn:hover {
    background: #4541F1;
}

.contact-choice-btn svg {
    width: 20px;
    height: 20px;
}

/* Dark theme */
[data-theme="dark"] .contact-choice-box {
    background: #1a1a2e;
}

[data-theme="dark"] .contact-choice-close {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .contact-choice-close svg {
    color: #9ca3af;
}

@media (max-width: 480px) {
    .contact-choice-box {
        padding: 28px 20px;
        border-radius: 20px;
    }
    
    .contact-choice-title {
        font-size: 20px;
    }
    
    .contact-choice-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] .country-page-services,
[data-theme="dark"] .country-page-faq,
[data-theme="dark"] .country-page-contact {
    background: rgba(20, 20, 35, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .cp-service-card {
    background: rgba(30, 30, 50, 0.6);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .country-info-stat {
    background: rgba(20, 20, 35, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .country-page-back {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1024px) {
    .country-page-hero {
        width: calc(100% - 40px);
        height: 400px;
    }
    
    .country-page-hero-overlay h1 {
        font-size: 36px;
    }
    
    .country-page-hero-overlay p {
        font-size: 16px;
    }
    
    .country-page-info {
        width: calc(100% - 40px);
    }
    
    .country-page-services,
    .country-page-faq,
    .country-page-contact,
    .country-page-calculator,
    .country-page-carousel {
        width: calc(100% - 40px);
        padding: 36px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .country-page {
        padding-top: 10px;
    }

    .country-page-hero {
        width: calc(100% - 32px);
        height: 300px;
        border-radius: 20px;
    }
    
    .country-page-hero-overlay {
        padding: 24px 20px;
    }
    
    .country-page-hero-overlay h1 {
        font-size: 26px;
    }
    
    .country-page-hero-overlay p {
        font-size: 14px;
        line-height: 1.5;
    }

    .country-page-back {
        top: 16px;
        left: 16px;
        padding: 8px 16px;
        font-size: 14px;
        border-radius: 10px;
    }

    .country-page-back svg {
        width: 16px;
        height: 16px;
    }
    
    .country-page-info {
        width: calc(100% - 32px);
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 32px;
    }

    .country-info-stat {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .country-info-stat .stat-label {
        font-size: 12px;
    }

    .country-info-stat .stat-value {
        font-size: 22px;
    }

    .country-info-stat .stat-desc {
        font-size: 12px;
    }
    
    .country-page-services,
    .country-page-faq,
    .country-page-contact,
    .country-page-calculator,
    .country-page-carousel {
        width: calc(100% - 32px);
        padding: 28px 20px;
        margin-bottom: 32px;
        border-radius: 20px;
    }
    
    .country-page-services .section-heading h2,
    .country-page-faq .section-heading h2,
    .country-page-contact h2,
    .country-page-carousel .section-heading h2 {
        font-size: 22px;
    }

    .country-page-services .section-heading p,
    .country-page-faq .section-heading p,
    .country-page-contact p,
    .country-page-carousel .section-heading p {
        font-size: 14px;
    }
    
    .cp-service-card {
        padding: 20px;
        border-radius: 16px;
    }
    
    .cp-service-card-header h3 {
        font-size: 17px;
    }

    .cp-service-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
        border-radius: 8px;
    }

    .cp-service-description {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .cp-service-price {
        font-size: 22px;
    }
    
    .cp-service-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .cp-service-order-btn {
        width: 100%;
        text-align: center;
        padding: 12px 24px;
    }

    .cp-faq-question {
        font-size: 15px;
        padding: 16px 0;
    }

    .cp-faq-answer p {
        font-size: 14px;
    }
    
    .cp-contact-buttons {
        flex-direction: column;
    }
    
    .cp-contact-btn {
        justify-content: center;
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .cp-country-card {
        width: 180px;
        height: 130px;
        border-radius: 14px;
    }

    .cp-country-card-name {
        font-size: 14px;
    }

    .country-page-services-list {
        gap: 14px;
    }

    .country-page-calculator .calculator-box {
        border-radius: 20px;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE
   ============================================ */
@media (max-width: 480px) {
    .country-page-hero {
        width: calc(100% - 24px);
        height: 240px;
        border-radius: 16px;
        margin-bottom: 24px;
    }

    .country-page-hero-overlay {
        padding: 20px 16px;
    }
    
    .country-page-hero-overlay h1 {
        font-size: 22px;
    }

    .country-page-hero-overlay p {
        font-size: 13px;
    }

    .country-page-back {
        top: 12px;
        left: 12px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .country-page-info {
        width: calc(100% - 24px);
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 24px;
    }

    .country-info-stat {
        padding: 16px;
    }

    .country-info-stat .stat-value {
        font-size: 20px;
    }
    
    .country-page-services,
    .country-page-faq,
    .country-page-contact,
    .country-page-calculator,
    .country-page-carousel {
        width: calc(100% - 24px);
        padding: 20px 14px;
        margin-bottom: 24px;
        border-radius: 16px;
    }

    .country-page-services .section-heading h2,
    .country-page-faq .section-heading h2,
    .country-page-contact h2,
    .country-page-carousel .section-heading h2 {
        font-size: 20px;
    }

    .cp-service-card {
        padding: 16px;
    }

    .cp-service-card-header {
        gap: 12px;
    }

    .cp-service-card-header h3 {
        font-size: 16px;
    }

    .cp-service-price {
        font-size: 20px;
    }

    .cp-country-card {
        width: 160px;
        height: 110px;
        border-radius: 12px;
    }

    .cp-countries-scroll {
        gap: 12px;
    }
}
