/* ============================================
   CodeMall - 代码商城主样式
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fb923c;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --transition: all 0.2s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
code { background: var(--gray-100); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }
input, select, textarea, button { font-family: inherit; }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo i { font-size: 1.3rem; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
    padding: 8px 14px;
    color: var(--gray-600);
    font-size: 0.9rem;
    border-radius: var(--radius);
    transition: var(--transition);
}
.nav-link:hover { color: var(--primary); background: var(--gray-100); }

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.user-menu:hover { background: var(--gray-100); }
.user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}
.user-name { font-size: 0.9rem; color: var(--gray-700); }
.user-menu .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    overflow: hidden;
    z-index: 200;
}
.user-menu:hover .dropdown { display: block; }
.dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--gray-700);
    font-size: 0.9rem;
    transition: var(--transition);
}
.dropdown a:hover { background: var(--gray-50); color: var(--primary); }
.dropdown a i { margin-right: 8px; width: 16px; }
.dropdown .divider { border-top: 1px solid var(--gray-200); }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-600);
    cursor: pointer;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--gray-600); border-color: var(--gray-300); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { display: block; width: 100%; }

/* ---- Flash Message ---- */
.flash-message {
    padding: 12px 0;
    font-size: 0.9rem;
}
.flash-message .container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
}
.flash-success .container { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error .container { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
}
.flash-close:hover { opacity: 1; }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 50%, #f59e0b 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 16px; }
.hero p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }

.hero-search {
    display: flex;
    max-width: 560px;
    margin: 0 auto 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 4px;
    backdrop-filter: blur(10px);
}
.hero-search-input {
    flex: 1;
    border: none;
    padding: 12px 24px;
    background: transparent;
    color: #fff;
    font-size: 1rem;
    outline: none;
}
.hero-search-input::placeholder { color: rgba(255,255,255,0.7); }
.hero-search .btn {
    border-radius: 50px;
    padding: 12px 24px;
}

.hero-tags { font-size: 0.85rem; opacity: 0.8; }
.hero-tags a {
    color: #fff;
    margin: 0 6px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}
.hero-tags a:hover { background: rgba(255,255,255,0.3); color: #fff; }

/* ---- Sections ---- */
.section { padding: 48px 0; }
.section-alt { background: #fff; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.section-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-800); display: flex; align-items: center; gap: 8px; }
.section-header h2 i { color: var(--primary); }
.link-more { color: var(--gray-500); font-size: 0.9rem; }
.link-more:hover { color: var(--primary); }

/* ---- Category Cards ---- */
.category-cards {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 24px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-width: 120px;
    transition: var(--transition);
    color: var(--gray-700);
    font-size: 0.9rem;
}
.category-card i { font-size: 1.5rem; color: var(--primary); }
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--primary); }

/* ---- Product Grid ---- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: block;
    color: inherit;
}
.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    color: inherit;
}

.product-cover {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    overflow: hidden;
}
.product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cover-placeholder i { font-size: 3rem; color: var(--gray-300); }

.badge-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-recommend {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--warning);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-info { padding: 16px; }
.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.product-price { display: flex; align-items: baseline; gap: 6px; }
.price-current { font-size: 1.1rem; font-weight: 700; color: var(--danger); }
.price-original { font-size: 0.8rem; color: var(--gray-400); text-decoration: line-through; }
.product-stats { display: flex; gap: 10px; font-size: 0.75rem; color: var(--gray-400); }
.product-stats i { margin-right: 2px; }
.product-category {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--primary);
    background: #fff7ed;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ---- Features ---- */
.features-section { background: #fff; }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.feature-card {
    text-align: center;
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}
.feature-card:hover { transform: translateY(-4px); }
.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.feature-icon i { font-size: 1.5rem; color: #fff; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--gray-800); }
.feature-card p { font-size: 0.9rem; color: var(--gray-500); }

/* ---- Search Page ---- */
.search-page { display: flex; gap: 24px; }
.search-sidebar { width: 240px; flex-shrink: 0; }
.search-main { flex: 1; }
.filter-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.filter-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 12px; color: var(--gray-700); }
.filter-list { list-style: none; }
.filter-list li { margin-bottom: 4px; }
.filter-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--gray-600);
    font-size: 0.85rem;
    border-radius: var(--radius);
    transition: var(--transition);
}
.filter-list a:hover, .filter-list a.active {
    background: #fff7ed;
    color: var(--primary);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.search-form { display: flex; flex: 1; }
.search-form input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius) 0 0 var(--radius);
    outline: none;
    font-size: 0.9rem;
}
.search-form input:focus { border-color: var(--primary); }
.search-form .btn { border-radius: 0 var(--radius) var(--radius) 0; }
.result-count { font-size: 0.85rem; color: var(--gray-500); white-space: nowrap; }

