/**
 * Oranat-tapis — brand design layer (layout, typography, surfaces)
 * @package Mtejry_Store
 */

:root {
  --ms-radius: 14px;
  --ms-radius-lg: 22px;
  --ms-radius-pill: 999px;
  --ms-shadow-soft: 0 10px 32px rgba(16, 34, 53, 0.08);
  --ms-shadow-card: 0 14px 36px rgba(16, 34, 53, 0.1);
  --ms-heading-font: 'Cairo', 'Tajawal', system-ui, sans-serif;
  --ms-frame: rgba(197, 138, 42, 0.18);
}

body.mtejry-store {
  background:
    radial-gradient(circle at 100% 0%, rgba(197, 138, 42, 0.09), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(16, 34, 53, 0.06), transparent 42%),
    var(--ms-bg);
}

body.mtejry-store::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 14px,
      rgba(197, 138, 42, 0.025) 14px,
      rgba(197, 138, 42, 0.025) 15px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 14px,
      rgba(16, 34, 53, 0.018) 14px,
      rgba(16, 34, 53, 0.018) 15px
    );
}

/* Typography */
.ms-block-title,
.ms-section-title,
.ms-hero-title,
.ms-hero-slide-title,
.ms-checkout-title,
.ms-thankyou-title,
.ms-account-app-title,
.ms-logo-text {
  font-family: var(--ms-heading-font);
  letter-spacing: 0.01em;
}

.ms-block-title,
.ms-section-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
}

.ms-block-title::before,
.ms-section-title::before {
  content: '';
  width: 4px;
  height: 1.1em;
  border-radius: var(--ms-radius-pill);
  background: linear-gradient(180deg, var(--ms-gold), var(--ms-gold-hover));
  flex-shrink: 0;
}

.ms-block-header,
.ms-section-header {
  border-bottom: 0;
  padding-bottom: 0;
}

.ms-section-more,
.ms-block-header .ms-section-more {
  padding: 8px 14px;
  border: 1px solid rgba(197, 138, 42, 0.35);
  border-radius: var(--ms-radius-pill);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  transition: background .2s, border-color .2s, transform .2s;
}

.ms-section-more:hover {
  background: var(--ms-gold);
  border-color: var(--ms-gold);
  color: #fff !important;
  transform: translateY(-1px);
}

/* Header */
.ms-header {
  position: sticky;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 0;
  box-shadow: 0 8px 28px rgba(16, 34, 53, 0.06);
}

.ms-header::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(to left, var(--ms-dark), var(--ms-gold-hover), var(--ms-gold));
}

.ms-top-bar {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 12px;
}

.ms-nav-list a {
  padding: 8px 14px;
  border-radius: var(--ms-radius-pill);
  transition: background .2s, color .2s;
}

.ms-nav-list a:hover {
  background: rgba(197, 138, 42, 0.12);
}

.ms-icon-btn {
  border: 1px solid var(--ms-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  transition: border-color .2s, background .2s, transform .2s;
}

.ms-icon-btn:hover {
  border-color: rgba(197, 138, 42, 0.45);
  background: #fff;
  transform: translateY(-1px);
}

/* Hero */
.ms-hero,
.ms-hero-slider,
.ms-hero-slide {
  position: relative;
  overflow: hidden;
}

.ms-hero::before,
.ms-hero-slider::before,
.ms-hero-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(197, 138, 42, 0.22), transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 55%);
}

.ms-hero-inner,
.ms-hero-slide-inner {
  position: relative;
  z-index: 1;
}

.ms-hero-title,
.ms-hero-slide-title {
  font-weight: 800;
  line-height: 1.25;
}

.ms-btn--accent,
.ms-btn--primary,
#place_order,
.ms-load-more-btn {
  border-radius: var(--ms-radius-pill) !important;
  background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-hover) 100%) !important;
  box-shadow: 0 8px 22px rgba(197, 138, 42, 0.35) !important;
}

.ms-btn--accent:hover,
.ms-btn--primary:hover,
#place_order:hover,
.ms-load-more-btn:hover {
  filter: brightness(1.03);
  transform: translateY(-2px);
}

/* Product cards — framed gallery look */
.ms-products-grid li.product,
.woocommerce ul.products li.product {
  border: 1px solid rgba(197, 138, 42, 0.12);
  border-radius: var(--ms-radius-lg);
  box-shadow: var(--ms-shadow-soft);
}

.ms-products-grid li.product:hover,
.woocommerce ul.products li.product:hover {
  box-shadow: var(--ms-shadow-card);
  border-color: rgba(197, 138, 42, 0.28);
}

