/* =====================================================================
   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;
}

.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%;
}