/* ---- Product Detail ---- */
.product-detail { background: #fff; border-radius: var(--radius-lg); overflow: hidden; }
.detail-header { display: flex; gap: 32px; padding: 32px; }
.detail-gallery { width: 420px; flex-shrink: 0; }
.detail-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: var(--radius);
}
.detail-image-placeholder {
    width: 100%;
    height: 320px;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}
.detail-image-placeholder i { font-size: 4rem; color: var(--gray-300); }
.detail-info { flex: 1; }
.detail-title { font-size: 1.6rem; font-weight: 700; color: var(--gray-900); margin-bottom: 12px; }
.detail-meta { display: flex; gap: 16px; font-size: 0.85rem; color: var(--gray-500); margin-bottom: 16px; flex-wrap: wrap; }
.detail-meta i { margin-right: 4px; }
.detail-price-box {
    background: linear-gradient(135deg, #fef2f2, #fff5f5);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.detail-price { font-size: 2rem; font-weight: 800; color: var(--danger); }
.detail-original-price { font-size: 1rem; color: var(--gray-400); text-decoration: line-through; }
.detail-discount { font-size: 0.85rem; color: var(--success); background: #ecfdf5; padding: 2px 8px; border-radius: 4px; }
.detail-desc { color: var(--gray-600); font-size: 0.95rem; margin-bottom: 16px; line-height: 1.7; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 4px;
    font-size: 0.8rem;
}
.detail-actions { display: flex; gap: 12px; margin-bottom: 12px; }
.detail-demo-link { font-size: 0.9rem; color: var(--primary); }
.detail-demo-link i { margin-right: 4px; }

.detail-body { padding: 32px; border-top: 1px solid var(--gray-200); }
.detail-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid var(--gray-200); }
.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 0.95rem;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.detail-content { font-size: 0.95rem; line-height: 1.8; color: var(--gray-700); }
.detail-content h3 { margin: 16px 0 8px; color: var(--gray-800); }
.detail-content ul { padding-left: 20px; margin-bottom: 16px; }
.detail-content li { margin-bottom: 4px; }

.detail-info-table { margin-top: 24px; }
.detail-info-table h3 { margin-bottom: 12px; }
.detail-info-table table { width: 100%; border-collapse: collapse; }
.detail-info-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}
.detail-info-table td:first-child { color: var(--gray-500); width: 120px; }

/* Comments */
.comment-form { margin-bottom: 24px; padding: 20px; background: var(--gray-50); border-radius: var(--radius); }
.comment-form h3 { font-size: 1rem; margin-bottom: 12px; }
.rating-input { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.rating-input input[type="radio"] { display: none; }
.rating-input label { cursor: pointer; font-size: 1.2rem; color: var(--gray-300); transition: var(--transition); }
.rating-input input[type="radio"]:checked ~ label,
.rating-input label:hover { color: var(--warning); }
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    resize: vertical;
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.comment-item { padding: 16px 0; border-bottom: 1px solid var(--gray-100); }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-avatar {
    width: 32px; height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}
.comment-user { font-weight: 600; font-size: 0.9rem; }
.comment-rating .fas { font-size: 0.75rem; color: var(--gray-300); }
.comment-rating .starred { color: var(--warning); }
.comment-time { font-size: 0.8rem; color: var(--gray-400); margin-left: auto; }
.comment-body { font-size: 0.9rem; color: var(--gray-600); padding-left: 40px; }

/* ---- Auth Pages ---- */
.auth-page { display: flex; justify-content: center; padding: 40px 0; }
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.auth-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 32px;
    text-align: center;
}
.auth-header h2 { font-size: 1.5rem; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.auth-header p { opacity: 0.85; font-size: 0.9rem; }
.auth-form { padding: 32px; }
.auth-footer { padding: 16px 32px; text-align: center; font-size: 0.9rem; color: var(--gray-500); border-top: 1px solid var(--gray-100); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-group label i { margin-right: 4px; color: var(--gray-400); }
.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-group input[disabled] { background: var(--gray-100); color: var(--gray-500); }

/* ---- User Page ---- */
.user-page { display: flex; gap: 24px; }
.user-sidebar { width: 260px; flex-shrink: 0; }
.user-main { flex: 1; }

.user-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
.user-avatar-lg {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 12px;
}
.user-card h3 { font-size: 1.1rem; color: var(--gray-800); margin-bottom: 4px; }
.user-card p { font-size: 0.85rem; color: var(--gray-500); }
.user-balance { color: var(--danger) !important; font-weight: 600; margin-top: 8px; }

.user-nav {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.user-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: var(--gray-600);
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.user-nav a:hover { background: var(--gray-50); color: var(--primary); }
.user-nav a.active { background: #fff7ed; color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.user-nav a i { width: 18px; text-align: center; }

.panel {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
}
.panel-header h3 { font-size: 1rem; font-weight: 600; }
.panel-body { padding: 24px; }

.form { max-width: 500px; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

/* ---- Orders ---- */
.order-item {
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: var(--transition);
}
.order-item:hover { border-color: var(--primary); }
.order-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.order-no { font-size: 0.85rem; color: var(--gray-500); }
.order-no code { font-size: 0.85rem; }
.order-status { font-size: 0.85rem; font-weight: 600; }
.status-0 { color: var(--warning); }
.status-1 { color: var(--success); }
.status-2 { color: var(--info); }
.status-3 { color: var(--gray-400); }

.order-body { display: flex; align-items: center; gap: 16px; }
.order-thumb { width: 60px; height: 60px; border-radius: var(--radius); object-fit: cover; }
.order-thumb-placeholder {
    width: 60px; height: 60px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}
.order-info { flex: 1; }
.order-info h4 { font-size: 0.9rem; margin-bottom: 4px; }
.order-info h4 a { color: var(--gray-800); }
.order-info p { font-size: 0.8rem; color: var(--gray-500); }
.order-amount { font-size: 1.1rem; font-weight: 700; color: var(--danger); min-width: 80px; text-align: right; }
.order-action { min-width: 80px; text-align: right; }

/* ---- Favorites ---- */
.favorite-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.favorite-thumb img { width: 80px; height: 60px; object-fit: cover; border-radius: var(--radius); }
.cover-placeholder-sm {
    width: 80px; height: 60px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-400);
}
.favorite-info { flex: 1; }
.favorite-info h4 { font-size: 0.9rem; margin-bottom: 4px; }
.favorite-info h4 a { color: var(--gray-800); }
.favorite-category { font-size: 0.8rem; color: var(--gray-400); margin-right: 8px; }
.favorite-price { font-size: 0.9rem; font-weight: 600; color: var(--danger); }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 32px;
}
.page-btn {
    padding: 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: 0.85rem;
    transition: var(--transition);
}
.page-btn:hover, .page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 20px; }
.empty-state.small { padding: 30px; }

/* ---- Footer ---- */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 48px 0 24px;
    margin-top: 48px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 32px; margin-bottom: 32px; }
.footer-col h3 { color: #fff; font-size: 1.2rem; margin-bottom: 12px; }
.footer-col h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer-col p { font-size: 0.85rem; line-height: 1.7; }
.footer-col a { display: block; color: var(--gray-400); font-size: 0.85rem; padding: 3px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--gray-700); padding-top: 20px; text-align: center; font-size: 0.85rem; }

/* ---- Utility ---- */
.text-muted { color: var(--gray-400); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 0.95rem; }
    .detail-header { flex-direction: column; }
    .detail-gallery { width: 100%; }
    .search-page { flex-direction: column; }
    .search-sidebar { width: 100%; }
    .user-page { flex-direction: column; }
    .user-sidebar { width: 100%; }
    .footer-grid { grid-template-columns: 1fr; }
    .nav { display: none; }
    .mobile-menu-btn { display: block; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