.ms-product-thumb {
  padding: 14px 14px 0;
  background: linear-gradient(180deg, var(--oranat-ivory) 0%, #fff 100%);
}

.ms-product-image-link {
  border: 1px solid var(--ms-frame);
  border-radius: calc(var(--ms-radius-lg) - 6px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.ms-product-info .price,
.woocommerce ul.products li.product .price {
  color: var(--ms-gold-hover);
  font-family: var(--ms-heading-font);
  font-size: 16px;
}

.ms-sale-badge {
  border-radius: var(--ms-radius-pill);
  padding: 5px 10px;
  letter-spacing: 0.02em;
}

.ms-icon-action {
  border-radius: 12px;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.92);
}

/* Categories */
.ms-category-card {
  transition: transform .25s ease, color .25s ease;
}

.ms-category-img {
  border: 2px solid rgba(197, 138, 42, 0.2);
  box-shadow: 0 6px 18px rgba(16, 34, 53, 0.08);
}

.ms-category-card--no-image .ms-category-img--name,
.ms-category-img--name {
  border: 2px dashed rgba(197, 138, 42, 0.35);
  background: linear-gradient(145deg, #fff 0%, var(--oranat-ivory) 100%);
}

/* Home sections */
.ms-home-block {
  padding-top: 36px;
  padding-bottom: 16px;
}

.ms-product-section {
  padding: 18px;
  border: 1px solid rgba(197, 138, 42, 0.1);
  border-radius: var(--ms-radius-lg);
  background: color-mix(in srgb, var(--oranat-beige) 28%, #fff);
  box-shadow: var(--ms-shadow-soft);
}

/* Checkout & thank you */
.ms-checkout-summary,
.ms-thankyou-card {
  border-radius: var(--ms-radius-lg);
  border: 1px solid rgba(197, 138, 42, 0.14);
  box-shadow: var(--ms-shadow-soft);
}

.ms-checkout-billing input.input-text,
.ms-checkout-billing textarea {
  border-radius: 12px;
}

/* Footer */
.ms-footer {
  position: relative;
  margin-top: 48px;
  padding: 36px 0 28px;
  background: linear-gradient(180deg, var(--oranat-navy) 0%, #0a1623 100%);
  color: rgba(255, 255, 255, 0.78);
  border-top: 0;
}

.ms-footer::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(to left, var(--ms-gold), var(--ms-gold-hover), transparent);
}

.ms-footer-title,
.ms-footer-links a,
.ms-footer-made,
.ms-footer-made a {
  color: rgba(255, 255, 255, 0.88);
}

.ms-footer-links a:hover,
.ms-footer-title:hover,
.ms-footer-made a:hover {
  color: var(--ms-gold);
}

.ms-footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
}

/* WhatsApp float */
.ms-wa-float {
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.35);
  transition: transform .2s, box-shadow .2s;
}

.ms-wa-float:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 32px rgba(37, 211, 102, 0.45);
}

/* Drawers */
.ms-nav-drawer__panel,
.ms-cart-drawer__panel {
  border-radius: var(--ms-radius-lg) 0 0 var(--ms-radius-lg);
}

html[dir="rtl"] .ms-nav-drawer__panel {
  border-radius: 0 var(--ms-radius-lg) var(--ms-radius-lg) 0;
}

/* Side cart — boutique panel */
.ms-cart-drawer__panel {
  width: min(100%, 420px);
  background: linear-gradient(180deg, var(--oranat-ivory) 0%, #fff 18%);
  border-inline-start: 1px solid rgba(197, 138, 42, 0.12);
}

.ms-cart-drawer__head {
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(197, 138, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

.ms-cart-drawer__brand {
  min-width: 0;
}

.ms-cart-drawer__eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ms-gold);
}

.ms-cart-drawer__title {
  font-family: var(--ms-heading-font);
  font-size: 1.15rem;
  font-weight: 800;
  gap: 10px;
}

.ms-cart-drawer__count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  box-shadow: 0 4px 12px rgba(197, 138, 42, 0.28);
}

.ms-cart-drawer__close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(197, 138, 42, 0.18);
  border-radius: 12px;
  background: #fff;
  color: var(--ms-title);
  font-size: 1.2rem;
}

.ms-cart-drawer__close:hover {
  background: var(--ms-gold);
  border-color: var(--ms-gold);
  color: #fff;
}

.ms-mini-cart__list {
  padding: 14px 16px 16px;
}

.ms-mini-cart__item {
  padding: 12px;
  margin-bottom: 10px;
  border-radius: var(--ms-radius);
  background: #fff;
  border: 1px solid rgba(197, 138, 42, 0.12);
  box-shadow: 0 6px 18px rgba(16, 34, 53, 0.05);
}

