* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

:root {
    --primary: #e84393;
    --primary-light: #ff6b9d;
    --bg: #fff0f5;
    --card-bg: #ffffff;
    --text: #333333;
    --muted: #777777;
    --border: #f0c6d7;
    --shadow: 0 4px 14px rgba(232,67,147,0.15);
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    background: var(--bg);
    color: var(--text);
}

/* Container اصلی */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    box-shadow: 0 0 30px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
}
@media (min-width: 768px) {
    .app-container {
        max-width: 720px;
        border-radius: 28px;
        margin: 20px auto;
    }
}
@media (min-width: 1024px) {
    .app-container {
        max-width: 1024px;
    }
}

/* Screen management */
.screen {
    display: none;
    flex-direction: column;
    flex: 1;
}
.screen.active {
    display: flex;
}

/* HEADER اصلی فروشگاه */
.store-header {
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--border);
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.logo {
    font-size: 1.8rem;
}
.brand-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    flex: 1;
    text-align: center;
}
.header-icons {
    display: flex;
    gap: 12px;
    color: var(--primary);
    font-size: 1.5rem;
}
.header-icons span {
    cursor: pointer;
    position: relative;
}
.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search bar */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 25px;
    background: #fff5f8;
    font-size: 0.9rem;
}
.search-bar button {
    background: var(--primary);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    white-space: nowrap;
}

/* Categories slider */
.categories-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar {
    display: none;
}
.category-pill {
    background: #fff0f5;
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.category-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}
@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(232,67,147,0.25);
}
.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #ffe4ec;
}
.product-info {
    padding: 10px;
}
.product-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}
.product-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

/* Product Detail */
.product-detail {
    padding: 16px;
}
.image-slider {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 12px;
    scroll-snap-type: x mandatory;
}
.image-slider img {
    height: 280px;
    border-radius: var(--radius-sm);
    scroll-snap-align: start;
    object-fit: cover;
    background: #ffe4ec;
}
.detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.detail-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}
.option-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.size-options, .color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.size-box {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 25px;
    font-size: 0.85rem;
    cursor: pointer;
    background: #fff5f8;
}
.size-box.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.color-dot {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    background: #fff5f8;
}
.color-dot.selected {
    border-color: var(--primary);
    background: #ffe4ec;
}
.color-dot span:first-child {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 25px;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.btn-primary:hover {
    background: var(--primary-light);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 10px;
    border-radius: 25px;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
}

/* Cart, Orders, Login etc – basic styling kept */
.cart-item {
    display: flex;
    gap: 12px;
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    background: #ffe4ec;
}

.sub-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.sub-header span {
    cursor: pointer;
    font-size: 1.4rem;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}
.login-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 340px;
    box-shadow: var(--shadow);
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 25px;
    margin-bottom: 12px;
    background: #fff5f8;
}

/* Admin panel */
.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-bottom: 1px solid var(--border);
}
.tab-btn {
    background: #fff0f5;
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
}
.tab-btn.active {
    background: var(--primary);
    color: white;
}