/*
Theme Name: Bella Bag
Theme URI: https://bellabag.ma
Author: Bella Bag
Description: Thème premium RTL (العربية) pour boutique de sacs avec WooCommerce, paiement à la livraison et livraison gratuite.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bella-bag
Tags: e-commerce, rtl-language-support, block-themes, full-site-editing
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
img { height: auto; }

/* ---------- Announcement bar ---------- */
.bb-announce p { margin: 0; letter-spacing: .02em; }

/* ---------- Header ---------- */
.bb-header { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(1.4) blur(8px); }
.bb-logo a { text-decoration: none; }

/* ---------- Buttons ---------- */
.wp-element-button, .wp-block-button__link,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .woocommerce a.button.alt, .woocommerce button.button.alt {
  border-radius: 2px !important;
  font-weight: 700 !important;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.wp-element-button:hover, .wp-block-button__link:hover,
.woocommerce a.button:hover, .woocommerce button.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(28, 26, 23, .18);
}
.woocommerce a.button, .woocommerce button.button, .woocommerce button.button.alt,
.woocommerce a.button.alt, .woocommerce input.button {
  background: var(--wp--preset--color--burgundy) !important;
  color: #fff !important;
  padding: .85em 1.6em !important;
}

/* ---------- Product cards (shortcodes + archive) ---------- */
.woocommerce ul.products li.product {
  background: #fff;
  border-radius: 4px;
  padding: 0 0 18px !important;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 2px 14px rgba(28, 26, 23, .06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.woocommerce ul.products li.product:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(28, 26, 23, .12); }
.woocommerce ul.products li.product a img { width: 100%; height: auto; margin: 0 0 14px !important; aspect-ratio: 4/5; object-fit: cover; background: var(--wp--preset--color--sand); }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 1rem !important; font-weight: 700; padding: 0 12px !important; color: var(--wp--preset--color--ink);
}
.woocommerce ul.products li.product .price { color: var(--wp--preset--color--rose) !important; font-weight: 800; font-size: 1.1rem !important; }
.woocommerce ul.products li.product .price del { color: #9a8f8f !important; font-weight: 400; font-size: .85em; margin-inline-end: 6px; }
.woocommerce ul.products li.product .price ins { text-decoration: none; }
.woocommerce ul.products li.product .button { margin-top: 10px !important; font-size: .9rem !important; }
.woocommerce span.onsale {
  background: var(--wp--preset--color--rose) !important; border-radius: 2px !important;
  min-height: auto !important; min-width: auto !important; padding: 4px 12px !important; line-height: 1.6 !important; font-weight: 700;
  top: 12px !important; inset-inline-start: 12px !important; inset-inline-end: auto !important; left: auto;
}

/* ---------- Category cards ---------- */
.woocommerce ul.products li.product-category { background: transparent; box-shadow: none; }
.woocommerce ul.products li.product-category img { border-radius: 4px; }
.woocommerce ul.products li.product-category h2 { font-size: 1.05rem !important; font-weight: 700; }
.woocommerce ul.products li.product-category mark { display: none; }

/* ---------- Single product ---------- */
.single-product .product_title { font-family: var(--wp--preset--font-family--amiri); }
.single-product .price { color: var(--wp--preset--color--rose) !important; font-size: 1.6rem !important; font-weight: 800; }
.single-product .price del { color: #9a8f8f !important; font-size: .7em; font-weight: 400; }
.single-product .price ins { text-decoration: none; }
.single-product table.variations select { border-radius: 4px; padding: .6em .8em; border: 1px solid #E4DED5; background: #fff; min-width: 200px; }
.single-product .single_add_to_cart_button { width: 100%; font-size: 1.15rem !important; padding: 1em !important; }
.bb-product-trust { margin: 18px 0; padding: 14px 16px; background: var(--wp--preset--color--sand); border: 1px solid #E9E4DC; border-radius: 4px; line-height: 2; font-weight: 600; }

/* ---------- Checkout ---------- */
.woocommerce-checkout .woocommerce form .form-row input.input-text,
.woocommerce-checkout .woocommerce form .form-row textarea {
  border-radius: 4px; border: 1px solid #E4DED5; padding: .8em 1em; background: #fff;
}
#place_order { width: 100%; font-size: 1.15rem !important; padding: 1em !important; }

/* ---------- Floating WhatsApp ---------- */
.bb-wa {
  position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 99;
  height: 54px; padding: 0 20px 0 16px; border-radius: 999px; background: #25D366; color: #fff !important;
  display: flex; align-items: center; gap: 10px; text-decoration: none !important;
  font-weight: 800; font-size: 1rem; white-space: nowrap;
  box-shadow: 0 10px 28px rgba(37, 211, 102, .35); transition: transform .2s ease;
  animation: bbWaPulse 2.4s ease-in-out infinite;
}
.bb-wa:hover { transform: translateY(-2px); }
.bb-wa svg { width: 28px; height: 28px; fill: #fff; flex: 0 0 auto; }
@keyframes bbWaPulse { 0%,100% { box-shadow: 0 10px 28px rgba(37,211,102,.35), 0 0 0 0 rgba(37,211,102,.45); } 50% { box-shadow: 0 10px 28px rgba(37,211,102,.35), 0 0 0 10px rgba(37,211,102,0); } }
@media (max-width: 781px) { .bb-wa { height: 50px; font-size: .95rem; padding: 0 16px 0 12px; bottom: 14px; inset-inline-start: 14px; } }

/* ---------- Misc ---------- */
.bb-card { border-radius: 4px; }
.bb-hero-img img { border-radius: 4px; box-shadow: 0 30px 60px rgba(28, 26, 23, .18); }
.wp-block-details summary { cursor: pointer; font-weight: 700; }
.wp-block-details { background: #fff; border: 1px solid #E9E4DC; border-radius: 4px; padding: 14px 18px; }

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
  .bb-trust { flex-wrap: wrap !important; row-gap: 18px; }
  .bb-trust > .wp-block-column { flex-basis: 45% !important; flex-grow: 1; }
  .bb-announce p { font-size: .8rem !important; }
  .bb-logo { font-size: 1.5rem !important; }
}

/* ---------- Express COD form ---------- */
.bb-cod { background: #fff; border: 2px solid var(--wp--preset--color--burgundy); border-radius: 4px; padding: 18px; margin: 18px 0; scroll-margin-top: 90px; }
.bb-cod-head { text-align: center; margin-bottom: 12px; }
.bb-cod-head strong { display: block; font-size: 1.3rem; color: var(--wp--preset--color--burgundy); }
.bb-cod-head span { font-size: .9rem; color: var(--wp--preset--color--muted); }
.bb-cod-label { font-weight: 700; margin: 12px 0 8px; }
.bb-cod-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.bb-cod-swatch input, .bb-cod-offer input { position: absolute; opacity: 0; pointer-events: none; }
.bb-cod-swatch span { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1.5px solid #E4DED5; border-radius: 2px; cursor: pointer; background: #fff; transition: all .15s ease; }
.bb-cod-swatch img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.bb-cod-swatch em { font-style: normal; font-weight: 700; font-size: .9rem; }
.bb-cod-swatch input:checked + span { border-color: var(--wp--preset--color--burgundy); background: var(--wp--preset--color--sand); box-shadow: 0 0 0 2px var(--wp--preset--color--burgundy) inset; }
.bb-cod-offers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bb-cod-offer span { display: flex; flex-direction: column; align-items: center; padding: 12px 8px; border: 1.5px solid #E4DED5; border-radius: 4px; cursor: pointer; text-align: center; background: #fff; }
.bb-cod-offer i { font-style: normal; font-weight: 800; color: var(--wp--preset--color--rose); font-size: 1.15rem; }
.bb-cod-offer small { color: #1e7a3a; font-weight: 700; }
.bb-cod-offer input:checked + span { border-color: var(--wp--preset--color--burgundy); background: var(--wp--preset--color--sand); box-shadow: 0 0 0 2px var(--wp--preset--color--burgundy) inset; }
.bb-cod-offer-best span { position: relative; }
.bb-cod-fields { display: grid; gap: 10px; margin-top: 14px; }
.bb-cod-fields input { width: 100%; box-sizing: border-box; padding: 14px 16px; border: 1.5px solid #E4DED5; border-radius: 4px; font: inherit; font-size: 16px; background: #ffffff; }
.bb-cod-fields input:focus { outline: none; border-color: var(--wp--preset--color--burgundy); }
.bb-hp { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; opacity: 0 !important; }
.bb-cod-btn { width: 100%; margin-top: 14px; padding: 16px; border: 0; border-radius: 2px; background: var(--wp--preset--color--burgundy); color: #fff; font: inherit; font-size: 1.2rem; font-weight: 800; cursor: pointer; animation: bbPulse 2s infinite; }
.bb-cod-btn:disabled { opacity: .7; animation: none; cursor: wait; }
@keyframes bbPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.bb-cod-msg { margin-top: 10px; text-align: center; font-weight: 700; }
.bb-cod-msg.is-error { color: #b3261e; }
.bb-cod-trust { list-style: none; padding: 0; margin: 14px 0 0; font-size: .92rem; line-height: 1.9; color: var(--wp--preset--color--ink); }
.bb-cod-out { padding: 14px; background: var(--wp--preset--color--sand); border-radius: 4px; font-weight: 700; text-align: center; }
.bb-sticky-order { display: none; }
@media (max-width: 781px) {
  .bb-sticky-order { display: block; position: fixed; bottom: 0; left: 0; right: 0; z-index: 98; background: var(--wp--preset--color--burgundy); color: #fff !important; text-align: center; padding: 15px; font-weight: 800; font-size: 1.05rem; text-decoration: none; box-shadow: 0 -6px 20px rgba(0,0,0,.15); transition: transform .25s ease; }
  .bb-sticky-order.is-hidden { transform: translateY(100%); }
  .single-product .bb-wa { bottom: 76px; }
}

/* ---------- Fallback gallery ---------- */
.bb-gallery { width: 100%; }
.bb-g-main { border-radius: 4px; overflow: hidden; background: var(--wp--preset--color--sand); }
.bb-g-main img { display: block; width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; }
.bb-g-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.bb-g-thumb { flex: 0 0 64px; height: 80px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: none; cursor: pointer; }
.bb-g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bb-g-thumb.is-active { border-color: var(--wp--preset--color--burgundy); }
.bb-cod-swatch img { width: 34px; height: 42px; border-radius: 3px; }

/* ---------- Pair offer ---------- */
.bb-cod-second { display: none; }
.bb-cod.is-pair .bb-cod-second { display: block; }
.bb-cod-offer-best span { position: relative; padding-top: 18px; }
.bb-cod-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--wp--preset--color--rose); color: #fff; font-style: normal; font-size: .72rem; font-weight: 800; padding: 2px 10px; border-radius: 2px; white-space: nowrap; }
.bb-cod-offers { margin-top: 14px; }
.bb-g-main { background: #fff; }
.bb-g-main img { aspect-ratio: 1 / 1; object-fit: contain; }

/* Fallback photos inside WooCommerce product blocks (related products, collections) */
.wc-block-components-product-image img.bb-fallback-img,
.wp-block-woocommerce-product-image img.bb-fallback-img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }

/* v1.5 — square product photos, category cards, hero photo */
.woocommerce ul.products li.product a img { aspect-ratio: 1/1; background: #fff; }
.woocommerce ul.products li.product-category { overflow: hidden; border-radius: 4px; position: relative; }
.woocommerce ul.products li.product-category a { display: block; position: relative; }
.woocommerce ul.products li.product-category img,
.woocommerce ul.products li.product-category .bb-cat-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; margin: 0 !important; transition: transform .5s ease; }
.woocommerce ul.products li.product-category:hover img { transform: scale(1.05); }
.woocommerce ul.products li.product-category h2 {
	position: absolute; inset-inline: 10px; bottom: 10px; margin: 0 !important;
	background: rgba(250, 248, 245, .95); color: var(--wp--preset--color--burgundy);
	border-radius: 2px; padding: 8px 12px !important; text-align: center;
	font-size: .95rem !important; box-shadow: 0 6px 18px rgba(28, 26, 23, .12);
}
.bb-hero-img img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
@media (max-width: 781px) {
	.woocommerce ul.products li.product-category h2 { font-size: .85rem !important; padding: 6px 8px !important; }
}

/* v1.6 — premium neutral look */
body { -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 400 !important; letter-spacing: .01em; }
.wp-element-button, .wp-block-button__link, .woocommerce a.button, .woocommerce button.button { letter-spacing: .04em; }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--burgundy) !important; color: #fff !important; }
.woocommerce ul.products li.product { box-shadow: none !important; border: 1px solid #ECE7E0; }
.woocommerce ul.products li.product:hover { box-shadow: 0 12px 30px rgba(28, 26, 23, .08) !important; }
.woocommerce ul.products li.product .price { color: var(--wp--preset--color--burgundy) !important; }
.woocommerce ul.products li.product-category { border: 0 !important; }
.woocommerce ul.products li.product-category h2 { letter-spacing: .02em; font-weight: 600 !important; }
.bb-hero-img img { box-shadow: none !important; }
.bb-cod { border-width: 1px !important; }
.bb-cod-btn { letter-spacing: .03em; }
