/*
Theme Name: Bilss
Description: Bilss Store — editorial white/black theme (Halfhelix style). Single weight, no shadows, 3px corners, photography-led.
Author: Marwan
Version: 1.0.0
Requires PHP: 7.4
Text Domain: bilss
*/

/* ================= Tokens ================= */
:root {
  --bx-white: #fff;
  --bx-ink: #000;
  --bx-carbon: #262626;
  --bx-graphite: #484a4c;
  --bx-steel: #686c6d;
  --bx-fog: #a5a7a8;
  --bx-ash: #dbdbdb;
  --bx-mist: #ededed;
  --bx-blue: #2749ff;
  --bx-font: 'Inter', 'IBM Plex Sans Arabic', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --bx-lh-display: 1;
  --bx-lh-heading: 1.1;
  --bx-lh-body: 1.2;
  --bx-tr-display: -0.04em;
  --bx-tr-heading: -0.02em;
  --bx-tr-body: -0.01em;
  --bx-hero-scrim: 0; /* لو صورة الهيرو فاتحة والكتابة مش باينة: خليها 0.15 */
  --bx-pad: 40px;
}
/* العربي: التتبع السالب بيفصل الحروف عن بعض، فبنصفّره ونفتح السطر شوية */
html:lang(ar), html[dir="rtl"] {
  --bx-lh-display: 1.25;
  --bx-lh-heading: 1.3;
  --bx-lh-body: 1.6;
  --bx-tr-display: 0;
  --bx-tr-heading: 0;
  --bx-tr-body: 0;
}

