/* Templates Gallery Styles - with sharing feature */

/* Body */
body {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Header */
.templates-header {
    background: #11111b;
    border-bottom: 1px solid #313244;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
}

.templates-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.templates-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #74c7ec;
    text-decoration: none;
    transition: color 0.3s;
}

.templates-logo:hover {
    color: #89dceb;
}

.templates-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.templates-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    color: #cdd6f4;
    text-decoration: none;
    transition: all 0.3s;
}

.templates-nav-link:hover {
    background: #313244;
    color: #fff;
}

.templates-nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.templates-favorites-btn {
    position: relative;
    padding: 8px 16px;
    border-radius: 8px;
    background: #313244;
    border: none;
    color: #f38ba8;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.templates-favorites-btn:hover {
    background: #45475a;
    transform: scale(1.05);
}

.templates-favorites-btn span {
    margin-left: 8px;
    background: #f38ba8;
    color: #11111b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.templates-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #cdd6f4;
    font-size: 24px;
    cursor: pointer;
}

/* Responsive nav (hamburger) */
@media (max-width: 900px) {
    .templates-menu-toggle {
        display: block;
    }
    .templates-nav {
        display: none;
        position: absolute;
        right: 20px;
        top: 70px;
        background: #11111b;
        border: 1px solid #313244;
        border-radius: 12px;
        padding: 10px;
        flex-direction: column;
        gap: 8px;
        z-index: 200;
        box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    }
    .templates-nav.open {
        display: flex;
    }
}

/* Hero */
.templates-hero {
    background: linear-gradient(135deg, #1e1e2e 0%, #11111b 100%);
    padding: 60px 20px;
    text-align: center;
    border-bottom: 1px solid #313244;
}

.templates-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.templates-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(116, 199, 236, 0.1);
    border: 1px solid rgba(116, 199, 236, 0.3);
    border-radius: 20px;
    color: #74c7ec;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.templates-hero h1 {
    font-size: 48px;
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, #cdd6f4 0%, #74c7ec 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.templates-hero-subtitle {
    font-size: 18px;
    color: #bac2de;
    margin: 0 0 40px 0;
    line-height: 1.6;
}

.templates-hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 14px;
    color: #9399b2;
    margin-top: 4px;
}

/* Categories Navigation */
.categories-nav {
    background: #11111b;
    border-bottom: 1px solid #313244;
    position: sticky;
    top: 70px;
    z-index: 90;
    height: 64px;
}

.categories-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 100%;
}

.categories-nav-scroll {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.categories-nav-scroll::-webkit-scrollbar {
    display: none;
}

.cat-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #313244;
    border: 2px solid transparent;
    border-radius: 20px;
    text-decoration: none;
    color: #cdd6f4;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.cat-nav-item:hover {
    background: #45475a;
    border-color: #585b70;
}

.cat-nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cat-nav-emoji {
    font-size: 18px;
}

