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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000 !important;
    color: #fff;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

html {
    background: #000 !important;
}

.container {
    max-width: 100vw;
    min-height: 100vh;
    padding-bottom: 80px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #222;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    margin-left: -8px;
}

.logo-image {
    height: 48px;
    width: auto;
    object-fit: contain;
    max-width: 250px;
}

.logo-icon {
    font-size: 24px;
}

.profile-btn {
    background: #000;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-btn:active {
    transform: scale(0.95);
    background: #222;
}

.categories {
    display: flex;
    gap: 12px;
    padding: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: transparent;
    color: #666;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s;
}

.category-btn.active {
    color: #fff;
    font-weight: 600;
}

.category-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.templates-tabs {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.templates-tabs::-webkit-scrollbar {
    display: none;
}

.template-tab {
    background: transparent;
    color: #666;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.template-tab.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.catalog {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 20px;
}

.catalog-item {
    background: #111;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.catalog-item:active {
    transform: scale(0.98);
}

.catalog-item-video {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    background: #000;
}

.catalog-item-info {
    padding: 12px;
}

.catalog-item-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.catalog-item-price {
    font-size: 16px;
    font-weight: 700;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: block;
}

.modal-content {
    position: relative;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.modal-video-container {
    width: 100%;
    aspect-ratio: 9/16;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

#modalVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.color-previews {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.color-previews::-webkit-scrollbar {
    display: none;
}

.color-preview {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.color-preview.active {
    border-color: #fff;
}

.color-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-description {
    color: #999;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.buy-btn {
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.buy-btn:active {
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .catalog {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .catalog {
        grid-template-columns: repeat(4, 1fr);
    }
}