/* ================= Base ================= */
*, *::before, *::after { box-sizing: border-box; box-shadow: none !important; text-shadow: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bx-white);
  color: var(--bx-ink);
  font-family: var(--bx-font);
  font-weight: 400;
  font-size: 14px;
  line-height: var(--bx-lh-body);
  letter-spacing: var(--bx-tr-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
b, strong, th, dt, label, h1, h2, h3, h4, h5, h6, .price, .amount { font-weight: 400; }
em, i, cite, address { font-style: normal; }
img, video, svg { max-width: 100%; height: auto; border-radius: 0; }
a { color: var(--bx-ink); text-decoration: none; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; color: var(--bx-ink); }
h1 { font-size: clamp(32px, 4vw, 48px); line-height: var(--bx-lh-display); letter-spacing: var(--bx-tr-display); }
h2 { font-size: clamp(24px, 3vw, 32px); line-height: var(--bx-lh-heading); letter-spacing: var(--bx-tr-heading); }
h3 { font-size: 24px; line-height: var(--bx-lh-heading); letter-spacing: var(--bx-tr-heading); }
h4 { font-size: 18px; line-height: var(--bx-lh-body); }
h5, h6 { font-size: 16px; line-height: var(--bx-lh-body); }
:focus-visible { outline: 2px solid var(--bx-blue); outline-offset: 2px; }
::selection { background: var(--bx-mist); }
::placeholder { color: var(--bx-steel); opacity: 1; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.screen-reader-text:focus { position: fixed; top: 10px; inset-inline-start: 10px; width: auto; height: auto; clip-path: none; background: var(--bx-white); padding: 10px 15px; z-index: 100; }

.bx-main { max-width: 1440px; margin: 0 auto; padding: 40px var(--bx-pad) 60px; min-height: 50vh; }
.bx-title { margin-bottom: 30px; }
.entry-content a:not(.bx-ghost):not(.button):not(.wp-block-button__link),
.woocommerce-product-details__short-description a,
.woocommerce-info a, .woocommerce-message a:not(.button) { border-bottom: 1px solid var(--bx-ink); }
.bx-label { display: block; font-size: 12px; color: var(--bx-steel); margin-bottom: 20px; }
.bx-ph { background: var(--bx-mist); width: 100%; height: 100%; min-height: 200px; }

/* ================= Buttons & fields ================= */
.button, button.button, input[type="submit"], .bx-ghost, .wp-block-button__link, .wc-block-components-button:not(.is-link) {
  display: inline-block; cursor: pointer;
  background: var(--bx-mist); color: var(--bx-ink);
  border: 0; border-radius: 3px; padding: 10px 15px;
  font-size: 14px; line-height: 1.2; letter-spacing: var(--bx-tr-body);
}
.button:hover, button.button:hover, input[type="submit"]:hover, .wp-block-button__link:hover { background: var(--bx-ink); color: var(--bx-white); }
.bx-ghost:hover { background: var(--bx-white); color: var(--bx-ink); }
/* الأكشن الأساسي: أسود */
.single_add_to_cart_button, .checkout-button, #place_order, .wc-block-components-button:not(.is-link) { background: var(--bx-ink) !important; color: var(--bx-white) !important; }
.single_add_to_cart_button:hover, .checkout-button:hover, #place_order:hover { background: var(--bx-carbon) !important; }
button:disabled, .button.disabled, .single_add_to_cart_button.disabled { opacity: .4; cursor: not-allowed; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"],
input[type="search"], input[type="url"], textarea, select {
  width: 100%; background: var(--bx-white); color: var(--bx-ink);
  border: 0; border-bottom: 1px solid var(--bx-ash); border-radius: 0;
  padding: 12px 0; font-size: 14px; appearance: none; -webkit-appearance: none;
}
select { background-image: none; padding-inline-end: 20px; }
input:focus, textarea:focus, select:focus { outline: none; border-bottom-color: var(--bx-ink); }
input[type="checkbox"], input[type="radio"] { width: auto; }

/* ================= Header ================= */
.bx-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
  padding: 12px var(--bx-pad); background: var(--bx-white); position: relative; z-index: 10;
}
.bx-logo { justify-self: start; font-size: 14px; }
.bx-logo img { display: block; height: 24px; width: auto; }
.bx-nav { justify-self: center; }
.bx-menu, .bx-flist { list-style: none; margin: 0; padding: 0; }
.bx-menu { display: flex; flex-wrap: wrap; gap: 5px 20px; }
.bx-menu a { font-size: 14px; }
.bx-menu .current-menu-item > a, .bx-menu .current-cat > a { border-bottom: 1px solid var(--bx-ink); }
.bx-util { justify-self: end; display: flex; align-items: center; gap: 20px; }
.bx-search input[type="search"] { width: 200px; padding: 6px 0; border-bottom-color: transparent; font-size: 14px; }
.bx-search input[type="search"]:focus { border-bottom-color: var(--bx-ink); }
.bx-cart { font-size: 14px; white-space: nowrap; }
.bx-badge { display: inline-block; background: var(--bx-mist); border-radius: 3px; padding: 3px 5px; font-size: 12px; line-height: 1; }
.bx-toggle { display: none; background: none; border: 0; padding: 0; border-bottom: 1px solid var(--bx-ink); font-size: 14px; cursor: pointer; }

/* ================= Footer ================= */
.bx-footer { border-top: 1px solid var(--bx-ash); padding: 60px var(--bx-pad) 30px; max-width: 1440px; margin: 0 auto; }
.bx-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.bx-footer p { font-size: 14px; max-width: 320px; }
.bx-flist li { margin-bottom: 8px; }
.bx-flist a { font-size: 14px; }
.bx-footer__base { margin-top: 60px; font-size: 12px; color: var(--bx-steel); }

/* ================= Woo: notices / breadcrumb / archive ================= */
.woocommerce-message, .woocommerce-info, .woocommerce-error, .woocommerce-noreviews {
  background: var(--bx-mist); color: var(--bx-ink); border: 0; border-radius: 3px;
  padding: 15px; margin: 0 0 20px; list-style: none; overflow: hidden;
}
.woocommerce-message .button, .woocommerce-info .button { float: inline-end; margin-inline-start: 15px; background: var(--bx-white); }
.woocommerce-breadcrumb, .woocommerce-breadcrumb a, .woocommerce-result-count { font-size: 12px; color: var(--bx-steel); }
.woocommerce-breadcrumb { margin-bottom: 20px; }
.woocommerce-products-header__title { margin-bottom: 30px; }
.woocommerce-ordering { margin-bottom: 30px; }
.woocommerce-ordering select { font-size: 13px; }

.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 40px 15px; margin: 0 0 40px !important; padding: 0; list-style: none; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product, .woocommerce ul.products[class*="columns-"] li.product {
  width: auto !important; float: none !important; margin: 0 !important; padding: 0; position: relative; text-align: start;
}
.woocommerce ul.products li.product img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; display: block; margin: 0 0 10px; background: var(--bx-mist); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 14px; line-height: var(--bx-lh-body); letter-spacing: var(--bx-tr-body); padding: 0; margin: 0 0 4px; }
.woocommerce ul.products li.product .price { display: block; font-size: 13px; color: var(--bx-steel); }
.woocommerce ul.products li.product .price del { color: var(--bx-fog); opacity: 1; }
.woocommerce ul.products li.product .price ins { background: none; color: var(--bx-ink); text-decoration: none; }
.woocommerce ul.products li.product .button {
  background: none; color: var(--bx-ink); padding: 0; margin: 8px 0 0; border-radius: 0; border-bottom: 1px solid var(--bx-ink); font-size: 13px;
}
.woocommerce ul.products li.product .button:hover { background: none; color: var(--bx-ink); }
.woocommerce ul.products li.product .added_to_cart { display: inline-block; margin-inline-start: 12px; font-size: 13px; border-bottom: 1px solid var(--bx-ink); }
.star-rating, .woocommerce-product-rating { display: none; }
span.onsale {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2; margin: 0;
  background: var(--bx-mist); color: var(--bx-ink); border-radius: 3px; padding: 5px 8px; font-size: 12px; line-height: 1.2;
}
.woocommerce-pagination { margin: 20px 0; }
.woocommerce-pagination ul { display: flex; gap: 15px; list-style: none; justify-content: center; }
.woocommerce-pagination .page-numbers { color: var(--bx-steel); font-size: 14px; }
.woocommerce-pagination .page-numbers.current { color: var(--bx-ink); border-bottom: 1px solid var(--bx-ink); }
.navigation.pagination { margin: 30px 0; }

/* ================= Woo: single product ================= */
.single-product div.product { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 60px; align-items: start; }
.single-product div.product div.images, .single-product div.product div.summary { float: none !important; width: 100% !important; margin: 0 !important; }
.single-product div.product .woocommerce-tabs, .single-product div.product .related, .single-product div.product .upsells { grid-column: 1 / -1; }
.single-product .product_title { font-size: clamp(28px, 3.5vw, 40px); line-height: var(--bx-lh-heading); letter-spacing: var(--bx-tr-heading); }
.single-product div.product p.price, .single-product div.product span.price { font-size: 24px; color: var(--bx-ink); margin: 0 0 20px; }
.single-product div.product p.price del { color: var(--bx-fog); opacity: 1; }
.single-product div.product p.price ins { background: none; text-decoration: none; }
.woocommerce-product-details__short-description { font-size: 14px; margin-bottom: 20px; }
.woocommerce-product-gallery { position: relative; }
.woocommerce-product-gallery__trigger { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; font-size: 0; width: 24px; height: 24px; background: var(--bx-white); border-radius: 3px; }
.flex-control-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; list-style: none; margin: 10px 0 0; padding: 0; }
form.cart { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; margin-bottom: 20px; }
form.cart .quantity input.qty { width: 64px; text-align: center; padding: 10px 0; }
table.variations { border: 0; width: 100%; margin-bottom: 15px; }
table.variations th, table.variations td { padding: 6px 0; border: 0; text-align: start; vertical-align: middle; }
.reset_variations { font-size: 12px; color: var(--bx-steel); border-bottom: 1px solid var(--bx-steel); }
.product_meta { font-size: 12px; color: var(--bx-steel); }
.woocommerce-tabs ul.tabs { display: flex; gap: 20px; list-style: none; margin: 0 0 30px; padding: 0; }
.woocommerce-tabs ul.tabs li a { color: var(--bx-steel); padding-bottom: 6px; display: inline-block; }
.woocommerce-tabs ul.tabs li.active a { color: var(--bx-ink); border-bottom: 1px solid var(--bx-ink); }
.related > h2, .upsells > h2 { margin: 40px 0 30px; }

