/* ===== Hleli - Product Page Styles ===== */
:root {
    --purple: #4B1D5F;
    --purple-dark: #3a1650;
    --purple-light: #6b2d85;
    --navy: #1D293E;
    --navy-light: #2a3a52;
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-500: #9E9E9E;
    --gray-700: #616161;
    --gray-900: #212121;
    --green: #2E7D32;
    --green-light: #E8F5E9;
    --red: #E53935;
    --gold: #f5a623;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: 0.2s ease;
    --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--white);
    color: var(--gray-900);
    line-height: 1.6;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Top Bar ===== */
.top-bar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    font-size: 12px;
    color: var(--gray-700);
    display: none;
}
.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
}
.top-bar-right, .top-bar-left { display: flex; align-items: center; gap: 16px; }
.top-link { display: flex; align-items: center; gap: 4px; transition: color var(--transition); }
.top-link:hover { color: var(--purple); }
.top-social { color: var(--gray-500); transition: color var(--transition); }
.top-social:hover { color: var(--purple); }

/* ===== Header ===== */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}
.logo { justify-self: center; display: flex; align-items: center; }
.logo-img {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    border-radius: 6px;
}
.footer-logo {
    height: 56px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    margin-bottom: 12px;
    border-radius: 6px;
}
.phone-ltr {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}
.logo-text {
    font-size: 32px;
    font-weight: 800;
    color: var(--purple);
    font-style: italic;
    letter-spacing: -1px;
}
.header-search {
    display: none;
    position: relative;
    max-width: 400px;
    width: 100%;
}
.search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 24px;
    background: var(--gray-100);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--purple); }
.search-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}
.header-icons { display: flex; align-items: center; gap: 8px; }
.header-icon {
    position: relative;
    padding: 8px;
    color: var(--gray-700);
    transition: color var(--transition);
    border-radius: 50%;
}
.header-icon:hover { color: var(--purple); background: var(--gray-100); }
.cart-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}
.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-900);
    transition: var(--transition);
    border-radius: 2px;
}
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Navigation ===== */
.main-nav {
    background: var(--navy);
    overflow: hidden;
}
.nav-list {
    list-style: none;
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-link {
    display: block;
    padding: 12px 16px;
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--transition);
}
.nav-link:hover, .nav-link.highlight { background: var(--navy-light); }
.nav-link.highlight { color: #ffd54f; }

/* ===== Breadcrumb ===== */
.breadcrumb {
    padding: 12px 0;
    font-size: 13px;
    color: var(--gray-500);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.breadcrumb a:hover { color: var(--purple); }
.breadcrumb .current { color: var(--gray-900); font-weight: 500; }
.breadcrumb .sep { color: var(--gray-300); }

/* ===== Product Section ===== */
.product-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

/* Gallery */
.product-gallery { width: 100%; }
.gallery-main {
    position: relative;
    background: var(--gray-50);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    max-height: 500px;
}
.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.gallery-zoom {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: var(--shadow);
    transition: background var(--transition);
}
.gallery-zoom:hover { background: var(--white); }
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: var(--shadow);
    transition: background var(--transition);
    opacity: 0;
}
.gallery-main:hover .gallery-arrow { opacity: 1; }
.gallery-arrow:hover { background: var(--white); }
.gallery-prev { right: 12px; }
.gallery-next { left: 12px; }
.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.thumb-btn {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}
.thumb-btn.active, .thumb-btn:hover { border-color: var(--purple); }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }

/* Product Details */
.product-details { width: 100%; }
.product-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}
.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.stars { display: flex; gap: 2px; }
.review-link { font-size: 13px; color: var(--gray-500); }
.review-link:hover { color: var(--purple); }
.product-price { margin-bottom: 20px; }
.price-current {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
}

/* Options */
.option-group { margin-bottom: 20px; }
.option-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-700);
}
.option-label span { color: var(--purple); font-weight: 700; }

