/* =====================================================================
   Aswaqify — Brand Identity (storefront)
   ---------------------------------------------------------------------
   Omani Red   #C8102E  — primary
   Strong Green #009A44 — secondary
   Sky White   #F7FCFE  — background
   Typeface    Alexandria (self-hosted, variable 100–900)

   This file is loaded LAST in frontend/master.blade.php so the brand
   wins over the template stylesheets (app.css, style.css).
   ===================================================================== */

@font-face {
  font-family: 'Alexandria';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../../fonts/alexandria/Alexandria-Variable.woff2') format('woff2-variations'),
       url('../../fonts/alexandria/Alexandria-Variable.woff2') format('woff2');
}

/* ---------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------- */
:root {
  /* Brand palette */
  --brand-red:          #C8102E;
  --brand-red-hover:    #B00E28;
  --brand-red-deep:     #A00D25;
  --brand-red-soft:     #FDF0F2;
  --brand-green:        #009A44;
  --brand-green-hover:  #008A3D;
  --brand-green-text:   #00843A; /* AA contrast for small green text on light backgrounds */
  --brand-green-soft:   #EAF7EF;
  --brand-sky:          #F7FCFE;

  /* Neutrals */
  --ink:          #1B1F24;
  --ink-soft:     #4B5563;
  --ink-muted:    #6B7280;
  --line:         #E5EBF0;
  --line-strong:  #D3DCE3;
  --surface:      #FFFFFF;

  /* Semantic */
  --brand-primary:       var(--brand-red);
  --brand-primary-hover: var(--brand-red-hover);
  --brand-accent:        var(--brand-green);
  --brand-font:          'Alexandria', 'Segoe UI', Tahoma, Arial, sans-serif;

  /* Shape, depth, motion */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --focus-ring: 0 0 0 3px rgba(200, 16, 46, .22);

  /* Template variables (main.css / development.css) mapped to the brand */
  --theme-color:  var(--brand-primary);
  --primary-font: var(--brand-font);
}

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--brand-font);
  color: var(--ink);
  background-color: var(--brand-sky);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
button, input, select, textarea, optgroup,
.btn, .form-control, .form-select, .tooltip, .popover, .dropdown-menu, .modal {
  font-family: var(--brand-font);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
}

a:hover {
  color: var(--brand-primary);
}

::selection {
  background: var(--brand-red);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--brand-sky); }
::-webkit-scrollbar-thumb { background: #C5CED6; border-radius: 10px; border: 2px solid var(--brand-sky); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-red); }

/* ---------------------------------------------------------------------
   Buttons & form controls
   --------------------------------------------------------------------- */
.btn.btn-primary,
.btn-primary {
  background-color: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--brand-red-hover);
  border-color: var(--brand-red-hover);
  color: #fff;
}

.btn.btn-success,
.btn-success {
  background-color: var(--brand-green);
  border-color: var(--brand-green);
  color: #fff;
}

.btn.btn-success:hover,
.btn-success:hover {
  background-color: var(--brand-green-hover);
  border-color: var(--brand-green-hover);
  color: #fff;
}

.btn.btn-outline-primary {
  color: var(--brand-red);
  border-color: var(--brand-red);
}

.btn.btn-outline-primary:hover {
  background-color: var(--brand-red);
  color: #fff;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-red);
  box-shadow: var(--focus-ring);
}

.form-check-input:checked {
  background-color: var(--brand-red);
  border-color: var(--brand-red);
}

.text-primary { color: var(--brand-red) !important; }
.text-success { color: var(--brand-green-text) !important; }
.bg-primary   { background-color: var(--brand-red) !important; }
.bg-success   { background-color: var(--brand-green) !important; }

/* ---------------------------------------------------------------------
   Section headings (homepage and listing pages)
   --------------------------------------------------------------------- */
.categories-section .title,
.sg-seller-product .title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.categories-section .title h1,
.sg-seller-product .title h1 {
  font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  position: relative;
}

.categories-section .title h1::after,
.sg-seller-product .title h1::after {
  content: '';
  position: absolute;
  bottom: -13px;
  inset-inline-start: 0;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: var(--brand-red);
}

