/*
Theme Name: Everything Market
Author: Saiyed Iqbal
Description: A fast, modern UAE marketplace theme where every product order is completed through WhatsApp.
Version: 1.3.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: everything-market
Tags: e-commerce, custom-logo, custom-menu, featured-images, rtl-language-support, translation-ready
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --em-green: #08a63f;
  --em-green-dark: #087d34;
  --em-red: #f23522;
  --em-orange: #ff7a00;
  --em-yellow: #ffd22e;
  --em-ink: #111817;
  --em-muted: #66706c;
  --em-line: #e2e7e4;
  --em-soft: #f6f8f7;
  --em-white: #ffffff;
  --em-radius: 18px;
  --em-shadow: 0 14px 34px rgba(22, 42, 31, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--em-ink);
  background: var(--em-soft);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
body.admin-bar .site-header { top: 32px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input { font: inherit; }
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.em-container { width: min(1440px, calc(100% - 40px)); margin-inline: auto; }
.em-topbar { border-bottom: 1px solid var(--em-line); background: var(--em-white); font-size: 13px; }
.em-topbar__inner { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.em-topbar__group { display: flex; gap: 24px; align-items: center; }
.em-icon-text { display: inline-flex; align-items: center; gap: 7px; color: var(--em-muted); }
.em-icon-text svg { width: 17px; height: 17px; color: var(--em-ink); }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(14px); border-bottom: 1px solid var(--em-line); }
.em-header-main { min-height: 100px; display: grid; grid-template-columns: 280px minmax(250px, 1fr) auto; align-items: center; gap: 28px; }
.em-brand { display: inline-flex; align-items: center; gap: 12px; font-size: 25px; font-weight: 800; line-height: 1; letter-spacing: -.035em; }
.em-brand__mark { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px 18px 18px 6px; color: var(--em-white); background: linear-gradient(145deg, var(--em-green), var(--em-green-dark)); box-shadow: 0 10px 22px rgba(8,166,63,.2); }
.em-brand__mark svg { width: 29px; height: 29px; }
.custom-logo { max-height: 62px; width: auto; }
.em-search { position: relative; display: flex; align-items: center; }
.em-search svg { position: absolute; inset-inline-start: 18px; width: 20px; height: 20px; color: var(--em-muted); }
.em-search input[type="search"] { width: 100%; height: 52px; padding: 0 20px 0 52px; color: var(--em-ink); background: var(--em-white); border: 1px solid #d6ddda; border-radius: 14px; outline: none; }
.rtl .em-search input[type="search"] { padding: 0 52px 0 20px; }
.em-search input[type="search"]:focus { border-color: var(--em-green); box-shadow: 0 0 0 3px rgba(8,166,63,.12); }
.em-whatsapp { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 10px 20px; color: var(--em-white); background: linear-gradient(135deg, var(--em-green), #04bd48); border: 0; border-radius: 12px; font-weight: 800; box-shadow: 0 10px 18px rgba(8,166,63,.17); transition: transform .2s ease, box-shadow .2s ease; }
.em-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(8,166,63,.24); }
.em-whatsapp svg { width: 22px; height: 22px; }
.em-whatsapp small { display: block; font-size: 10px; font-weight: 500; opacity: .9; }
.em-nav { background: var(--em-white); border-top: 1px solid var(--em-line); }
.em-nav__inner { min-height: 52px; display: flex; align-items: stretch; }
.em-menu { display: flex; align-items: stretch; flex: 1; gap: 2px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.em-menu li { display: flex; align-items: stretch; flex: 0 0 auto; }
.em-menu a { display: flex; align-items: center; padding: 0 18px; font-size: 14px; font-weight: 600; border-radius: 9px; }
.em-menu li:first-child a { margin: 6px 6px 6px 0; color: var(--em-white); background: var(--em-red); }
.em-menu a:hover { background: var(--em-soft); }
.em-menu li:first-child a:hover { background: #d92312; }
.em-mobile-toggle { display: none; align-items: center; gap: 8px; border: 0; background: none; padding: 12px 0; font-weight: 700; }
.em-main { padding: 16px 0 42px; }
.em-promo-grid { display: grid; grid-template-columns: 1.9fr 1fr; gap: 14px; }
.em-mega { min-height: 305px; position: relative; overflow: hidden; display: flex; align-items: center; padding: 42px 48px; color: var(--em-white); border-radius: var(--em-radius); background: radial-gradient(circle at 82% 18%, rgba(255,210,46,.9), transparent 17%), radial-gradient(circle at 76% 75%, rgba(255,122,0,.75), transparent 24%), linear-gradient(120deg, #ff2f14, #ff5b00 65%, #ff9716); box-shadow: var(--em-shadow); }
.em-mega::after { content: ""; position: absolute; width: 280px; height: 280px; inset-inline-end: 5%; top: 8%; border: 35px solid rgba(255,255,255,.14); border-radius: 50%; }
.em-mega__content { position: relative; z-index: 2; max-width: 560px; }
.em-kicker { display: inline-flex; padding: 7px 11px; margin-bottom: 14px; color: #7f2100; background: var(--em-yellow); border-radius: 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.em-mega h1 { margin: 0 0 8px; font-size: clamp(42px, 6vw, 78px); line-height: .98; letter-spacing: -.055em; }
.em-mega p { margin: 0 0 22px; font-size: 19px; }
.em-mega .em-whatsapp { color: var(--em-green-dark); background: var(--em-white); box-shadow: none; }
.em-promo-stack { display: grid; gap: 14px; }
.em-mini-promo { position: relative; min-height: 145px; overflow: hidden; padding: 24px 28px; border-radius: var(--em-radius); }
.em-mini-promo h2 { max-width: 300px; margin: 0 0 4px; font-size: 30px; line-height: 1.04; letter-spacing: -.04em; }
.em-mini-promo p { margin: 0 0 14px; }
.em-mini-promo--green { color: var(--em-white); background: linear-gradient(135deg, #04b442, #0b8d37); }
.em-mini-promo--yellow { color: #4b2800; background: linear-gradient(135deg, #ffd83e, #ffb61a); }
.em-mini-promo__symbol { position: absolute; inset-inline-end: 25px; top: 50%; transform: translateY(-50%); font-size: 72px; opacity: .9; }
.em-text-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; }
.em-section { margin-top: 22px; }
.em-section__head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.em-section__title { display: flex; align-items: center; gap: 10px; }
.em-section__title h2 { margin: 0; font-size: 29px; letter-spacing: -.03em; }
.em-bolt { color: var(--em-red); font-size: 30px; }
.em-countdown { display: inline-flex; align-items: center; gap: 7px; margin-inline-start: 12px; color: var(--em-muted); font-size: 14px; }
.em-countdown__unit { min-width: 38px; padding: 5px 8px; color: var(--em-white); background: var(--em-red); border-radius: 7px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 800; }
.em-products { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.em-product { min-width: 0; display: flex; flex-direction: column; padding: 12px; background: var(--em-white); border: 1px solid var(--em-line); border-radius: 14px; transition: transform .2s ease, box-shadow .2s ease; }
.em-product:hover { transform: translateY(-4px); box-shadow: var(--em-shadow); }
.em-product__visual { position: relative; height: 180px; display: grid; place-items: center; overflow: hidden; margin-bottom: 11px; background: linear-gradient(145deg, #fbfcfb, #eef2f0); border-radius: 10px; font-size: 78px; }
.em-product__visual img { width: 100%; height: 100%; object-fit: contain; }
.em-product__sale { position: absolute; top: 8px; inset-inline-start: 8px; padding: 5px 8px; color: var(--em-white); background: var(--em-red); border-radius: 6px; font-size: 11px; font-weight: 800; }
.em-product h3 { min-height: 43px; margin: 0 0 8px; font-size: 14px; line-height: 1.45; font-weight: 700; }
.em-product__seller { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; color: var(--em-muted); font-size: 11px; }
.em-product__seller a:hover { color: var(--em-green-dark); }
.em-verified { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; color: var(--em-white); background: var(--em-green); border-radius: 50%; font-size: 9px; font-weight: 900; }
.em-product__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-bottom: 5px; }
.em-product__old { color: #8b9290; text-decoration: line-through; font-size: 12px; }
.em-product__new { font-size: 20px; font-weight: 900; letter-spacing: -.025em; }
.em-product__stock { min-height: 21px; margin-bottom: 8px; color: var(--em-green-dark); font-size: 12px; font-weight: 700; }
.em-product__stock--urgent { color: var(--em-red); }
.em-product .em-whatsapp { width: 100%; min-height: 42px; margin-top: auto; padding: 8px 10px; border-radius: 9px; font-size: 12px; box-shadow: none; }
.em-product .em-whatsapp svg { width: 17px; height: 17px; }
.em-trust { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 20px 10px; background: var(--em-white); border: 1px solid var(--em-line); border-radius: var(--em-radius); }
.em-trust__item { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 0 18px; border-inline-end: 1px solid var(--em-line); }
.em-trust__item:last-child { border: 0; }
.em-trust__icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: var(--em-green); background: #eaf8ef; border-radius: 13px; }
.em-trust__icon svg { width: 22px; height: 22px; }
.em-trust strong { display: block; font-size: 14px; }
.em-trust small { color: var(--em-muted); }
.em-content { padding: 28px; background: var(--em-white); border: 1px solid var(--em-line); border-radius: var(--em-radius); }
.em-page-title { margin: 0 0 22px; font-size: clamp(32px, 5vw, 54px); letter-spacing: -.04em; }
.em-archive-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.em-empty { grid-column: 1 / -1; padding: 60px 20px; text-align: center; color: var(--em-muted); }
.em-single-product { display: grid; grid-template-columns: minmax(280px, .9fr) 1.1fr; gap: 42px; }
.em-single-product__visual { min-height: 440px; display: grid; place-items: center; background: linear-gradient(145deg, #fbfcfb, #edf2ef); border-radius: var(--em-radius); font-size: 150px; }
.em-single-product__visual img { width: 100%; max-height: 520px; object-fit: contain; }
.em-single-product__price { margin: 18px 0; font-size: 34px; font-weight: 900; }
.em-single-product__old { margin-inline-end: 12px; color: var(--em-muted); font-size: 17px; text-decoration: line-through; }
.em-single-product .em-whatsapp { min-height: 56px; font-size: 17px; }
.em-order-box { margin-top: 24px; padding: 20px; background: var(--em-soft); border: 1px solid var(--em-line); border-radius: 14px; }
.em-order-box h2 { margin: 0 0 15px; font-size: 21px; }
.em-order-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.em-order-options .em-field { margin: 0; }
.em-order-options .em-field--full { grid-column: 1 / -1; }
.em-order-box .em-whatsapp { width: 100%; margin-top: 16px; }
.site-footer { color: #dfe7e3; background: #101915; }
.em-footer { padding: 44px 0 30px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.em-footer h2, .em-footer h3 { color: var(--em-white); }
.em-footer h2 { margin: 0 0 10px; }
.em-footer h3 { margin-top: 0; }
.em-footer p { color: #aebbb4; }
.em-footer ul { margin: 0; padding: 0; list-style: none; }
.em-footer li { margin: 8px 0; }
.em-footer a:hover { color: var(--em-white); }
.em-footer-bottom { padding: 18px 0; color: #96a59d; border-top: 1px solid #28332e; font-size: 13px; display: flex; justify-content: space-between; gap: 20px; }
.em-pagination { margin-top: 24px; }
.em-pagination .nav-links { display: flex; gap: 7px; }
.em-pagination a, .em-pagination span { padding: 8px 12px; background: var(--em-white); border: 1px solid var(--em-line); border-radius: 8px; }
.em-pagination .current { color: var(--em-white); background: var(--em-green); border-color: var(--em-green); }
.em-form { max-width: 820px; }
.em-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.em-field { margin-bottom: 18px; }
.em-field--full { grid-column: 1 / -1; }
.em-field label { display: block; margin-bottom: 7px; font-weight: 800; }
.em-field input,
.em-field select,
.em-field textarea { width: 100%; padding: 12px 14px; color: var(--em-ink); background: var(--em-white); border: 1px solid #ced7d2; border-radius: 10px; outline: none; }
.em-field textarea { min-height: 125px; resize: vertical; }
.em-field input:focus,
.em-field select:focus,
.em-field textarea:focus { border-color: var(--em-green); box-shadow: 0 0 0 3px rgba(8,166,63,.12); }
.em-submit { min-height: 48px; padding: 11px 20px; color: var(--em-white); background: var(--em-green); border: 0; border-radius: 10px; font-weight: 800; cursor: pointer; }
.em-notice { margin-bottom: 20px; padding: 13px 16px; color: #075d29; background: #e5f8ec; border: 1px solid #b8e8c8; border-radius: 10px; }
.em-notice--warning { color: #734200; background: #fff4d6; border-color: #f4d488; }
.em-notice--error { color: #8c1c11; background: #ffebe8; border-color: #ffc5bd; }
.em-dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.em-dashboard-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; }
.em-dashboard-nav { align-self: start; padding: 10px; background: var(--em-soft); border-radius: 12px; }
.em-dashboard-nav a { display: block; padding: 11px 12px; border-radius: 8px; font-weight: 700; }
.em-dashboard-nav a:hover,
.em-dashboard-nav a.is-active { color: var(--em-white); background: var(--em-green); }
.em-table-wrap { overflow-x: auto; }
.em-table { width: 100%; border-collapse: collapse; }
.em-table th,
.em-table td { padding: 12px; border-bottom: 1px solid var(--em-line); text-align: start; vertical-align: middle; }
.em-table th { color: var(--em-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.em-status { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--em-soft); font-size: 11px; font-weight: 800; text-transform: capitalize; }
.em-status--publish { color: #056027; background: #dff6e7; }
.em-status--pending { color: #7a4a00; background: #fff0c7; }
.em-store-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; margin-bottom: 24px; padding: 26px; color: var(--em-white); background: linear-gradient(135deg, var(--em-green-dark), var(--em-green)); border-radius: var(--em-radius); }
.em-store-avatar { width: 74px; height: 74px; display: grid; place-items: center; background: rgba(255,255,255,.17); border-radius: 20px; font-size: 34px; }
.em-store-hero h1 { margin: 0 0 4px; font-size: 34px; }
.em-store-hero p { margin: 0; opacity: .86; }

@media (max-width: 1180px) {
  .em-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .em-archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .em-header-main { grid-template-columns: 230px minmax(240px, 1fr) auto; gap: 18px; }
  .em-brand { font-size: 21px; }
}

@media (max-width: 900px) {
  body.admin-bar .site-header { top: 46px; }
  .em-container { width: min(100% - 28px, 760px); }
  .em-topbar__group:first-child span:not(:first-child) { display: none; }
  .em-header-main { grid-template-columns: 1fr auto; padding: 12px 0; }
  .em-search { grid-column: 1 / -1; grid-row: 2; }
  .em-nav__inner { display: block; }
  .em-mobile-toggle { display: inline-flex; }
  .em-menu { display: none; flex-direction: column; padding-bottom: 12px; }
  .em-menu.is-open { display: flex; }
  .em-menu li, .em-menu a { width: 100%; }
  .em-menu a { padding: 12px 14px; }
  .em-menu li:first-child a { margin: 0; }
  .em-promo-grid { grid-template-columns: 1fr; }
  .em-promo-stack { grid-template-columns: 1fr 1fr; }
  .em-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-trust { grid-template-columns: 1fr 1fr; gap: 20px 0; }
  .em-trust__item:nth-child(2) { border: 0; }
  .em-footer { grid-template-columns: 1fr 1fr; }
  .em-footer > :first-child { grid-column: 1 / -1; }
  .em-dashboard-grid { grid-template-columns: 1fr; }
  .em-dashboard-nav { display: flex; gap: 6px; overflow-x: auto; }
  .em-dashboard-nav a { flex: 0 0 auto; }
}

@media (max-width: 620px) {
  .em-topbar__inner { min-height: 34px; }
  .em-topbar__group { gap: 12px; }
  .em-topbar__group:last-child span:first-child { display: none; }
  .em-brand__mark { width: 44px; height: 44px; border-radius: 14px 14px 14px 5px; }
  .em-brand { font-size: 18px; }
  .em-header-main > .em-whatsapp { width: 46px; min-width: 46px; height: 46px; padding: 0; border-radius: 12px; }
  .em-header-main > .em-whatsapp span { display: none; }
  .em-main { padding-top: 10px; }
  .em-mega { min-height: 330px; padding: 30px 24px; align-items: flex-start; }
  .em-mega h1 { font-size: 50px; }
  .em-mega::after { inset-inline-end: -130px; top: 130px; }
  .em-promo-stack { grid-template-columns: 1fr; }
  .em-mini-promo { min-height: 132px; }
  .em-section__head { align-items: flex-start; }
  .em-section__title { flex-wrap: wrap; }
  .em-section__title h2 { font-size: 25px; }
  .em-countdown { width: 100%; margin-inline-start: 0; }
  .em-products, .em-archive-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .em-product { padding: 9px; }
  .em-product__visual { height: 138px; font-size: 58px; }
  .em-product__new { font-size: 17px; }
  .em-product .em-whatsapp { font-size: 0; }
  .em-product .em-whatsapp::after { content: "WhatsApp"; font-size: 12px; }
  .em-trust { grid-template-columns: 1fr; }
  .em-trust__item { justify-content: flex-start; border: 0; }
  .em-single-product { grid-template-columns: 1fr; gap: 24px; }
  .em-single-product__visual { min-height: 320px; }
  .em-order-options { grid-template-columns: 1fr; }
  .em-order-options .em-field--full { grid-column: auto; }
  .em-footer { grid-template-columns: 1fr; }
  .em-footer > :first-child { grid-column: auto; }
  .em-footer-bottom { flex-direction: column; }
  .em-form-grid { grid-template-columns: 1fr; }
  .em-field--full { grid-column: auto; }
  .em-dashboard-head { align-items: flex-start; flex-direction: column; }
  .em-store-hero { grid-template-columns: auto 1fr; }
  .em-store-hero .em-whatsapp { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
