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

:root {
    --primary: #E8567F;
    --primary-dark: #D1416A;
    --secondary: #B94EC2;
    --dark: #1A1A2E;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, #E8567F, #B94EC2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --radius: 12px;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', -apple-system, sans-serif; color: var(--dark); background: var(--white); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px;
    border-radius: 50px; font-family: 'Inter', sans-serif; font-weight: 600;
    font-size: 0.95rem; cursor: pointer; border: none; transition: all 0.25s;
}
.btn-primary { background: var(--gradient); color: white; box-shadow: 0 4px 20px rgba(232,86,127,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(232,86,127,0.4); }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }
.btn-nav { background: var(--gradient); color: white; padding: 9px 22px; font-size: 0.85rem; }
.btn-download { background: var(--gradient); color: white; padding: 10px 24px; font-size: 0.85rem; border-radius: 8px; border: none; cursor: pointer; font-family: 'Inter', sans-serif; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; }
.btn-download:hover { box-shadow: 0 4px 16px rgba(232,86,127,0.4); }

.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Navbar */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 14px 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); border-bottom: 1px solid var(--gray-200); }
.nav-container { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-family: 'Inter', sans-serif; font-size: 1.15rem; font-weight: 500; }
.logo strong { font-weight: 700; }

/* Hero */
.hero { padding: 140px 0 80px; text-align: center; background: linear-gradient(180deg, #FFF5F8 0%, #FFF0F5 50%, white 100%); }
.hero h1 { font-family: 'Playfair Display', serif; font-size: 3.2rem; font-weight: 700; margin-bottom: 16px; line-height: 1.15; }
.hero p { font-size: 1.1rem; color: var(--gray-500); max-width: 520px; margin: 0 auto 32px; }
.hero-tags { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.hero-tags span { padding: 6px 16px; background: white; border: 1px solid var(--gray-200); border-radius: 50px; font-size: 0.8rem; font-weight: 500; color: var(--gray-700); }

/* Section Header */
.section-header { text-align: center; margin-bottom: 32px; }
.section-header h2 { font-family: 'Playfair Display', serif; font-size: 2rem; margin-bottom: 8px; }
.section-header p { color: var(--gray-500); }

/* Category Tabs */
.category-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }
.cat-tab { padding: 8px 20px; border: 1px solid var(--gray-200); border-radius: 50px; background: white; font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 500; color: var(--gray-700); cursor: pointer; transition: all 0.2s; }
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--gradient); color: white; border-color: transparent; }

/* Templates Section */
.templates-section { padding: 80px 0 100px; }
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }

.template-card {
    border: 2px solid var(--gray-200); border-radius: var(--radius); overflow: hidden;
    cursor: pointer; transition: all 0.3s; background: white;
}
.template-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.template-card canvas { width: 100%; display: block; }
.template-card-info { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.template-card-info h3 { font-size: 0.9rem; font-weight: 600; }
.template-card-info span { font-size: 0.72rem; padding: 3px 10px; background: var(--gray-100); border-radius: 50px; color: var(--gray-500); font-weight: 500; }

/* Editor Overlay */
.editor-overlay { position: fixed; inset: 0; background: var(--gray-50); z-index: 200; overflow: hidden; display: flex; flex-direction: column; }
.editor-container { display: flex; flex-direction: column; height: 100%; }

.editor-topbar { height: 56px; background: white; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; }
.editor-back { display: flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-family: 'Inter', sans-serif; font-size: 0.88rem; font-weight: 500; color: var(--gray-700); }
.editor-back:hover { color: var(--primary); }
.editor-title { font-weight: 600; font-size: 0.9rem; color: var(--dark); }

.editor-body { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
.editor-sidebar { width: 300px; background: white; border-right: 1px solid var(--gray-200); overflow-y: auto; padding: 20px; flex-shrink: 0; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-section h4 { font-size: 0.82rem; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--gray-500); margin-bottom: 4px; }
.input-field { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 0.88rem; color: var(--dark); transition: border-color 0.2s; }
.input-field:focus { outline: none; border-color: var(--primary); }
textarea.input-field { resize: vertical; min-height: 60px; }

.color-fields { display: flex; flex-direction: column; gap: 10px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field label { font-size: 0.78rem; font-weight: 600; color: var(--gray-500); min-width: 80px; }
.color-field input[type="color"] { width: 36px; height: 36px; border: 2px solid var(--gray-200); border-radius: 8px; padding: 2px; cursor: pointer; background: none; }

.photo-upload-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--gray-100); border: 1px dashed var(--gray-300); border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 500; color: var(--gray-700); transition: all 0.2s; width: 100%; justify-content: center; }
.photo-upload-btn:hover { border-color: var(--primary); color: var(--primary); background: #FFF5F8; }
.remove-photo-btn { width: 100%; padding: 8px; background: none; border: 1px solid #FECACA; border-radius: 8px; color: #EF4444; font-family: 'Inter', sans-serif; font-size: 0.8rem; font-weight: 500; cursor: pointer; margin-top: 8px; }
.remove-photo-btn:hover { background: #FEF2F2; }

/* Photo Adjustments */
.photo-adjustments { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gray-200); }
.photo-adjustments .field { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.photo-adjustments .field label { font-size: 0.75rem; font-weight: 600; color: var(--gray-500); min-width: 70px; flex-shrink: 0; }
.slider-input { flex: 1; min-width: 100px; accent-color: var(--primary); height: 4px; cursor: pointer; }
.slider-val { font-size: 0.72rem; font-weight: 600; color: var(--gray-400); min-width: 36px; text-align: right; }
.reset-photo-btn { width: 100%; padding: 8px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 0.8rem; font-weight: 500; color: var(--gray-500); cursor: pointer; margin-top: 8px; transition: all 0.2s; }
.reset-photo-btn:hover { background: var(--gray-200); color: var(--dark); }

/* Canvas Preview */
.editor-preview { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: auto; background: var(--gray-100); }
.editor-preview canvas { box-shadow: var(--shadow-lg); max-width: 100%; max-height: 100%; border-radius: 4px; }

/* Footer */
.footer { padding: 32px 0; text-align: center; border-top: 1px solid var(--gray-200); }
.footer p { font-size: 0.82rem; color: var(--gray-400); }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .editor-body { flex-direction: column; }
    .editor-sidebar { width: 100%; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--gray-200); }
    .editor-preview { min-height: 50vh; }
    .templates-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .category-tabs { gap: 6px; }
    .cat-tab { padding: 6px 14px; font-size: 0.78rem; }
}