.cat-nav-scroll {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6c7086;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cat-nav-scroll:hover {
    background: #313244;
    color: #cdd6f4;
}

/* Filters */
.templates-filters {
    background: #181825;
    padding: 20px;
    border-bottom: 1px solid #313244;
}

.templates-filters-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid #313244;
    background: #1e1e2e;
    color: #cdd6f4;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #313244;
    border-color: #45475a;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c7086;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border-radius: 8px;
    border: 1px solid #313244;
    background: #1e1e2e;
    color: #cdd6f4;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

/* Templates Grid */
.templates-main {
    background: #181825;
    min-height: calc(100vh - 400px);
    padding: 40px 20px;
}

.templates-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Template Card */
.template-card {
    background: linear-gradient(135deg, #1e1e2e 0%, #181825 50%, #11111b 100%);
    border: 2px solid rgba(116, 199, 236, 0.15);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(116, 199, 236, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 0;
}

.template-card:hover::before {
    opacity: 1;
}

.template-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: rgba(116, 199, 236, 0.5);
    box-shadow: 
        0 20px 60px rgba(116, 199, 236, 0.25),
        0 0 0 1px rgba(116, 199, 236, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.template-preview {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #11111b 0%, #181825 100%);
    border-radius: 16px 16px 0 0;
    padding: 16px 0 0 0;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-card:hover .template-preview img {
    transform: scale(1.05);
}

.template-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 2;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge-new {
    background: linear-gradient(135deg, #f9e2af 0%, #fab387 100%);
    color: #1e1e2e;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.badge-popular {
    background: linear-gradient(135deg, #f38ba8 0%, #eba0ac 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.badge-best {
    background: linear-gradient(135deg, #a6e3a1 0%, #94e2d5 100%);
    color: #1e1e2e;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.template-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(17, 17, 27, 0) 0%, rgba(17, 17, 27, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.template-card:hover .template-overlay {
    opacity: 1;
}

.btn-preview {
    padding: 14px 28px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    color: #1e1e2e;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-preview:hover {
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.95) 100%);
    transform: scale(1.08) translateY(-2px);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.template-info {
    padding: 24px;
    position: relative;
    z-index: 1;
}

.template-info h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: #cdd6f4;
}

.template-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.template-category {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #74c7ec;
}

.template-downloads {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #9399b2;
}

.share-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(137, 180, 250, 0.15);
    border: 1px solid rgba(137, 180, 250, 0.3);
    border-radius: 12px;
    color: #89b4fa;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.share-badge:hover {
    background: rgba(137, 180, 250, 0.25);
    border-color: #89b4fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(137, 180, 250, 0.3);
}

.share-badge:active {
    transform: translateY(0);
}

.share-badge i {
    font-size: 12px;
}

.share-badge-telegram {
    background: rgba(137, 180, 250, 0.15);
    border-color: rgba(137, 180, 250, 0.3);
    color: #89b4fa;
}

.share-badge-telegram:hover {
    background: rgba(137, 180, 250, 0.25);
    border-color: #89b4fa;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid rgba(49, 50, 68, 0.5);
    gap: 12px;
    position: relative;
}

.template-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.template-version-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 9px;
    color: #6c7086;
    background: rgba(17, 17, 27, 0.6);
    padding: 3px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.template-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #a6e3a1 0%, #94e2d5 50%, #89dceb 100%);
    border-radius: 14px;
    font-size: 20px;
    font-weight: 800;
    color: #1e1e2e;
    box-shadow: 
        0 6px 20px rgba(166, 227, 161, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-card:hover .template-price {
    transform: scale(1.1) rotate(-2deg);
    box-shadow: 
        0 8px 28px rgba(166, 227, 161, 0.7),
        inset 0 1px 2px rgba(255, 255, 255, 0.7);
}

.price-value {
    font-weight: 900;
    letter-spacing: 0.3px;
}

.price-free {
    background: linear-gradient(135deg, #a6e3a1 0%, #94e2d5 100%);
    color: #1e1e2e;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 6px 20px rgba(166, 227, 161, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-open {
    padding: 14px 28px;
    border-radius: 14px;
    border: none;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
}

.btn-open::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-open:active::before {
    width: 300px;
    height: 300px;
}

.btn-paid {
    background: linear-gradient(135deg, #f9e2af 0%, #fab387 100%);
    color: #1e1e2e;
    box-shadow: 
        0 6px 20px rgba(249, 226, 175, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-paid:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 
        0 10px 32px rgba(249, 226, 175, 0.7),
        inset 0 1px 2px rgba(255, 255, 255, 0.7);
}

.btn-free {
    background: linear-gradient(135deg, #cba6f7 0%, #f5c2e7 100%);
    color: #fff;
    box-shadow: 
        0 6px 20px rgba(203, 166, 247, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-free:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 
        0 10px 32px rgba(203, 166, 247, 0.7),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Empty State */
.templates-empty {
    text-align: center;
    padding: 80px 20px;
    color: #6c7086;
}

.templates-empty i {
    font-size: 64px;
    margin-bottom: 20px;
}

.templates-empty h3 {
    font-size: 24px;
    color: #cdd6f4;
    margin: 0 0 8px 0;
}

/* Loading State */
.templates-loading {
    text-align: center;
    padding: 80px 20px;
    color: #6c7086;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #313244;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Preview Modal */
.template-preview-modal {
    max-width: 900px;
    width: 90%;
}

.template-preview-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.template-preview-modal img {
    width: 100%;
    border-radius: 12px;
}

.preview-info {
    padding: 0;
}

.preview-info p {
    color: #bac2de;
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.preview-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.preview-category {
    padding: 6px 12px;
    background: rgba(116, 199, 236, 0.1);
    border: 1px solid rgba(116, 199, 236, 0.3);
    border-radius: 8px;
    color: #74c7ec;
    font-size: 14px;
}

.preview-price {
    font-size: 24px;
    font-weight: bold;
    color: #a6e3a1;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #313244;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .templates-header {
        height: 60px;
    }
    
    .templates-nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #1e1e2e;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 999;
        transform: translateY(-100%);
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .templates-nav.mobile-active {
        display: flex;
        transform: translateY(0);
        opacity: 1;
    }
    
    .templates-nav-link {
        padding: 12px 16px;
        border-bottom: 1px solid #313244;
    }
    
    .templates-nav-link:last-child {
        border-bottom: none;
    }
    
    .templates-menu-toggle {
        display: block;
    }
    
    .templates-hero h1 {
        font-size: 32px;
    }
    
    .templates-hero-subtitle {
        font-size: 16px;
    }
    
    .templates-hero-stats {
        gap: 20px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .categories-nav {
        top: 60px;
    }
    
    .cat-nav-scroll {
        display: none;
    }
    
    .templates-filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .search-box {
        width: 100%;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Адаптивность сетки для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Адаптивность сетки для больших планшетов и маленьких ноутбуков */
@media (min-width: 1025px) and (max-width: 1366px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Адаптивность сетки для больших экранов */
@media (min-width: 1367px) {
    .templates-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
}

/* Footer */
.templates-footer {
    background: #11111b;
    border-top: 1px solid #313244;
    padding: 40px 20px;
    margin-top: 80px;
}

.templates-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    color: #74c7ec;
    font-size: 18px;
    margin-bottom: 16px;
}

.footer-section p,
.footer-section a {
    color: #cdd6f4;
    font-size: 14px;
    line-height: 1.6;
    text-decoration: none;
}

.footer-section a:hover {
    color: #74c7ec;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 30px auto 0;
    padding-top: 20px;
    border-top: 1px solid #313244;
    text-align: center;
    color: #6c7086;
    font-size: 14px;
}

/* Payment Modal */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.payment-modal-content {
    background: linear-gradient(135deg, #1e1e2e 0%, #181825 100%);
    border: 1px solid rgba(116, 199, 236, 0.3);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    padding: 40px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.payment-header {
    margin-bottom: 30px;
}

.payment-header h2 {
    color: #cdd6f4;
    font-size: 28px;
    margin-bottom: 20px;
    text-align: center;
}

.payment-template-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(88, 91, 112, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(116, 199, 236, 0.2);
}

.payment-template-info img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.payment-template-info h3 {
    color: #cdd6f4;
    font-size: 18px;
    margin: 0 0 5px 0;
}

.payment-price {
    color: #a6e3a1;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.payment-details {
    margin-bottom: 25px;
}

.payment-details label {
    display: block;
    color: #cdd6f4;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(88, 91, 112, 0.2);
    border: 1px solid rgba(116, 199, 236, 0.3);
    border-radius: 8px;
    color: #cdd6f4;
    font-size: 16px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #74c7ec;
    box-shadow: 0 0 0 3px rgba(116, 199, 236, 0.1);
}

.payment-details small {
    display: block;
    color: #6c7086;
    font-size: 12px;
    margin-top: 5px;
}

.payment-methods {
    margin-bottom: 25px;
}

.payment-methods h3 {
    color: #cdd6f4;
    font-size: 16px;
    margin-bottom: 15px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(88, 91, 112, 0.1);
    border: 2px solid rgba(116, 199, 236, 0.2);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-method:hover {
    border-color: #74c7ec;
    background: rgba(88, 91, 112, 0.2);
}

.payment-method input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.payment-method span {
    color: #cdd6f4;
    font-size: 16px;
    flex: 1;
}

.payment-info {
    background: rgba(166, 227, 161, 0.1);
    border: 1px solid rgba(166, 227, 161, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
}

.payment-info p {
    color: #a6e3a1;
    font-size: 14px;
    margin: 5px 0;
}

.button-large {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .payment-modal-content {
        padding: 25px;
    }
    
    .payment-header h2 {
        font-size: 22px;
    }
    
    .payment-template-info {
        flex-direction: column;
        text-align: center;
    }
}

/* Status Badges for Template Cards */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.status-badge-free {
    background: linear-gradient(135deg, #a6e3a1 0%, #94e2d5 100%);
    color: #1e1e2e;
    border-color: rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.status-badge-free::before {
    content: '✓';
    font-weight: 900;
}

.status-badge-paid {
    background: linear-gradient(135deg, #f9e2af 0%, #fab387 100%);
    color: #1e1e2e;
    border-color: rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.status-badge-paid::before {
    content: '₽';
    font-weight: 900;
}

.status-badge-premium {
    background: linear-gradient(135deg, #cba6f7 0%, #f5c2e7 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.status-badge-premium::before {
    content: '★';
    font-weight: 900;
}

.template-card:hover .status-badge {
    transform: scale(1.08) rotate(-2deg);
}

.template-meta .status-badge {
    font-size: 11px;
    padding: 6px 12px;
}

/* ============================================
   Template Card Components (для catalog.html)
   ============================================ */

.template-card-image {
    position: relative;
    width: 420px;
    height: 340px;
    overflow: hidden;
    background: linear-gradient(135deg, #11111b 0%, #181825 100%);
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Информационная панель над фото */
.template-info-bar {
    position: relative;
    background: rgba(17, 17, 27, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    z-index: 10;
    border-bottom: 1px solid rgba(116, 199, 236, 0.2);
    flex-shrink: 0;
}

.template-card-image img {
    width: 400px;
    height: 300px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    margin: 0 auto;
    flex-shrink: 0;
}

.template-card:hover .template-card-image img {
    transform: scale(1.05);
}

.template-info-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.template-info-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Бейджики FREE и PREMIUM - компактные как теги */
.template-card-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.template-card-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.badge-free {
    background: linear-gradient(135deg, #a6e3a1 0%, #94e2d5 100%);
    color: #1e1e2e;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.badge-free::before {
    content: '✓ ';
    font-weight: 900;
}

.badge-premium {
    background: linear-gradient(135deg, #f9e2af 0%, #fab387 100%);
    color: #1e1e2e;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.badge-premium::before {
    content: '₽ ';
    font-weight: 900;
}

/* Специальные бейджи (новое, популярное, лучшее) - компактные */
.badge-new {
    background: linear-gradient(135deg, #cba6f7 0%, #f5c2e7 100%);
    color: #1e1e2e;
    border-color: rgba(203, 166, 247, 0.4);
}

.badge-popular {
    background: linear-gradient(135deg, #f38ba8 0%, #eba0ac 100%);
    color: #1e1e2e;
    border-color: rgba(243, 139, 168, 0.4);
}

.badge-best {
    background: linear-gradient(135deg, #f9e2af 0%, #f5e0dc 100%);
    color: #1e1e2e;
    border-color: rgba(249, 226, 175, 0.4);
}

/* Контент карточки */
.template-card-content {
    padding: 24px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-card-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(116, 199, 236, 0.15);
    border: 1px solid rgba(116, 199, 236, 0.3);
    border-radius: 10px;
    color: #74c7ec;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    width: fit-content;
    transition: all 0.3s;
}

.template-card:hover .template-card-category {
    background: rgba(116, 199, 236, 0.25);
    border-color: #74c7ec;
    transform: translateX(4px);
}

.template-card-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #cdd6f4;
    line-height: 1.4;
    transition: color 0.3s;
}

.template-card:hover .template-card-title {
    color: #fff;
}

.template-card-desc {
    margin: 0;
    font-size: 14px;
    color: #9399b2;
    line-height: 1.6;
    min-height: 42px;
}

/* Теги карточки */
.template-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.template-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(137, 220, 235, 0.1);
    border: 1px solid rgba(137, 220, 235, 0.3);
    border-radius: 8px;
    color: #89dceb;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.template-tag:hover {
    background: rgba(137, 220, 235, 0.2);
    border-color: #89dceb;
    transform: translateY(-2px);
}

.template-tag-more {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(147, 153, 178, 0.1);
    border: 1px solid rgba(147, 153, 178, 0.3);
    border-radius: 8px;
    color: #9399b2;
    font-size: 11px;
    font-weight: 600;
}

/* Кнопка "Использовать" */
.template-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 28px;
    margin-top: 8px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 800;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.template-card-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.template-card-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 10px 32px rgba(102, 126, 234, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.template-card-btn:active::before {
    width: 300px;
    height: 300px;
}

.template-card-btn i {
    font-size: 16px;
    transition: transform 0.3s;
}

.template-card:hover .template-card-btn i {
    transform: translateX(4px);
}

/* Адаптивность для ноутбуков (1024px - 1366px) */
@media (max-width: 1366px) and (min-width: 1025px) {
    .template-card-image {
        width: 380px;
        height: 320px;
    }
    
    .template-card-image img {
        width: 360px;
        height: 270px;
    }
}

/* Адаптивность для планшетов (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .template-card-image {
        width: 100%;
        max-width: 400px;
        height: 340px;
        margin: 0 auto;
    }
    
    .template-card-image img {
        width: 380px;
        height: 285px;
    }
    
    .template-card-content {
        padding: 20px;
    }
}

/* Адаптивность для мобильных и маленьких планшетов (до 768px) */
@media (max-width: 768px) {
    .template-card-image {
        width: 100%;
        height: auto;
        min-height: 280px;
        padding: 0;
    }
    
    .template-card-image img {
        width: 100%;
        max-width: 400px;
        height: auto;
        min-height: 250px;
    }
    
    .template-preview {
        padding: 0;
    }
    
    .template-card-content {
        padding: 16px;
        gap: 8px;
    }
    
    .template-card-title {
        font-size: 18px;
    }
    
    .template-card-desc {
        font-size: 13px;
        min-height: auto;
    }
    
    .template-card-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .template-card-badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    .template-info-bar {
        padding: 8px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .template-info-left {
        gap: 4px;
        flex-wrap: wrap;
    }

    .template-zoom-btn {
        padding: 3px 8px;
        font-size: 12px;
    }
}

/* Адаптивность для маленьких телефонов (до 480px) */
@media (max-width: 480px) {
    .template-card-image {
        min-height: 240px;
    }
    
    .template-card-image img {
        min-height: 200px;
    }
    
    .template-info-bar {
        padding: 6px;
        gap: 4px;
    }
    
    .template-card-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    
    .template-card-content {
        padding: 12px;
    }
    
    .template-card-title {
        font-size: 16px;
    }
    
    .template-card-desc {
        font-size: 12px;
    }
}

/* === Share functionality styles === */
.template-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-share-simple {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #89b4fa 0%, #b4befe 100%);
    border: 2px solid rgba(137, 180, 250, 0.3);
    border-radius: 12px;
    color: #1e1e2e;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(137, 180, 250, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-share-simple:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 6px 16px rgba(137, 180, 250, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.btn-telegram-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: linear-gradient(135deg, #89b4fa 0%, #74c7ec 100%);
    border: 2px solid rgba(137, 180, 250, 0.3);
    border-radius: 12px;
    color: #1e1e2e;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(137, 180, 250, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.btn-telegram-simple:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 
        0 6px 16px rgba(137, 180, 250, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.share-dropdown {
    position: relative;
}

.btn-share {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: linear-gradient(135deg, #89b4fa 0%, #cba6f7 100%);
    border: 2px solid rgba(137, 180, 250, 0.3);
    border-radius: 12px;
    color: #1e1e2e;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(137, 180, 250, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.btn-share:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 6px 16px rgba(137, 180, 250, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, #89b4fa 0%, #b4befe 100%);
}

.btn-share:active {
    transform: translateY(0) scale(0.98);
}

.share-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: #1e1e2e;
    border: 2px solid #313244;
    border-radius: 12px;
    padding: 8px;
    min-width: 220px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.share-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #cdd6f4;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-menu button:hover {
    background: #313244;
    color: #89b4fa;
}

.share-menu button i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.share-menu button .fa-link {
    color: #a6e3a1;
}

.share-menu button .fa-telegram {
    color: #89b4fa;
}

.share-menu button:hover .fa-link,
.share-menu button:hover .fa-telegram {
    color: inherit;
}

/* Arrow for dropdown */
.share-menu::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 18px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #313244;
}

.share-menu::before {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1e1e2e;
    z-index: 1;
}