/* Colors */
.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.color-btn {
    width: 56px;
    height: 56px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    padding: 2px;
    transition: border-color var(--transition), transform var(--transition);
}
.color-btn:hover { transform: scale(1.05); }
.color-btn.active { border-color: var(--purple); border-width: 3px; }
.color-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }

/* Sizes */
.size-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn {
    min-width: 48px;
    height: 44px;
    padding: 0 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    transition: all var(--transition);
}
.size-btn:hover { border-color: var(--purple); color: var(--purple); }
.size-btn.active {
    background: var(--purple);
    border-color: var(--purple);
    color: var(--white);
}

/* Offers */
.offers-list { display: flex; flex-direction: column; gap: 8px; }
.offer-card {
    display: block;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    position: relative;
}
.offer-card:hover { border-color: var(--purple-light); }
.offer-card.selected { border-color: var(--purple); background: #faf5fc; }
.offer-card.popular { border-color: var(--purple); }
.offer-card input { position: absolute; opacity: 0; pointer-events: none; }
.offer-content { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.offer-label { font-size: 14px; font-weight: 500; }
.offer-price { font-size: 16px; font-weight: 700; color: var(--purple); }
.popular-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: var(--purple);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}

/* Bundle */
.bundle-section {
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}
.bundle-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--gray-700); }
.bundle-rows { display: flex; flex-direction: column; gap: 10px; }
.bundle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
}
.bundle-row label { font-size: 12px; color: var(--gray-500); }
.bundle-row select {
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--white);
    outline: none;
}
.bundle-row select:focus { border-color: var(--purple); }

/* Order Form */
.order-form-section {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 8px;
}
.order-form-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-900);
}
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-700);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--gray-50);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(75, 29, 95, 0.1);
    background: var(--white);
}
.form-group input.error,
.form-group select.error,
.form-group textarea.error { border-color: var(--red); }

/* Order Summary */
.order-summary {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin: 16px 0;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}
.summary-row span:first-child { color: var(--gray-500); }
.form-group input.phone-ltr,
.form-group textarea.phone-ltr {
    direction: ltr;
    text-align: left;
}
.summary-row span:last-child {
    font-weight: 600;
    color: var(--gray-900);
}
.shipping-row span:last-child {
    color: var(--gray-700);
}
.total-row {
    border-top: 1px solid var(--gray-200);
    margin-top: 6px;
    padding-top: 10px;
    font-size: 16px;
    font-weight: 700;
}
.total-row span:last-child { color: var(--purple); font-size: 18px; }

/* Order Actions */
.order-actions {
    display: flex;
    gap: 12px;
    align-items: stretch;
}
.qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.qty-btn {
    width: 40px;
    height: 48px;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-700);
    transition: background var(--transition);
}
.qty-btn:hover { background: var(--gray-100); }
.qty-selector input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--gray-300);
    border-right: 1px solid var(--gray-300);
    font-size: 16px;
    font-weight: 600;
    background: var(--white);
    -moz-appearance: textfield;
}
.qty-selector input::-webkit-outer-spin-button,
.qty-selector input::-webkit-inner-spin-button { -webkit-appearance: none; }
.btn-order {
    flex: 1;
    background: var(--purple);
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), transform var(--transition);
    min-height: 48px;
}
.btn-order:hover { background: var(--purple-dark); }
.btn-order:active { transform: scale(0.98); }
.btn-order:disabled { opacity: 0.6; cursor: not-allowed; }
.form-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: none;
}
.form-message.success { display: block; background: var(--green-light); color: var(--green); }
.form-message.error { display: block; background: #FFEBEE; color: var(--red); }

/* Related Products */
.related-section { padding: 40px 0; border-top: 1px solid var(--gray-200); }
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.product-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-image {
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--gray-50);
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-info { padding: 10px 12px; }
.card-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; line-height: 1.3; }
.card-price { font-size: 15px; font-weight: 700; }

