/* ===== INSTASHOP - Instagram Flat Design ===== */

/* بارگذاری فونت yekan از پوشه assets/fonts */
@font-face {
  font-family: 'Yekan';
  src: url('/assets/fonts/yekan.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #E1306C;
    --primary-dark: #C13584;
    --bg: #FAFAFA;
    --bg-white: #FFFFFF;
    --text: #262626;
    --text-light: #8E8E8E;
    --border: #DBDBDB;
    --border-light: #EFEFEF;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --radius-sm: 8px;
    --radius-md: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --max-width: 800px;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Yekan', system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
    line-height: 1.4;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    overflow-x: hidden;
}

main {
    padding-bottom: 70px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; height: auto; display: block; }

/* ===== SITE WRAPPER (Centered Layout) ===== */
.site-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--bg);
    min-height: calc(100vh - 60px);
}

/* ===== HEADER ===== */
.app-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header .logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Billabong', yekan, sans-serif;
}

.app-header .logo img {
    height: 32px;
    width: auto;
}

/* ===== STORIES ===== */
.stories-container {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.stories-container::-webkit-scrollbar { display: none; }

.stories-wrapper {
    display: flex;
    gap: 20px;
    padding: 0 16px;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.story-item:active { transform: scale(0.95); }

.story-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.story-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-sizing: border-box;
}

.story-name {
    font-size: 11px;
    color: var(--text);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== STORY VIEWER ===== */
.story-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 10000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.story-viewer.active { display: flex; }

.story-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.story-content img,
.story-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-progress-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.story-progress-item {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width linear;
}

.story-close {
    position: absolute;
    top: 24px;
    right: 16px;
    color: #fff;
    z-index: 20;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
}

.story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 5;
}

.story-nav-prev { left: 0; }
.story-nav-next { right: 0; }

/* ===== HIGHLIGHTS ===== */
.highlights-container {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.highlights-container::-webkit-scrollbar { display: none; }

.highlights-wrapper {
    display: flex;
    gap: 20px;
    padding: 0 16px;
}

.highlight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.highlight-item:active { transform: scale(0.95); }

.highlight-item.active .highlight-circle {
    border: 2px solid var(--primary);
}

.highlight-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.highlight-name {
    font-size: 13px;
    font-weight: bold;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

/* ===== FEED ===== */
.feed-container {
    padding: 0;
}

/* ===== PRODUCT CARD ===== */
.product-card {
    background: var(--bg-white);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.product-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), #F56040);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

.author-info h4 {
    font-size: 13px;
    font-weight: 600;
}

.author-info span {
    font-size: 11px;
    color: var(--text-light);
}

.btn-more {
    padding: 4px;
    color: var(--text);
}

.product-image-link {
    display: block;
}

.product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg);
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-slider {
    display: flex;
    width: 100%;
    height: 100%;
}

.product-image-slider img {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.image-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: background 0.3s;
}

.image-dot.active { background: var(--primary); }

.product-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0,0,0,0.7);
    color: #fff;
}

