/* K-Trend Mini Mall — storefront styles */
:root {
  --pink: #e5687f;
  --pink-dark: #c94a63;
  --pink-soft: #fbe3e9;
  --pink-mid: #f6c9d2;
  --cream: #faf5f1;
  --ink: #221d20;
  --muted: #8a7f84;
  --line: #f0dde2;
  --white: #ffffff;
  --ok: #2e9e5b;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(201, 74, 99, .10);
  --font: 'Tajawal', 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.container { width: min(1200px, 100% - 2rem); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header { background: var(--white); box-shadow: 0 2px 12px rgba(34, 29, 32, .06); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1rem; padding-block: .6rem; }
.brand { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.brand img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--pink-mid); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1.05rem; font-weight: 800; }
.brand-text small { color: var(--pink); font-weight: 500; font-size: .72rem; }

.search-box { position: relative; flex: 1; display: flex; max-width: 560px; margin-inline: auto; }
.search-box input {
  flex: 1; border: 2px solid var(--pink-mid); border-radius: 999px;
  padding: .55rem 1.1rem; padding-inline-end: 3rem; background: var(--cream);
  outline: none; transition: border-color .15s;
}
.search-box input:focus { border-color: var(--pink); background: var(--white); }
.search-box button {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  background: var(--pink); color: #fff; border: 0; border-radius: 50%;
  width: 34px; height: 34px; display: grid; place-items: center;
}
.search-suggest {
  position: absolute; top: calc(100% + 6px); inset-inline: 0; background: var(--white);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(34,29,32,.15);
  overflow: hidden; z-index: 60; max-height: 380px; overflow-y: auto;
}
.search-suggest a { display: flex; align-items: center; gap: .7rem; padding: .55rem .9rem; border-bottom: 1px solid var(--line); }
.search-suggest a:last-child { border-bottom: 0; }
.search-suggest a:hover { background: var(--pink-soft); }
.search-suggest img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; background: var(--cream); }
.search-suggest .s-name { flex: 1; font-size: .9rem; font-weight: 500; }
.search-suggest .s-price { color: var(--pink-dark); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.search-suggest .s-empty { padding: .8rem; color: var(--muted); text-align: center; font-size: .9rem; }

.header-actions { display: flex; align-items: center; gap: .9rem; flex-shrink: 0; }
.lang-switch {
  border: 2px solid var(--pink-mid); border-radius: 999px; padding: .25rem .8rem;
  font-weight: 700; font-size: .85rem; color: var(--pink-dark); transition: all .15s;
}
.lang-switch:hover { background: var(--pink); border-color: var(--pink); color: #fff; }
.cart-link { position: relative; display: grid; place-items: center; color: var(--ink); }
.cart-badge {
  position: absolute; top: -7px; inset-inline-end: -9px; background: var(--pink);
  color: #fff; font-size: .68rem; font-weight: 700; border-radius: 999px;
  min-width: 18px; height: 18px; display: grid; place-items: center; padding-inline: 4px;
}

.cat-nav { border-top: 1px solid var(--line); background: var(--white); }
.cat-nav-inner { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav a {
  padding: .55rem .9rem; font-weight: 500; font-size: .92rem; white-space: nowrap;
  border-bottom: 3px solid transparent; color: var(--muted);
}
.cat-nav a:hover { color: var(--pink-dark); }
.cat-nav a.active { color: var(--pink-dark); border-bottom-color: var(--pink); font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--pink-soft), var(--cream) 55%, #fff);
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: flex; align-items: center; gap: 2rem; padding-block: 2.2rem; }
.hero-text h1 { font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.25; }
.hero-text h1 span { color: var(--pink); }
.hero-text p { color: var(--muted); margin-top: .5rem; max-width: 46ch; }
.hero-badges { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.hero-badges span {
  background: var(--white); border: 1px solid var(--pink-mid); color: var(--pink-dark);
  border-radius: 999px; padding: .3rem .85rem; font-size: .82rem; font-weight: 700;
}
.hero-logo { margin-inline-start: auto; flex-shrink: 0; }
.hero-logo img { width: clamp(120px, 22vw, 210px); border-radius: 50%; box-shadow: var(--shadow); }

/* ---------- Catalog layout ---------- */
.catalog { display: grid; grid-template-columns: 250px 1fr; gap: 1.5rem; padding-block: 1.6rem; align-items: start; }
.section-title { font-size: 1.25rem; font-weight: 800; margin-block: 1.4rem .9rem; display: flex; align-items: center; gap: .6rem; }
.section-title::after { content: ''; flex: 1; height: 2px; background: linear-gradient(to var(--grad-end, right), var(--pink-mid), transparent); }
html[dir="rtl"] .section-title::after { --grad-end: left; }

/* Filters */
.filters { background: var(--white); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); position: sticky; top: 130px; }
.filters h3 { font-size: 1rem; margin-bottom: .8rem; display: flex; justify-content: space-between; align-items: center; }
.filters h3 a { font-size: .78rem; color: var(--pink-dark); font-weight: 500; }
.filter-group { margin-bottom: 1rem; }
.filter-group > label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .35rem; color: var(--ink); }
.filter-group select, .filter-group input[type=number] {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: .45rem .6rem; background: var(--cream);
}
.price-inputs { display: flex; gap: .5rem; }
.check-line { display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 500; cursor: pointer; }
.check-line input { accent-color: var(--pink); width: 17px; height: 17px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--pink); color: #fff; border: 0; border-radius: 999px;
  padding: .6rem 1.4rem; font-weight: 700; font-size: .95rem; transition: background .15s;
}
.btn:hover { background: var(--pink-dark); }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border: 2px solid var(--pink); color: var(--pink-dark); }
.btn-outline:hover { background: var(--pink-soft); }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #000; }
.btn-wa { background: #25d366; }
.btn-wa:hover { background: #1eb955; }

.filters-toggle { display: none; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s; position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(201, 74, 99, .18); }
.card-img { aspect-ratio: 1; background: var(--pink-soft); position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-tag {
  position: absolute; top: 10px; inset-inline-start: 10px; background: var(--ink); color: #fff;
  font-size: .68rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px;
}
.card-tag.tag-ws { background: var(--pink); }
.card-body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card-brand { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.card-name { font-weight: 700; font-size: .95rem; line-height: 1.35; }
.card-name a::after { content: ''; position: absolute; inset: 0; }
.card-prices { margin-top: auto; padding-top: .4rem; }
.price-retail { font-weight: 800; font-size: 1.1rem; color: var(--pink-dark); }
.price-ws {
  display: inline-flex; align-items: center; gap: .3rem; margin-top: .2rem;
  background: var(--pink-soft); color: var(--pink-dark); font-size: .75rem; font-weight: 700;
  border-radius: 999px; padding: .15rem .6rem;
}
.card-add {
  position: relative; z-index: 2; margin-top: .5rem; display: flex; gap: .4rem;
}
.card-add .btn { flex: 1; padding: .45rem .6rem; font-size: .85rem; }
.oos { color: var(--muted); font-weight: 700; font-size: .85rem; text-align: center; padding: .45rem; background: var(--cream); border-radius: 999px; margin-top: .5rem; }

.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.results-bar .count { color: var(--muted); font-size: .9rem; }
.results-bar select { border: 1.5px solid var(--line); border-radius: 999px; padding: .4rem .9rem; background: var(--white); font-size: .88rem; }

.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty-state svg { margin-inline: auto; margin-bottom: 1rem; color: var(--pink-mid); }

/* Pagination */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1.6rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
  background: var(--white); font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); padding-inline: .5rem;
}
.pagination .current { background: var(--pink); color: #fff; }

/* ---------- Product page ---------- */
.product-page { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: 2.2rem; padding-block: 2rem; align-items: start; }
.product-gallery { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.product-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-info h1 { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800; line-height: 1.3; }
.product-info .card-brand { font-size: .85rem; }
.price-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.3rem; margin-block: 1.1rem; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-block: .35rem; }
.price-row + .price-row { border-top: 1px dashed var(--line); }
.price-row .lbl { color: var(--muted); font-size: .9rem; font-weight: 500; }
.price-row .val { font-weight: 800; font-size: 1.3rem; color: var(--pink-dark); }
.price-row .val small { font-size: .8rem; color: var(--muted); font-weight: 500; }
.ws-note {
  background: var(--pink-soft); border: 1px dashed var(--pink); color: var(--pink-dark);
  border-radius: 10px; padding: .6rem .9rem; font-size: .88rem; font-weight: 500; margin-top: .7rem;
}
.qty-row { display: flex; align-items: center; gap: 1rem; margin-block: 1rem; flex-wrap: wrap; }
.qty-stepper { display: inline-flex; align-items: center; border: 2px solid var(--pink-mid); border-radius: 999px; overflow: hidden; background: var(--white); }
.qty-stepper button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.2rem; font-weight: 700; color: var(--pink-dark); }
.qty-stepper button:hover { background: var(--pink-soft); }
.qty-stepper input { width: 56px; text-align: center; border: 0; font-weight: 700; font-size: 1rem; outline: none; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.live-price { font-weight: 700; color: var(--pink-dark); font-size: 1rem; }
.live-price .badge-ws { background: var(--pink); color: #fff; border-radius: 999px; padding: .1rem .55rem; font-size: .72rem; margin-inline-start: .4rem; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; }
.gallery-thumb {
  width: 68px; height: 68px; border-radius: 10px; overflow: hidden; padding: 0;
  border: 2.5px solid transparent; background: var(--white); box-shadow: var(--shadow);
  transition: border-color .15s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--pink); }

.product-videos { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: flex-start; }
.video-card { display: flex; flex-direction: column; gap: .6rem; }
.video-embed {
  background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.video-embed.wide { width: min(560px, 92vw); aspect-ratio: 16 / 9; }
.video-embed.tall { width: min(325px, 86vw); aspect-ratio: 9 / 16; }
.video-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-link { align-self: center; font-size: .85rem; padding: .4rem 1.1rem; }

.captcha-box label { font-size: .82rem; font-weight: 700; }
.captcha-row { display: flex; align-items: center; gap: .6rem; margin-top: .3rem; }
.captcha-row .captcha-q {
  background: var(--pink-soft); color: var(--pink-dark); font-weight: 800;
  border-radius: 10px; padding: .5rem .9rem; white-space: nowrap;
}
.captcha-row input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 10px; padding: .55rem .7rem; background: var(--cream); outline: none; }
.captcha-row input:focus { border-color: var(--pink); background: #fff; }

.sum-hint {
  background: var(--pink-soft); color: var(--pink-dark); border-radius: 10px;
  padding: .55rem .9rem; font-size: .85rem; font-weight: 700; margin-top: .7rem;
}
.sum-warning {
  background: #fff3d6; color: #9a6b00; border: 1px dashed #e2bc62; border-radius: 10px;
  padding: .65rem .9rem; font-size: .88rem; font-weight: 700; margin-top: .7rem;
}

.shop-flash-error {
  background: #fdeaea; color: #b3373c; border: 1px solid #f3c1c4;
  border-radius: 12px; padding: .8rem 1.2rem; margin-bottom: 1.2rem; font-weight: 700;
}

.product-desc { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.4rem; margin-top: 1.2rem; }
.product-desc h2 { font-size: 1.05rem; margin-bottom: .5rem; }
.product-desc p { color: #4c4449; white-space: pre-line; }

/* ---------- Cart ---------- */
.cart-page { padding-block: 2rem; display: grid; grid-template-columns: 1fr 340px; gap: 1.6rem; align-items: start; }
.cart-list { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cart-item { display: flex; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; background: var(--pink-soft); }
.ci-info { flex: 1; min-width: 160px; }
.ci-info .name { font-weight: 700; }
.ci-info .meta { font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.ci-info .meta .badge-ws { background: var(--pink); color: #fff; border-radius: 999px; padding: .05rem .5rem; font-size: .7rem; font-weight: 700; }
.ci-qty form { display: flex; align-items: center; gap: .5rem; }
.ci-line { font-weight: 800; color: var(--pink-dark); min-width: 84px; text-align: end; }
.ci-remove { background: none; border: 0; color: var(--muted); font-size: .8rem; text-decoration: underline; }
.ci-remove:hover { color: var(--pink-dark); }

.cart-summary { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem; position: sticky; top: 130px; }
.cart-summary h2 { font-size: 1.1rem; margin-bottom: .8rem; }
.sum-row { display: flex; justify-content: space-between; padding-block: .4rem; font-weight: 500; }
.sum-row.total { border-top: 2px solid var(--line); margin-top: .4rem; padding-top: .8rem; font-weight: 800; font-size: 1.15rem; color: var(--pink-dark); }
.checkout-form { margin-top: 1rem; display: grid; gap: .7rem; }
.checkout-form label { font-size: .82rem; font-weight: 700; }
.checkout-form input, .checkout-form textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: .55rem .7rem; background: var(--cream); outline: none;
}
.checkout-form input:focus, .checkout-form textarea:focus { border-color: var(--pink); background: #fff; }
.form-note { font-size: .8rem; color: var(--muted); }

/* ---------- Order success ---------- */
.success-page { max-width: 560px; margin-inline: auto; text-align: center; padding-block: 3rem; }
.success-page .tick {
  width: 84px; height: 84px; border-radius: 50%; background: var(--pink-soft);
  display: grid; place-items: center; margin-inline: auto; margin-bottom: 1.2rem; color: var(--pink-dark);
}
.success-page h1 { font-size: 1.5rem; }
.success-page .order-no { font-size: 1.15rem; font-weight: 800; color: var(--pink-dark); background: var(--white); border-radius: 999px; display: inline-block; padding: .4rem 1.3rem; margin-block: 1rem; box-shadow: var(--shadow); }
.success-page p { color: var(--muted); margin-bottom: 1.4rem; }
.success-actions { display: flex; flex-direction: column; gap: .7rem; align-items: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #f5eef0; margin-top: 2.5rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1.6rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: .9rem; }
.footer-brand img { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--pink); }
.footer-brand p { color: #b9aeb3; font-size: .85rem; }
.footer-social { display: flex; align-items: center; gap: .9rem; }
.footer-social > span { font-weight: 700; color: var(--pink-mid); }
.social-links { display: flex; gap: .6rem; }
.social-links a {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #fff; transition: all .15s;
}
.social-links a:hover { background: var(--pink); transform: translateY(-2px); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-block: .8rem; font-size: .8rem; color: #9c9095; text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 999px; padding: .65rem 1.5rem;
  font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 100;
  animation: toast-in .25s ease;
}
html[dir="rtl"] .toast { transform: translateX(50%); }
@keyframes toast-in { from { opacity: 0; translate: 0 12px; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; }
  .search-box { order: 3; flex-basis: 100%; max-width: none; }
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters-toggle {
    display: inline-flex; margin-bottom: .8rem;
  }
  .filters.collapsed { display: none; }
  .product-page { grid-template-columns: 1fr; }
  .cart-page { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .hero-inner { flex-direction: column-reverse; text-align: center; }
  .hero-logo { margin-inline: auto; }
  .hero-badges { justify-content: center; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .brand-text small { display: none; }
  .ci-line { min-width: auto; }
}