/* Zoom Modal */
.zoom-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.zoom-modal.active { display: flex; }
.zoom-modal img { max-width: 90vw; max-height: 90vh; object-fit: contain; }
.zoom-close {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 36px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.8);
    padding: 40px 0 20px;
    margin-top: 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.footer-col h4 { color: white; font-size: 16px; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; font-size: 14px; }
.footer-col a:hover { color: white; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
    text-align: center;
    font-size: 13px;
}

/* Install Page */
.install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}
.install-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 480px;
}
.install-box h1 { color: var(--purple); margin-bottom: 12px; }
.install-box ul { list-style: none; margin-top: 20px; }
.install-box li { margin: 8px 0; }
.install-box a { color: var(--purple); font-weight: 600; }

/* ===== Admin Styles ===== */
.admin-body { background: var(--gray-100); min-height: 100vh; }
.admin-header {
    background: var(--navy);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-header h1 { font-size: 20px; }
.admin-header a { color: rgba(255,255,255,0.8); font-size: 14px; }
.admin-header a:hover { color: white; }
.admin-nav {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    display: flex;
    gap: 0;
    overflow-x: auto;
}
.admin-nav a {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.admin-nav a:hover, .admin-nav a.active { color: var(--purple); border-bottom-color: var(--purple); }
.admin-content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.admin-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.admin-card h2 { font-size: 18px; margin-bottom: 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
}
.admin-table th { background: var(--gray-50); font-weight: 600; color: var(--gray-700); }
.admin-table tr:hover td { background: var(--gray-50); }
.admin-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition);
}
.admin-btn-primary { background: var(--purple); color: white; }
.admin-btn-primary:hover { background: var(--purple-dark); }
.admin-btn-danger { background: var(--red); color: white; }
.admin-btn-danger:hover { background: #c62828; }
.admin-btn-sm { padding: 4px 10px; font-size: 12px; }
.admin-form .form-group { margin-bottom: 16px; }
.admin-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.admin-form input, .admin-form select, .admin-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
    border-color: var(--purple);
    outline: none;
}
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--purple); }
.stat-card .stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.status-pending { background: #FFF3E0; color: #E65100; }
.status-confirmed { background: var(--green-light); color: var(--green); }
.status-cancelled { background: #FFEBEE; color: var(--red); }
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
}
.login-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}
.login-box h1 { text-align: center; color: var(--purple); margin-bottom: 24px; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #FFEBEE; color: var(--red); }
.alert-success { background: var(--green-light); color: var(--green); }

/* ===== Responsive ===== */
@media (min-width: 640px) {
    .related-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
    .gallery-arrow { opacity: 1; }
}

@media (min-width: 768px) {
    .top-bar { display: block; }
    .header-inner {
        grid-template-columns: 1fr auto 1fr;
        padding: 16px;
    }
    .logo { justify-self: start; order: 3; }
    .logo-img { height: 56px; max-width: 200px; }
    .header-search { display: flex; order: 2; justify-self: center; }
    .header-icons { order: 1; }
    .mobile-menu-btn { display: none; }
    .product-section {
        flex-direction: row;
        gap: 40px;
        align-items: flex-start;
    }
    .product-gallery { width: 50%; position: sticky; top: 80px; }
    .product-details { width: 50%; }
    .product-title { font-size: 26px; }
    .related-grid { grid-template-columns: repeat(4, 1fr); }
    .bundle-row { grid-template-columns: auto 1fr 1fr; }
}

@media (min-width: 1024px) {
    .container { padding: 0 24px; }
    .product-gallery { width: 48%; }
    .product-details { width: 52%; }
    .gallery-main { max-height: 600px; }
}

@media (max-width: 767px) {
    .gallery-arrow { opacity: 1; width: 32px; height: 32px; }
    .order-actions { flex-direction: column; }
    .qty-selector { justify-content: center; }
    .main-nav { max-height: 0; transition: max-height 0.3s ease; }
    .main-nav.open { max-height: 300px; }
    .nav-list { flex-direction: column; }
    .nav-link { padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px 6px; }
}