.ms-mini-cart__thumb {
  width: 72px;
  height: 72px;
}

.ms-mini-cart__thumb img {
  width: 72px !important;
  height: 72px !important;
  border-radius: 10px;
  border: 1px solid rgba(197, 138, 42, 0.14);
  object-fit: cover;
}

.ms-mini-cart__name {
  font-family: var(--ms-heading-font);
  font-size: .84rem;
}

.ms-mini-cart__price {
  font-family: var(--ms-heading-font);
  font-size: .88rem;
}

.ms-cart-qty {
  border-radius: 6px;
  border-color: var(--ms-border);
  background: #fff;
}

.ms-cart-qty__btn {
  width: 24px;
  height: 24px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ms-muted);
}

.ms-cart-qty__btn:hover {
  background: var(--ms-bg);
  color: var(--ms-title);
}

.ms-cart-qty__val {
  min-width: 22px;
  font-size: .78rem;
  font-weight: 500;
}

.ms-cart-qty.is-updating {
  opacity: 0.65;
  pointer-events: none;
}

.ms-mini-cart__footer {
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(197, 138, 42, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(16, 34, 53, 0.06);
}

.ms-mini-cart__total {
  margin-bottom: 12px;
  font-weight: 600;
}

.ms-mini-cart__total-val {
  font-family: var(--ms-heading-font);
  font-size: 1.12rem;
  color: var(--ms-gold-hover);
}

.ms-mini-cart__checkout {
  border-radius: var(--ms-radius-pill) !important;
}

.ms-mini-cart__view-cart {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ms-muted);
  text-decoration: none;
}

.ms-mini-cart__view-cart:hover {
  color: var(--ms-gold);
}

.ms-mini-cart__empty {
  padding: 40px 24px;
}

.ms-mini-cart__empty-art,
.ms-cart-empty-page__icon--art {
  width: 88px;
  height: 88px;
  margin-bottom: 16px;
  border-radius: 22px;
  border: 1px dashed rgba(197, 138, 42, 0.35);
  background:
    linear-gradient(135deg, rgba(197, 138, 42, 0.12), rgba(255, 255, 255, 0.9)),
    repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(197, 138, 42, 0.06) 8px, rgba(197, 138, 42, 0.06) 9px);
}

.ms-mini-cart__empty-title,
.ms-cart-empty-page__title {
  margin: 0 0 8px;
  font-family: var(--ms-heading-font);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ms-title);
}

.ms-mini-cart__empty-text,
.ms-cart-empty-page__text {
  margin: 0 0 18px;
  max-width: 260px;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--ms-muted);
}

.ms-drawer-tab.is-active {
  border-radius: 10px 10px 0 0;
}

/* Shop — toolbar & custom sort select */
.ms-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid rgba(197, 138, 42, 0.12);
  border-radius: var(--ms-radius-lg);
  background: color-mix(in srgb, var(--oranat-beige) 22%, var(--oranat-ivory));
  box-shadow: var(--ms-shadow-soft);
}

.woocommerce .woocommerce-result-count {
  margin: 0 !important;
  float: none !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--ms-muted);
}

.woocommerce .woocommerce-ordering {
  margin: 0 !important;
  float: none !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.woocommerce .woocommerce-ordering::before {
  content: '';
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23C58A2A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M7 12h10M10 18h4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.9;
}

.woocommerce .woocommerce-ordering select.orderby {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 220px;
  max-width: 100%;
  padding: 11px 18px 11px 42px;
  border: 1px solid rgba(197, 138, 42, 0.28);
  border-radius: var(--ms-radius-pill);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23102235' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 14px;
  font-family: var(--ms-heading-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--ms-title);
  cursor: pointer;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(16, 34, 53, 0.04);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}

html[dir="rtl"] .woocommerce .woocommerce-ordering select.orderby {
  padding: 11px 42px 11px 18px;
  text-align: right;
}

.woocommerce .woocommerce-ordering select.orderby:hover {
  border-color: rgba(197, 138, 42, 0.55);
  background-color: #fffdfa;
}

.woocommerce .woocommerce-ordering select.orderby:focus {
  outline: none;
  border-color: var(--ms-gold);
  box-shadow: 0 0 0 3px rgba(197, 138, 42, 0.18);
}

@media (max-width: 767px) {
  .ms-shop-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
  }

  .woocommerce .woocommerce-ordering {
    width: 100%;
  }

  .woocommerce .woocommerce-ordering select.orderby {
    width: 100%;
    min-width: 0;
  }

  .ms-block-title,
  .ms-section-title {
    font-size: 1.15rem;
  }

  .ms-hero {
    padding: 44px 0 52px;
  }
}