.product-type-badge.digital { background: #3B82F6; }
.product-type-badge.video { background: #8B5CF6; }

.product-actions {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
}

.action-left {
    display: flex;
    gap: 14px;
}

.action-btn {
    color: var(--text);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.action-btn:active { transform: scale(0.9); opacity: 0.7; }

.action-btn svg {
    width: 24px;
    height: 24px;
}

.product-info {
    padding: 0 16px 16px;
}

.product-title-link {
    display: block;
    margin-bottom: 4px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.product-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.5;
}

.product-price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sale-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.original-price {
    font-size: 11px;
    color: #f16565;
    font-weight: bold;
    text-decoration: line-through;
}

.discount-badge {
    background: var(--error);
    color: #fff;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.stock-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.stock-status.in-stock { background: #D1FAE5; color: #065F46; }
.stock-status.low-stock { background: #FEF3C7; color: #92400E; }
.stock-status.out-stock { background: #FEE2E2; color: #991B1B; }

.add-to-cart-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #C13584 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}

.add-to-cart-btn:hover { background: linear-gradient(175deg, var(--primary) 0%, #C13584 100%); }
.add-to-cart-btn:disabled { background: #ccc; cursor: not-allowed; }
.add-to-cart-btn:active:not(:disabled) { transform: scale(0.98); }

/* ===== PRODUCT DETAIL - 50/50 LAYOUT ===== */
.product-detail-layout {
    background: var(--bg-white);
    min-height: calc(100vh - 60px);
}

.product-detail-image {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.product-detail-image img {
    width: 100%;
    object-fit: cover;
}

.product-detail-info {
    padding: 16px;
}

.product-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.product-author-large {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), #F56040);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.author-info-large h2 {
    font-size: 14px;
    font-weight: 600;
}

.author-info-large span {
    font-size: 12px;
    color: var(--text-light);
}

.product-detail-body {
    margin-bottom: 20px;
}

.product-title-large {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stock-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.stock-badge.in-stock { background: #D1FAE5; color: #065F46; }
.stock-badge.low-stock { background: #FEF3C7; color: #92400E; }
.stock-badge.out-stock { background: #FEE2E2; color: #991B1B; }

.sku-text {
    font-size: 12px;
    color: var(--text-light);
}

.product-price-large {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.sale-price-large {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.original-price-large {
    font-size: 15px;
    color: var(--text-light);
    text-decoration: line-through;
}

.discount-badge-large {
    background: var(--error);
    color: #fff;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

.digital-notice {
    background: #EFF6FF;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    color: #1E40AF;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    justify-content: center;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-white);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.qty-btn:hover { background: var(--bg); }
.qty-btn:active { background: var(--border-light); transform: scale(0.95); }

.qty-value {
    font-size: 18px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.btn-buy {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.btn-buy:hover { background: var(--primary-dark); }
.btn-buy:disabled { background: #ccc; cursor: not-allowed; }
.btn-buy:active:not(:disabled) { transform: scale(0.98); }

.product-detail-desc {
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
}

.product-detail-desc h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.product-detail-desc p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-light);
}

/* ===== EXPLORE / SEARCH ===== */
.search-box-container {
    padding: 12px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 50px;
    z-index: 50;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    gap: 8px;
}

.search-icon {
    color: var(--text-light);
    flex-shrink: 0;
}

.search-input-wrapper input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 15px;
    outline: none;
    font-family: inherit;
}

.search-btn {
    color: var(--text-light);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.search-results-title {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-light);
}

.search-results-title strong {
    color: var(--text);
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
}

.explore-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
}

.explore-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.explore-item:hover img { transform: scale(1.05); }

.explore-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(255 255 255 / 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
}

.explore-item:hover .explore-item-overlay { opacity: 1; }

.explore-item-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
}

/* ===== CART ===== */
.cart-page {
    padding: 16px;
    padding-bottom: 80px;
    max-width: 800px;
    margin: 0 auto;
}

.cart-page h1 {
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 700;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 14px;
    color: #249701;
    font-weight: 700;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.btn-remove {
    color: var(--error);
    padding: 4px;
    display: flex;
    align-items: center;
}

.btn-remove:active { opacity: 0.7; }

.cart-summary {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.cart-summary-row.total {
    font-size: 16px;
    font-weight: 700;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 12px;
}

.cart-summary-row.total span:last-child {
    color: #249701;
}

.checkout-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #249701 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.checkout-btn:hover { background: var(--primary-dark); }
.checkout-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-notice {
    text-align: center;
    margin-top: 20px;
}

.auth-notice p {
    color: var(--text-light);
    margin-bottom: 12px;
}

/* ===== PROFILE - INSTAGRAM STYLE ===== */
.profile-page-ig {
    background: var(--bg-white);
    min-height: 100vh;
    max-width: 800px;
    margin: 0 auto;
}

.profile-header-ig {
    padding: 20px 16px;
    display: flex;
    gap: 28px;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.profile-avatar-ig {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    padding: 2px;
    flex-shrink: 0;
}

.profile-avatar-ig-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-sizing: border-box;
}

.profile-stats-ig {
    display: flex;
    gap: 24px;
    flex: 1;
    justify-content: space-around;
}

.profile-stat-ig {
    text-align: center;
}

.profile-stat-ig .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.profile-stat-ig .label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

.profile-info-ig {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.profile-name-ig {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.profile-bio-ig {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
    line-height: 1.6;
}

.profile-buttons-ig {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.profile-btn-ig {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-white);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.profile-btn-ig:hover { background: var(--bg); }

.profile-btn-ig.primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.profile-btn-ig.primary:hover { background: var(--primary-dark); }

.profile-contact-ig {
    padding: 16px;
}

.contact-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.profile-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text);
}

.profile-contact-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* ===== ORDERS ===== */
.orders-page {
    padding: 16px;
    padding-bottom: 80px;
    max-width: 800px;
    margin: 0 auto;
}

.orders-page h1 {
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 700;
}

.order-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg);
}

.order-code {
    font-weight: 700;
    font-size: 14px;
}

.order-date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending { background: #FEF3C7; color: #92400E; }
.status-badge.paid { background: #D1FAE5; color: #065F46; }
.status-badge.processing { background: #DBEAFE; color: #1E40AF; }
.status-badge.shipped { background: #E0E7FF; color: #3730A3; }
.status-badge.delivered { background: #D1FAE5; color: #065F46; }
.status-badge.cancelled { background: #FEE2E2; color: #991B1B; }

.order-body {
    padding: 16px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.order-item img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.order-item-info {
    flex: 1;
    min-width: 0;
}

.order-item-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.order-item-qty {
    font-size: 12px;
    color: var(--text-light);
}

.order-total {
    border-top: 1px solid var(--border-light);
    margin-top: 12px;
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 15px;
}

.order-total span:last-child {
    color: var(--primary);
}

/* ===== AUTH / LOGIN ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.auth-box {
    background: var(--bg-white);
    padding: 32px 24px;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-md);
}

.auth-box .logo {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    font-family: 'Billabong', cursive, sans-serif;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 18px;
    color: var(--text-light);
    font-weight: 600;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
    background: var(--bg);
}

.form-control:focus {
    outline: none;
    border-color: var(--text-light);
    background: var(--bg-white);
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #C13584 100%);
    color: #fff;
}

.btn-primary:hover { background: linear-gradient(175deg, var(--primary) 0%, #C13584 100%); }
.btn-primary:active { transform: scale(0.98); }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}


/* ===== DIRECT MENU ===== */
.direct-btn {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #C13584 100%);
    color: #fff;
    border: 2px solid white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 999;
    transition: transform 0.2s;
}

.direct-btn:active { transform: scale(0.95); }

.direct-menu {
    display: none;
    position: fixed;
    bottom: 150px;
    left: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    z-index: 998;
    min-width: 180px;
    border: 1px solid var(--border-light);
}

.direct-menu.active { display: block; }

.direct-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

.direct-menu a:hover { background: var(--bg); }
.direct-menu a:last-child { border-bottom: none; }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    animation: slideDown 0.3s ease;
    text-align: center;
    pointer-events: auto;
    box-shadow: var(--shadow-md);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); color: var(--text); }

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    max-width: 400px;
    margin: 0 auto;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 700;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ===== RESPONSIVE - TABLET ===== */
@media (min-width: 768px) {
    .stories-wrapper,
    .highlights-wrapper {
        padding: 0 24px;
    }

    .product-card {
        border-radius: var(--radius-md);
        overflow: hidden;
        box-shadow: var(--shadow);
        border-bottom: none;
        margin-bottom: 16px;
    }

    .explore-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 4px;
    }

    .story-viewer .story-content {
        max-width: 400px;
        max-height: 700px;
        aspect-ratio: 9/16;
        border-radius: var(--radius-md);
        overflow: hidden;
    }

    .story-close {
        right: calc(50% - 180px);
    }
}

/* ===== RESPONSIVE - DESKTOP ===== */
@media (min-width: 1024px) {
    body {
        background: var(--bg);
        max-width: 800px;
        margin: auto;
    }

    .feed-container{
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .site-wrapper {
        display: grid;
        gap: 5px;
        padding: 5px;
        max-width: 100%;
    }

    /* Stories and categories full width */
    .stories-container,
    .highlights-container {
        grid-column: 1 / -1;
        border-radius: var(--radius-md);
        height: fit-content;
    }

    /* Product cards in grid */
    .product-card {
        margin-bottom: 0;
        display: grid;
        align-content: space-between;
    }

    /* Full width pages */
    .product-detail-layout,
    .cart-page,
    .profile-page-ig,
    .orders-page,
    .auth-page,
    .search-box-container,
    .search-results-title,
    .explore-grid,
    .empty-state {
        grid-column: 1 / -1;
    }

    /* Product detail 50/50 */
    .product-detail-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        border-radius: var(--radius-md);
        overflow: hidden;
        box-shadow: var(--shadow-md);
    }

    .product-detail-image {
        aspect-ratio: auto;
        height: 100%;
        min-height: 500px;
    }

    .product-detail-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 32px;
    }

    /* Explore grid larger */
    .explore-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Cart & Orders centered */
    .cart-page,
    .orders-page {
        max-width: 800px;
        margin: 0 auto;
    }

    /* Story viewer centered */
    .story-viewer {
        background: rgba(0,0,0,0.95);
    }

    .story-viewer .story-content {
        max-width: 450px;
        max-height: 800px;
    }

    .story-close {
        right: calc(50% - 225px);
    }

    .story-nav {
        position: fixed;
        width: calc((100% - 450px) / 2);
    }
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== MODALS ===== */
.ig-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ig-modal-overlay.active { display: flex; }

.ig-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.ig-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ig-border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.ig-modal-title { font-size: 16px; font-weight: 700; }

.ig-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--ig-text);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ig-modal-close:hover { background: var(--ig-bg-secondary); }

.ig-modal-body { padding: 20px; }
