/* ============================================
   GLOBAL OVERFLOW FIX FOR MOBILE
   ============================================ */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

.main-content {
    overflow-x: hidden;
    max-width: 100%;
}

/* Store Preview Premium */
.store-preview-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    border: 1px solid var(--border);
}

.store-preview-banner {
    height: 100px;
    background: linear-gradient(135deg, var(--bg-dark), var(--border));
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
}

.store-preview-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--bg-card));
}

.store-preview-body {
    padding: 0 1.5rem 1.5rem;
    text-align: center;
    position: relative;
    margin-top: -50px;
}

.store-preview-logo-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    border: 4px solid var(--bg-card);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.store-preview-logo-wrapper img {
    width: 80%;
    height: 80%;
    object-fit: cover;
}

.store-preview-info {
    position: relative;
    z-index: 1;
}

.store-preview-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.store-preview-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.store-preview-url-box {
    display: inline-flex;
    align-items: center;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    margin-bottom: 1rem;
    max-width: 100%;
}

.store-url-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-url-link:hover {
    text-decoration: underline;
}

.store-copy-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.store-copy-btn:hover {
    background: var(--primary);
    color: black;
    border-color: var(--primary);
}

.store-preview-badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge-status, .badge-plan {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-plan {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    color: #DAA520;
    border: 1px solid rgba(218, 165, 32, 0.2);
}

/* Tabs */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-secondary);
    /* Corrected from --text */
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-family: inherit;
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Social Inputs */
.social-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-input iconify-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

/* Domain Options */
.domain-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.domain-option {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: block;
    /* Ensure label behaves as block */
}

.domain-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    /* Assuming primary is kind of blue/purple */
}

.domain-option.selected {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    /* Better if using variables */
}

.domain-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.domain-option-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.domain-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.domain-option.selected .domain-option-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.domain-option.selected .domain-option-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.domain-option-title {
    font-weight: 600;
    font-size: 1rem;
}

.domain-option-icon {
    margin-left: auto;
    font-size: 1.5rem;
    color: var(--primary);
}

.domain-option-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-darker);
    /* Assuming a background variable */
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    word-break: break-all;
}

.domain-option-url iconify-icon {
    flex-shrink: 0;
    color: var(--primary);
}

.domain-option-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--success);
    color: white;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.domain-option-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.custom-domain-input {
    margin-top: 1rem;
    display: none;
}

.domain-option.selected .custom-domain-input {
    display: block;
}

/* Domain Status */
.domain-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    font-size: 0.85rem;
}

.domain-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* DNS Table & Instructions */
.dns-instructions {
    background: var(--bg-card);
    /* Consistent background */
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}

.dns-instructions h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dns-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.dns-table th,
.dns-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.dns-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.dns-table code {
    background: var(--bg-darker);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

/* Logo System */
.logo-type-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.logo-type-option {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logo-type-option input {
    display: none;
}

.logo-type-option iconify-icon {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.logo-type-option span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.logo-type-option:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    /* Fixed color variable usage */
}

.logo-type-option.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.logo-type-option.active iconify-icon,
.logo-type-option.active span {
    color: var(--primary);
}

/* Logo Upload Area */
.logo-upload-area {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.logo-preview-box {
    width: 100%;
    height: 150px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.logo-preview-box:hover {
    border-color: var(--primary);
}

.logo-preview-box img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.logo-placeholder iconify-icon {
    font-size: 2rem;
}

.logo-placeholder span {
    font-size: 0.8rem;
    text-align: center;
}

.logo-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: var(--error, #ef4444);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.logo-preview-box:hover .logo-remove-btn {
    opacity: 1;
}

/* Favicon */
.favicon-upload-area {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.favicon-preview-box {
    width: 64px;
    height: 64px;
    background: var(--bg-darker);
    border: 2px dashed var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.favicon-preview-box:hover {
    border-color: var(--primary);
}

.favicon-preview-box img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.favicon-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
}

.favicon-placeholder iconify-icon {
    font-size: 1.5rem;
}

.favicon-placeholder span {
    font-size: 0.65rem;
}

.favicon-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: var(--error, #ef4444);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.favicon-preview-box:hover .favicon-remove-btn {
    opacity: 1;
}

.favicon-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.favicon-upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Premium Card (Compact) */
.premium-locked {
    position: relative;
}

.premium-locked>label {
    display: none !important;
}

.premium-overlay {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

[data-theme="dark"] .premium-overlay {
    background: rgba(30, 30, 30, 0.95);
}

.premium-card {
    text-align: center;
    width: 100%;
}

.premium-card-icon {
    display: none;
}

.premium-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.premium-card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.premium-card-plan {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.premium-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
}

.premium-card-features li {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-secondary);
}

.premium-card-features iconify-icon {
    color: #22c55e;
    font-size: 0.9rem;
}

.btn-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    margin-top: 0.5rem;
}

.btn-upgrade:hover {
    opacity: 0.9;
}

/* ============================================
   RESPONSIVE (768px breakpoint)
   ============================================ */
@media (max-width: 768px) {

    /* Tabs: horizontal scroll */
    .tab-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        margin: 0 -1rem 1.5rem -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        white-space: nowrap;
        flex: 0 0 auto;
        padding: 0.6rem 1rem;
    }

    /* Logo Type Options: Single column */
    .logo-type-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Logo Upload: Vertical stack */
    .logo-upload-area {
        flex-direction: column;
        width: 100%;
    }

    .logo-preview-box {
        width: 100%;
        height: 140px;
    }

    /* Favicon Upload: Vertical stack */
    .favicon-upload-area {
        flex-direction: column;
        align-items: stretch;
    }

    .favicon-preview-box {
        width: 100%;
        height: 80px;
    }

    /* Domain Options */
    .domain-option {
        padding: 1rem;
    }

    .domain-option-header {
        flex-wrap: wrap;
    }

    .domain-option-url {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    /* DNS Table Responsive */
    .dns-table {
        font-size: 0.75rem;
    }

    .dns-table th,
    .dns-table td {
        padding: 0.4rem;
    }

    .dns-table code {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }

    /* Store Preview Compact */
    .store-preview {
        padding: 1rem;
    }

    .store-preview-logo {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .store-preview-name {
        font-size: 1.1rem;
    }

    .store-preview-url {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    /* Premium Overlay */
    .premium-overlay {
        padding: 1rem;
    }

    .premium-card-features {
        flex-direction: column;
        align-items: center;
    }

    /* Social Inputs */
    .social-input {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Generic Grid/Flex stacking */
    .form-grid,
    .grid-2,
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    .flex-row {
        flex-direction: column !important;
    }

    /* Full Width on Mobile */
    .card,
    .tab-content,
    .form-group {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}