:root {
    --primary-color: #333;
    --accent-color: #6a1b9a;
    /* Purple to match logo */
    --bg-color: #f9f9f9;
    --card-bg: #fff;
    --text-color: #333;
    --gray-text: #666;
    --border-color: #eee;
    --spacing-md: 16px;
    --spacing-sm: 8px;
    --radius: 8px;
    --header-height: 100px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding-top: var(--header-height);
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    height: 60px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.logo-container {
    height: 28px;
}

.logo {
    height: 100%;
    width: auto;
    object-fit: contain;
}

/* Tabs */
.category-nav {
    height: 40px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.tabs-container {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    height: 100%;
    padding: 0 var(--spacing-sm);
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--spacing-md);
    font-size: 14px;
    color: var(--gray-text);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.tab.active {
    color: var(--accent-color);
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 3px 3px 0 0;
}

/* Product Grid */
.product-grid {
    padding: var(--spacing-md);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

/* Image Container (handles both static and carousel) */
.image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Square images usually look best for products */
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* or contain, depending on image quality */
    display: block;
}

/* Carousel specific styles */
.carousel-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    width: 100%;
    height: 100%;
    scrollbar-width: none;
}

.carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: center;
}

.carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.3s;
}

.dot.active {
    background: var(--accent-color);
}

.product-info {
    padding: var(--spacing-sm);
    text-align: center;
}

.product-name {
    font-size: 13px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
}

#modal-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}