.categories-section .title a,
.sg-seller-product .title a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--brand-green-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .2s var(--ease);
}

.categories-section .title a:hover,
.sg-seller-product .title a:hover {
  color: var(--brand-red);
}

/* ---------------------------------------------------------------------
   Category tiles
   --------------------------------------------------------------------- */
.category-content .category-slider {
  text-align: center;
  padding: 8px;
}

.category-content .category-slider .slider_div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  text-decoration: none;
}

.category-content .category-slider .slider_div:hover {
  border-color: rgba(200, 16, 46, .35);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.category-content .category-slider .slider_div img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
}

.category-content .category-slider .slider_div span {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

/* ---------------------------------------------------------------------
   Product cards (template components)
   --------------------------------------------------------------------- */
.sg-product {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}

.sg-product:hover {
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.sg-product .product-title a {
  color: var(--ink);
  font-weight: 500;
}

.sg-product .product-title a:hover {
  color: var(--brand-red);
}

.sg-product .product-price,
.sg-product .price {
  color: var(--brand-red);
  font-weight: 700;
}

.sg-product del,
.sg-product .price del {
  color: var(--ink-muted);
  font-weight: 400;
}

/* ---------------------------------------------------------------------
   Breadcrumb, pagination, tabs
   --------------------------------------------------------------------- */
.sg-breadcrumb .breadcrumb-item a,
.breadcrumb .breadcrumb-item a {
  color: var(--ink-soft);
}

.sg-breadcrumb .breadcrumb-item a:hover,
.breadcrumb .breadcrumb-item a:hover {
  color: var(--brand-red);
}

.pagination .page-link {
  color: var(--ink);
  border-color: var(--line);
}

.pagination .page-link:hover {
  color: var(--brand-red);
  background: var(--brand-red-soft);
  border-color: var(--line);
}

.pagination .page-item.active .page-link {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
  color: var(--brand-red);
  border-bottom-color: var(--brand-red);
}

.nav-pills .nav-link.active {
  background-color: var(--brand-red);
  color: #fff;
}

/* ---------------------------------------------------------------------
   Carousels
   --------------------------------------------------------------------- */
.slick-dots li button:before {
  color: var(--ink-muted) !important;
  opacity: .35;
}

.slick-dots li.slick-active button:before {
  color: var(--brand-red) !important;
  opacity: 1;
}

.slick-prev:before,
.slick-next:before {
  color: var(--brand-red) !important;
}

/* ---------------------------------------------------------------------
   Utilities used across pages
   --------------------------------------------------------------------- */
.btnTOP {
  color: #fff;
  background: var(--brand-red);
  border-color: var(--brand-red);
  box-shadow: var(--shadow-md);
}

.btnTOP:hover {
  color: #fff;
  background: var(--brand-red-hover);
  border-color: var(--brand-red-hover);
}

.toast-success { background-color: var(--brand-green) !important; }
.toast-error   { background-color: var(--brand-red) !important; }

/* Rating stars stay gold — a universal convention, not a brand colour */
.mdi-star, .mdi-star-half-full, .mdi-star-half { color: #F5A623; }

/* Scroll reveal (see frontend/js/brand-interactions.js) */
.ovet-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

.ovet-reveal.revealed {
  opacity: 1;
  transform: none;
}

@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  30%      { transform: scale(1.2); }
  60%      { transform: scale(.95); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .ovet-reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------------
   Homepage rhythm — the template hard-codes large gaps inline
   --------------------------------------------------------------------- */
.hero-slider .slider__img > a {
  display: block;
  width: 100%;
}

.hero-slider .slider__img img {
  width: 100%;
  height: auto;
}

/* The template caps slides at 400px and crops them (sized for the old 970x400 slider);
   show the whole image at its own proportions instead */
.hero-slider .hero-slide-item .slider__img {
  max-height: none;
}

.hero-slider .hero-slide-item .slider__img img {
  object-fit: contain;
}

.categories-section > .container {
  margin-top: 0 !important;
}

.categories-section .category-content {
  height: auto !important;
}

.categories-section,
.sg-seller-product.best-shop {
  padding: clamp(16px, 3vw, 28px) 0;
}

.category-content .category-slider {
  padding: 6px 6px 14px;
}

.category-content .category-slider .slider_div {
  width: 100%;
}

/* ---------------------------------------------------------------------
   Shop cards without a banner
   Instead of the grey "no image" placeholder, the cover is a soft blur
   of the shop's own logo over the brand red. With no logo either, the
   brand gradient alone is shown.
   --------------------------------------------------------------------- */
.sg-seller-product .product-thumb .shop-cover {
  display: block;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.sg-seller-product .product-thumb .shop-cover--empty {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(150deg, var(--brand-red) 0%, var(--brand-red-deep) 55%, #3A0710 100%);
}

.sg-seller-product .product-thumb .shop-cover--empty::before {
  content: "";
  position: absolute;
  inset: -40px;
  z-index: -1;
  background-image: var(--shop-logo, none);
  background-position: center;
  background-size: cover;
  filter: blur(26px) saturate(1.35);
  opacity: 0.85;
  transform: scale(1.15);
}

.sg-seller-product .product-thumb .shop-cover--empty::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.28) 100%);
}

.sg-seller-product .product-thumb .shop-cover--empty img {
  background: transparent;
}

/* Uploaded banners of any shape fill the cover neatly instead of stretching. */
.sg-seller-product .product-thumb .shop-cover img {
  object-fit: cover;
  object-position: center;
}

/* ------------------------------------------------------------------
   Login / register forms: one field style, even spacing, icon inside
   the field on the reading-start side, and a fixed +968 phone field.
   ------------------------------------------------------------------ */
.ragister-account .auth-form .auth-field {
  position: relative;
  margin-bottom: 14px;
}

/* style.css forces form.ragister-form to LTR; Arabic text fields read right to left. */
[dir="rtl"] .ragister-account .auth-form .auth-field:not(.auth-field--phone) {
  direction: rtl;
}

.ragister-account .auth-form .auth-field .form-control {
  height: 48px;
  margin: 0;
  padding-inline-start: 44px;
  padding-inline-end: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  text-align: start;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.ragister-account .auth-form .auth-field .form-control::placeholder {
  color: var(--ink-muted);
}

.ragister-account .auth-form .auth-field .form-control:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, .12);
  outline: 0;
}

.ragister-account .auth-form .auth-field__icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 14px;
  transform: translateY(-50%);
  font-size: 20px;
  line-height: 1;
  color: var(--ink-muted);
  pointer-events: none;
}

/* Phone: flag and +968 on the left, then the 8 local digits (always LTR). */
.ragister-account .auth-form .auth-field--phone {
  display: flex;
  align-items: stretch;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.ragister-account .auth-form .auth-field--phone:focus-within {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, .12);
}

.ragister-account .auth-form .auth-phone__prefix {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  background: var(--brand-sky);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.ragister-account .auth-form .auth-phone__prefix img {
  border-radius: 2px;
}

.ragister-account .auth-form .auth-field--phone .form-control {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  letter-spacing: 1px;
  text-align: left;
  box-shadow: none;
}

.ragister-account .auth-form .auth-field--phone .form-control:focus {
  box-shadow: none;
}

.ragister-account .auth-form .auth-field--phone.is-readonly,
.ragister-account .auth-form .auth-field--phone.is-readonly .auth-phone__prefix {
  background: #F8FAFB;
}

.ragister-account .auth-form .auth-field--phone.is-readonly .form-control {
  color: var(--ink-soft);
}

.ragister-account .auth-form .auth-field--phone.error_border {
  margin-bottom: 14px !important;
  border-color: #DC3545 !important;
  border-radius: 8px;
}

.ragister-account .auth-form .validation_error {
  margin: -8px 0 12px;
}

.ragister-account .auth-form button.btn {
  margin-top: 4px;
}

.ragister-account .auth-form .otp_hint {
  margin: -4px 0 12px;
}