/* ================= Woo: cart / checkout / account ================= */
table.shop_table, table.shop_table th, table.shop_table td { border: 0; border-collapse: collapse; background: none; }
table.shop_table { width: 100%; }
table.shop_table th, table.shop_table td { padding: 15px 10px; border-bottom: 1px solid var(--bx-ash); text-align: start; }
table.shop_table img { width: 64px; aspect-ratio: 3 / 4; object-fit: cover; }
table.shop_table .product-remove a { color: var(--bx-steel); font-size: 18px; }
.cart-collaterals .cart_totals { width: 100%; max-width: 480px; float: none; margin-inline-start: auto; }
.woocommerce-cart .actions .coupon { display: flex; gap: 10px; align-items: end; }
.woocommerce form .form-row { margin-bottom: 15px; }
.woocommerce form .form-row label { font-size: 12px; color: var(--bx-steel); display: block; }
.woocommerce form .form-row .required { color: var(--bx-ink); text-decoration: none; border: 0; }
.woocommerce-checkout #payment { background: var(--bx-mist); border-radius: 3px; padding: 20px; }
.woocommerce-checkout #payment ul.payment_methods { list-style: none; padding: 0; margin: 0 0 20px; border: 0; }
.woocommerce-checkout #payment div.payment_box { background: var(--bx-white); color: var(--bx-ink); border-radius: 3px; padding: 15px; margin: 10px 0; }
.woocommerce-checkout #payment div.payment_box::before { display: none; }
.woocommerce-MyAccount-navigation ul { list-style: none; }
.woocommerce-MyAccount-navigation li { margin-bottom: 10px; }
.woocommerce-MyAccount-navigation li.is-active a { border-bottom: 1px solid var(--bx-ink); }
/* بلوكات ووكومرس (سلة/دفع الجديدة) */
.wc-block-components-text-input input, .wc-block-components-select .wc-block-components-select__select {
  border: 0 !important; border-bottom: 1px solid var(--bx-ash) !important; border-radius: 0 !important; background: var(--bx-white) !important;
}
.wc-block-components-panel, .wc-block-components-totals-wrapper { border-color: var(--bx-ash) !important; }
.wc-block-components-product-name { color: var(--bx-ink) !important; }

