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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    color: #f97316;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #1e293b;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
    color: #e2e8f0;
}

.tab.active {
    color: #f97316;
    border-bottom-color: #f97316;
}

/* Tab content */
.tab-content {
    display: none;
}

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

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #f97316;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

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

.btn-primary {
    background: #f97316;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #ea580c;
}

.btn-primary:disabled {
    background: #78350f;
    cursor: not-allowed;
}

.btn-copy {
    background: #334155;
    color: #e2e8f0;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #475569;
}

.hidden {
    display: none !important;
}

/* Results */
.result {
    margin-top: 1.5rem;
}

.error {
    background: #450a0a;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Product Display */
.product-header {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.product-images img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.product-images .thumb-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.product-images .thumb-row img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.product-images .thumb-row img:hover,
.product-images .thumb-row img.active {
    border-color: #f97316;
}

.product-info h2 {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: #f1f5f9;
}

.product-meta {
    margin-bottom: 0.75rem;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f97316;
}

.price-original {
    font-size: 0.95rem;
    color: #64748b;
    text-decoration: line-through;
    margin-left: 0.75rem;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.product-info > div {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* Sections */
.section {
    background: #1e293b;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid #334155;
}

.section summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: #cbd5e1;
    user-select: none;
}

.section summary:hover {
    color: #f97316;
}

.section > :not(summary) {
    padding: 0 1rem 1rem;
}

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 0.5rem;
    color: #94a3b8;
    border-bottom: 1px solid #334155;
    font-weight: 600;
}

.data-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #1e293b;
    color: #e2e8f0;
}

/* Variations */
.variation-group {
    margin-bottom: 0.75rem;
}

.variation-group h4 {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.variation-options span {
    background: #334155;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #e2e8f0;
}

/* Description */
.description-text {
    white-space: pre-wrap;
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
}

/* JSON */
.json-block {
    background: #0f172a;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #94a3b8;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Affiliate */
.affiliate-success h3 {
    color: #22c55e;
    margin-bottom: 0.75rem;
}

.link-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.link-box input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #1e293b;
    color: #67e8f9;
    font-size: 0.9rem;
}

.affiliate-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 640px) {
    .product-header {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .stats {
        gap: 0.5rem;
    }
}

/* Cookie Management */
.cookie-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cookie-count {
    color: #94a3b8;
    font-size: 0.9rem;
}

.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-family: 'Consolas', 'Monaco', monospace;
    resize: vertical;
    line-height: 1.4;
}

.form-group textarea:focus {
    outline: none;
    border-color: #f97316;
}

.form-group small {
    color: #64748b;
}

.btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

.btn-secondary:hover {
    background: #475569;
}

.success {
    background: #052e16;
    border: 1px solid #22c55e;
    color: #86efac;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}
