/* ===== CSS Variables & Reset ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --success: #16a34a;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --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);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.main {
    flex: 1;
    padding: 2rem 0;
}

/* ===== Header ===== */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.logo:hover {
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    border-radius: var(--radius);
    transition: all 0.2s;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lang-switch {
    display: flex;
    gap: 2px;
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 2px;
}

.lang-btn {
    padding: 4px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    transition: all 0.2s;
}

.lang-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

.cart-link {
    padding: 0.5rem;
    color: var(--gray-600);
    font-size: 1.2rem;
    position: relative;
}

.cart-link:hover {
    color: var(--primary);
    text-decoration: none;
}

#cart-count {
    position: absolute;
    top: -2px;
    right: -6px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero h1 {
    font-size: 2rem;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    color: var(--gray-500);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Services Grid ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0 3rem;
}

.service-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.service-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--gray-100);
}

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.5rem 0;
}

.service-emoji {
    font-size: 3rem;
    line-height: 1;
}

.service-icon-cell {
    text-align: center;
}

.service-icon {
    font-size: 1.5rem;
}

.service-card-body {
    padding: 1.5rem;
    flex: 1;
}

.service-name {
    font-size: 1.15rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.service-desc {
    color: var(--gray-500);
    font-size: 0.9rem;
    line-height: 1.5;
}

.service-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.service-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.btn-add-to-cart {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* ===== Auth Section ===== */
.auth-section {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.auth-forgot {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.auth-forgot a {
    color: var(--primary);
    font-weight: 500;
}

.auth-description {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.auth-tabs {
    display: flex;
    gap: 2px;
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 2px;
    margin-bottom: 1.25rem;
}

.auth-tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-500);
    transition: all 0.2s;
}

.auth-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.error-message {
    background: #fef2f2;
    color: var(--danger);
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.success-message {
    background: #f0fdf4;
    color: var(--success);
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* ===== Cart ===== */
.page-section {
    padding: 1rem 0 3rem;
}

.page-section h1 {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.cart-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-collapse: collapse;
}

.cart-table th,
.cart-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.cart-table th {
    background: var(--gray-50);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.05em;
}

.service-name-cell {
    font-weight: 500;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-qty {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--gray-600);
}

.btn-qty:hover {
    background: var(--gray-50);
}

.qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 500;
}

.item-total {
    font-weight: 600;
}

.cart-summary {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
}

.cart-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* ===== Checkout ===== */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.checkout-items h2,
.checkout-form h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

/* ===== Orders ===== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.order-date {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-left: 1rem;
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.order-body {
    padding: 1rem 1.25rem;
}

.order-items {
    margin-top: 0.5rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* ===== Contact ===== */
.contact-grid {
    display: flex;
    justify-content: center;
}

.contact-info-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
}

.contact-info-card h2 {
    margin-bottom: 1.5rem;
    color: var(--gray-800);
}

.contact-item {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.contact-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-right: 0.5rem;
}

/* ===== Forum ===== */
.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.forum-header h1 {
    margin-bottom: 0;
}

.forum-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.forum-breadcrumb a {
    color: var(--primary);
}

.forum-breadcrumb .separator {
    color: var(--gray-400);
}

.forum-categories {
    margin-bottom: 2rem;
}

.forum-categories h2 {
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.category-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}

.category-icon {
    font-size: 1.5rem;
}

.category-name {
    font-weight: 600;
    color: var(--gray-800);
}

.category-count {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.category-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.forum-topics h2 {
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.topic-item {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.topic-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.topic-item.pinned {
    border-left: 3px solid var(--warning);
}

.topic-main {
    flex: 1;
    min-width: 0;
}

.topic-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.badge {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-pinned {
    background: #fef3c7;
    color: #92400e;
}

.badge-closed {
    background: #fee2e2;
    color: #991b1b;
}

.topic-category-badge {
    font-size: 0.8rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
}

.topic-title {
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.topic-stats {
    display: flex;
    gap: 1rem;
    margin-left: 1rem;
}

.stat {
    text-align: center;
    min-width: 50px;
}

.stat-value {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-400);
}

/* Topic page */
.topic-header-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.topic-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topic-header-top h1 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin: 0;
}

.topic-header-badges {
    display: flex;
    gap: 0.5rem;
}

.topic-header-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.forum-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forum-post {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.forum-post.first-post {
    border-left: 3px solid var(--primary);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.post-date {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.post-content {
    color: var(--gray-700);
    line-height: 1.7;
    font-size: 0.95rem;
    padding-left: 3rem;
}

.closed-notice {
    text-align: center;
    padding: 2rem;
    color: var(--gray-400);
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-400);
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* ===== Guest Checkout ===== */
.guest-notice {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--primary-dark);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

.badge-guest {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* ===== Footer ===== */
.footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-inner {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .checkout-grid {
        grid-template-columns: 1fr;
    }

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

    .cart-table {
        font-size: 0.85rem;
    }

    .cart-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .hero h1 {
        font-size: 1.5rem;
    }
}