/* ================= Home ================= */
.bx-home { display: block; }
.bx-hero { position: relative; height: calc(100svh - 64px); min-height: 520px; background: var(--bx-mist); overflow: hidden; }
.bx-hero picture { position: absolute; inset: 0; display: block; }
.bx-hero .bx-hero__img, .bx-hero .bx-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.bx-hero::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, var(--bx-hero-scrim)); pointer-events: none; }
.bx-hero--band { height: 70svh; min-height: 420px; }
.bx-hero__text { position: absolute; z-index: 1; inset-inline-start: var(--bx-pad); bottom: var(--bx-pad); max-width: min(90%, 900px); color: var(--bx-white); }
.bx-tag { display: block; font-size: 12px; margin-bottom: 12px; }
.bx-hero h1, .bx-hero h2 { color: var(--bx-white); font-size: clamp(36px, 4.5vw, 48px); line-height: var(--bx-lh-display); letter-spacing: var(--bx-tr-display); margin: 0 0 20px; }

.bx-services { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; max-width: 1440px; margin: 0 auto; padding: 60px var(--bx-pad); }
.bx-stack a { display: block; font-size: clamp(36px, 4.5vw, 48px); line-height: var(--bx-lh-display); letter-spacing: var(--bx-tr-display); }
.bx-stack a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.bx-side p { font-size: 16px; line-height: 1.4; max-width: 420px; margin: 0 0 30px; }
.bx-collage { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.bx-collage img, .bx-collage .bx-ph { width: 100%; aspect-ratio: 3 / 4; height: auto; object-fit: cover; display: block; }

.bx-stats { display: flex; flex-wrap: wrap; gap: 20px 60px; max-width: 1440px; margin: 0 auto; padding: 0 var(--bx-pad) 60px; }
.bx-stats > div { display: flex; align-items: baseline; gap: 5px; }
.bx-num { font-size: 32px; line-height: var(--bx-lh-heading); letter-spacing: var(--bx-tr-heading); }
.bx-note { font-size: 13px; color: var(--bx-steel); }

.bx-products { max-width: 1440px; margin: 0 auto; padding: 0 var(--bx-pad) 60px; }
.bx-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.bx-head h2 { margin: 0; }

.bx-dark-wrap { max-width: 1440px; margin: 0 auto; padding: 60px var(--bx-pad); }
.bx-dark { background: var(--bx-carbon); color: var(--bx-white); border-radius: 3px; padding: 30px; display: grid; gap: 12px; }
.bx-dark span { font-size: 12px; color: var(--bx-fog); }
.bx-dark p { color: var(--bx-white); font-size: 14px; margin: 0; }
.bx-dark a { color: var(--bx-white); justify-self: start; border-bottom: 1px solid var(--bx-white); }

/* ================= Cookie + WhatsApp ================= */
.bx-cookie {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 360px;
  background: rgba(0, 0, 0, .55); color: var(--bx-white); border-radius: 3px; padding: 15px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bx-cookie[hidden] { display: none; }
.bx-cookie p { font-size: 13px; margin: 0 0 12px; }
.bx-cookie__btns { display: flex; gap: 8px; }
.bx-cookie button { background: var(--bx-ink); color: var(--bx-white); border: 1px solid var(--bx-ink); border-radius: 3px; padding: 10px 15px; font-size: 13px; cursor: pointer; }
.bx-cookie button.is-outline { background: none; border-color: var(--bx-white); }
.bx-wa { position: fixed; left: 20px; bottom: 20px; z-index: 40; background: var(--bx-mist); color: var(--bx-ink); border-radius: 3px; padding: 10px 15px; font-size: 14px; line-height: 1.2; }

/* ================= Mobile ================= */
@media (max-width: 768px) {
  :root { --bx-pad: 20px; }
  .bx-header { grid-template-columns: 1fr auto auto; grid-template-areas: "logo toggle cart" "search search search" "nav nav nav"; gap: 10px 20px; }
  .bx-util { display: contents; }
  .bx-logo { grid-area: logo; }
  .bx-toggle { display: inline-block; grid-area: toggle; }
  .bx-cart { grid-area: cart; }
  .bx-search { grid-area: search; }
  .bx-search input[type="search"] { width: 100%; border-bottom-color: var(--bx-ash); }
  .bx-nav { grid-area: nav; justify-self: stretch; display: none; }
  .bx-nav.is-open { display: block; }
  .bx-menu { flex-direction: column; gap: 12px; padding: 10px 0 20px; }
  .bx-services { grid-template-columns: 1fr; gap: 40px; padding: 40px var(--bx-pad); }
  .bx-footer__grid { grid-template-columns: 1fr; gap: 30px; }
  .single-product div.product { grid-template-columns: 1fr; }
  .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: 30px 10px; }
  .bx-cookie { left: 10px; right: 10px; bottom: 10px; max-width: none; }
  .bx-cookie-open .bx-wa { display: none; }
}
