:root {
    --primary: #25D366; 
    --primary-dark: #1ebd5a;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --bg-main: #f4f7f6;
    --bg-card: #ffffff;
    --border: #e0e6ed;
    --radius: 12px;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    direction: rtl;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
header {
    background: var(--bg-card);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}
.logo { 
    display: flex;
    align-items: center;
    font-size: 22px; 
    font-weight: 800; 
    color: var(--primary); 
    text-transform: uppercase;
}
.logo img { max-height: 45px; margin-left: 10px; }

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 20px;
}
.nav-tabs a {
    font-weight: 600;
    color: var(--text-main);
    padding: 5px 0;
    position: relative;
}
.nav-tabs a:after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primary);
    transition: 0.3s;
}
.nav-tabs a:hover:after { width: 100%; }

/* Cart Icon */
.cart-btn {
    position: relative;
    background: #f0f2f5;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-main);
}
.cart-count {
    position: absolute;
    top: -5px; right: -5px;
    background: #ff4757;
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: bold;
    border: 2px solid white;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

/* Product Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-8px); box-shadow: 0 12px 20px rgba(0,0,0,0.1); }
.card-img-wrapper { position: relative; overflow: hidden; height: 250px; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.card:hover img { transform: scale(1.05); }

.card-body { padding: 20px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-title { margin: 0 0 10px 0; font-size: 18px; font-weight: 700; color: #2d3436; }
.card-price { color: var(--primary); font-weight: 800; font-size: 20px; margin-bottom: 20px; }

.btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: 0.3s;
}
.btn:hover { background: var(--primary-dark); box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    z-index: 10000;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    pointer-events: none;
    opacity: 0;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Product Details */
.product-details { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 40px; background: white; padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); }
.product-image { flex: 1.2; min-width: 300px; }
.product-image img { width: 100%; border-radius: var(--radius); object-fit: cover; }
.product-info { flex: 1; min-width: 300px; }
.product-info h1 { margin-top: 0; color: #2d3436; }
.product-desc { color: var(--text-muted); margin-bottom: 30px; white-space: pre-wrap; font-size: 16px; }

/* Variations */
.variations { margin-bottom: 25px; }
.variation-label { font-weight: bold; margin-bottom: 10px; display: block; }
.variation-options { display: flex; gap: 10px; flex-wrap: wrap; }
.variation-option { 
    border: 2px solid var(--border); 
    padding: 8px 15px; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.2s;
    font-size: 14px;
}
.variation-option.active { border-color: var(--primary); background: rgba(37, 211, 102, 0.1); color: var(--primary); font-weight: bold; }

/* Sharing */
.share-buttons { margin-top: 30px; display: flex; gap: 10px; }
.share-btn { 
    padding: 10px 20px; 
    border-radius: 8px; 
    color: white; 
    font-size: 14px; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.share-fb { background: #1877F2; }
.share-wa { background: #25D366; }

/* Cart Page */
.cart-item { display: flex; align-items: center; background: var(--bg-card); padding: 15px; margin-bottom: 15px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.cart-item img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; margin-left: 20px; }
.cart-item-details { flex-grow: 1; }
.cart-qty { display: flex; align-items: center; gap: 15px; }
.cart-qty button { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: white; cursor: pointer; border-radius: 6px; font-weight: bold; }
.cart-qty button:hover { border-color: var(--primary); color: var(--primary); }

/* Admin Sidebar */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { 
    width: 260px; 
    background: #2c3e50; 
    color: white; 
    transition: 0.3s; 
    position: fixed; 
    height: 100vh; 
    z-index: 1001;
    right: 0;
}
.admin-sidebar.hidden { right: -260px; }
.admin-main { flex-grow: 1; padding: 30px; transition: 0.3s; margin-right: 260px; }
.admin-main.full { margin-right: 0; }
.sidebar-header { padding: 25px; font-size: 20px; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-nav { padding: 20px 0; }
.sidebar-nav a { display: block; padding: 12px 25px; color: #bdc3c7; transition: 0.2s; border-right: 4px solid transparent; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,0.05); color: white; border-right-color: var(--primary); }

.sidebar-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Mobile fixes */
@media (max-width: 768px) {
    .nav-tabs { display: none; } /* Hide tabs on mobile, or move to menu */
    .grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .card-img-wrapper { height: 180px; }
    .product-details { padding: 20px; }
    .admin-sidebar { right: -260px; }
    .admin-sidebar.show { right: 0; }
    .admin-main { margin-right: 0; }
    .sidebar-toggle { display: flex; }
}

@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
    .card-img-wrapper { height: 250px; }
}

