display: none; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 0.7rem; letter-spacing: 0.3em; padding: 0.45rem 1rem; cursor: pointer; text-transform: uppercase; } .miolora-control { border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 0.75rem; padding: 0.5rem 0.9rem; text-transform: uppercase; letter-spacing: 0.2em; } header:not(.miolora-site-header), footer:not(.miolora-site-footer), .site-header, .site-footer, .wp-site-header, .wp-site-footer, .wp-block-template-part { display: none !important; } .wp-block-navigation { display: none !important; } header.wp-block-template-part > nav, header.wp-block-template-part .wp-block-navigation, footer.wp-block-template-part > nav, footer.wp-block-template-part .wp-block-navigation { display: none !important; } @media (max-width: 900px) { .miolora-site-nav { position: absolute; top: 100%; left: 0; right: 0; padding: 1rem; flex-direction: column; gap: 0.75rem; background: rgba(19, 10, 10, 0.95); display: none; z-index: 999; border-radius: 0 0 24px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); } .miolora-site-nav[data-open="true"] { display: flex; } .miolora-nav-toggle { display: inline-flex; } } .miolora-hero { display: flex; justify-content: space-between; gap: 2rem; padding: 40px; border-radius: 36px; background: radial-gradient(circle at top right, rgba(210,176,109,0.25), transparent 55%), #4a0e0e; flex-wrap: wrap; } .miolora-hero--compact { padding: 30px; background: rgba(74, 14, 14, 0.9); border-radius: 30px; } .miolora-kicker { letter-spacing: 0.35em; text-transform: uppercase; font-weight: 600; margin-bottom: 12px; color: #d2b06d; } .miolora-hero h1 { font-size: clamp(2.5rem, 4vw, 4rem); margin: 0 0 1rem; font-family: "Playfair Display", serif; } .miolora-lead { max-width: 32rem; line-height: 1.6; color: rgba(255, 255, 255, 0.88); } .miolora-hero-card { min-width: 240px; padding: 2rem; border-radius: 24px; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(8px); } .miolora-section { margin-top: 40px; } .miolora-section h2 { margin-bottom: 20px; letter-spacing: 0.2em; color: #d2b06d; } .miolora-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; } .miolora-category-card { padding: 24px; border-radius: 20px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 0.5rem; } .miolora-category-card .mini { font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); } .miolora-category-actions { margin-top: 1rem; } .miolora-category-actions .miolora-link { font-weight: 700; letter-spacing: 0.18em; } .miolora-site-footer { margin-top: 60px; padding: 40px; border-radius: 32px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(19, 10, 10, 0.9); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55); } .miolora-site-footer-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; } .miolora-site-footer-brand { display: flex; gap: 0.75rem; align-items: center; } .miolora-site-footer-quote { font-size: 0.85rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); } .miolora-footer-tagline { font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase; } .miolora-site-footer-grid { margin-top: 2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; } .miolora-site-footer-section { display: flex; flex-direction: column; gap: 0.35rem; } .miolora-site-footer-section .mini { font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase; color: #d2b06d; } .miolora-site-footer-section a { color: rgba(255, 255, 255, 0.85); text-decoration: none; letter-spacing: 0.12em; font-size: 0.85rem; } .miolora-site-footer-note { margin-top: 2rem; color: rgba(255, 255, 255, 0.65); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; text-align: center; } .miolora-products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; } .miolora-product-card, .miolora-card { padding: 24px; border-radius: 20px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 12px; } .miolora-product-card h3, .miolora-card h3 { margin: 0; font-size: 1.2rem; } .miolora-meta { font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.6; } .miolora-card-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; } .miolora-price { font-weight: 700; } .miolora-link { font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: #d2b06d; } .miolora-collection { margin-top: 32px; } .miolora-collection-heading { display: flex; justify-content: space-between; align-items: center; } .miolora-collection-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; } @media (max-width: 720px) { .miolora-hero, .miolora-hero--compact { flex-direction: column; padding: 30px; } .miolora-card-footer { flex-direction: column; align-items: flex-start; gap: 8px; } } HTML; } public function hide_wordpress_credit() { echo << #site-generator, .powered-by, .powered-by-wordpress, footer .site-info, .site-info a { display: none !important; } HTML; } private function render_site_header(bool $compact = false) { $currentLang = $this->current_language(); $sections = $this->site_nav_sections($currentLang); $sectionHtml = ''; foreach ($sections as $section) { $items = ''; foreach ($section['items'] as $item) { $activeClass = $this->is_current_nav_item($item['href']) ? ' miolora-nav-link-active' : ''; $items .= sprintf( '%s', $activeClass, esc_url($item['href']), esc_html($item['label']) ); } $sectionHtml .= sprintf( '
%s
%s
', esc_html($section['label']), $items ); } $currentLang = $this->current_language(); return <<
M
MIOLORA
Own the Glow
HTML; } private function site_nav_sections(string $lang): array { return [ [ 'label' => $this->translate_label($lang, 'Ritual', 'الطقوس'), 'items' => [ ['href' => home_url('/consultation/'), 'label' => $this->translate_label($lang, 'Consultation', 'الاستشارة')], ['href' => home_url('/consultation/?flow=quiz'), 'label' => $this->translate_label($lang, 'Quiz', 'اختبار')], ['href' => home_url('/account/?tab=progress'), 'label' => $this->translate_label($lang, 'Progress Tracker', 'تتبع')], ], ], [ 'label' => $this->translate_label($lang, 'Vault', 'الخزينة'), 'items' => [ ['href' => home_url('/products/'), 'label' => $this->translate_label($lang, 'Shop', 'السوق')], ['href' => home_url('/catalog/?view=goal'), 'label' => $this->translate_label($lang, 'By Goal', 'حسب الهدف')], ['href' => home_url('/catalog/?view=routine'), 'label' => $this->translate_label($lang, 'By Routine', 'حسب الروتين')], ['href' => home_url('/catalog/?view=collections'), 'label' => $this->translate_label($lang, 'Collections', 'المجموعات')], ['href' => home_url('/catalog/?view=seasonal'), 'label' => $this->translate_label($lang, 'Seasonal Edits', 'الإصدارات الموسمية')], ], ], [ 'label' => $this->translate_label($lang, 'Stories', 'القصص'), 'items' => [ ['href' => home_url('/articles/'), 'label' => $this->translate_label($lang, 'Journal', 'المجلة')], ['href' => home_url('/about/'), 'label' => $this->translate_label($lang, 'Editorial', 'تحرير')], ], ], [ 'label' => $this->translate_label($lang, 'Concierge', 'الكونسيرج'), 'items' => [ ['href' => home_url('/concierge/'), 'label' => $this->translate_label($lang, 'Concierge', 'الكونسيرج')], ['href' => home_url('/membership/'), 'label' => $this->translate_label($lang, 'Membership', 'العضوية')], ['href' => home_url('/faq/'), 'label' => $this->translate_label($lang, 'FAQ', 'الأسئلة')], ], ], [ 'label' => $this->translate_label($lang, 'Utility', 'المرافق'), 'items' => [ ['href' => home_url('/cart/'), 'label' => $this->translate_label($lang, 'Cart', 'السلة')], ['href' => home_url('/checkout/'), 'label' => $this->translate_label($lang, 'Checkout', 'الدفع')], ['href' => home_url('/account/'), 'label' => $this->translate_label($lang, 'Account', 'الحساب')], ['href' => home_url('/influencer/'), 'label' => $this->translate_label($lang, 'Influencer Portal', 'بوابة المؤثرين')], ], ], ]; } private function footer_sections(string $lang): array { return [ [ 'label' => $this->translate_label($lang, 'The House', 'المنزل'), 'items' => [ ['href' => home_url('/about/'), 'label' => $this->translate_label($lang, 'About', 'من نحن')], ['href' => home_url('/catalog/'), 'label' => $this->translate_label($lang, 'Catalog', 'الخزينة')], ['href' => home_url('/membership/'), 'label' => $this->translate_label($lang, 'Membership', 'العضوية')], ], ], [ 'label' => $this->translate_label($lang, 'Support', 'الدعم'), 'items' => [ ['href' => home_url('/concierge/'), 'label' => $this->translate_label($lang, 'Concierge', 'الكونسيرج')], ['href' => home_url('/shipping/'), 'label' => $this->translate_label($lang, 'Shipping', 'الشحن')], ['href' => home_url('/returns/'), 'label' => $this->translate_label($lang, 'Returns', 'الإرجاع')], ], ], [ 'label' => $this->translate_label($lang, 'Connect', 'تواصل'), 'items' => [ ['href' => home_url('/consultation/'), 'label' => $this->translate_label($lang, 'Consultation', 'الاستشارة')], ['href' => home_url('/contact/'), 'label' => $this->translate_label($lang, 'Contact', 'اتصل')], ['href' => home_url('/articles/'), 'label' => $this->translate_label($lang, 'Journal', 'المجلة')], ], ], ]; } private function render_site_footer(): string { $lang = $this->current_language(); $sections = $this->footer_sections($lang); $sectionHtml = ''; foreach ($sections as $section) { $links = ''; foreach ($section['items'] as $item) { $links .= sprintf( '%s', esc_url($item['href']), esc_html($item['label']) ); } $sectionHtml .= sprintf( '', esc_html($section['label']), $links ); } $quote = esc_html__('“Own the Glow, Quietly and Confidently.”', 'miolora'); $year = date_i18n('Y'); return << HTML; } private function current_language(): string { if (!empty($_COOKIE['miolora_lang']) && in_array($_COOKIE['miolora_lang'], array('en', 'ar'), true)) { return $_COOKIE['miolora_lang']; } if (function_exists('pll_current_language')) { $lang = pll_current_language(); if (in_array($lang, array('en', 'ar'), true)) { return $lang; } } return 'en'; } private function translate_label(string $lang, string $en, string $ar): string { return $lang === 'ar' ? $ar : $en; } private function lang_toggle_label(string $currentLang): string { return $currentLang === 'ar' ? 'EN' : 'AR'; } private function is_current_nav_item(string $href): bool { $href = untrailingslashit($href); $current = untrailingslashit(home_url(add_query_arg(null, null))); return strtolower($href) === strtolower($current); } } new Miolora_Core();