/* Prevent horizontal overflow */
html, body {
  overflow-x: hidden;
  width: 100%;
}
/* ═══════════════════════════════════════════════════════════════
   IBRAHIM FASHION — Base Styles
   Reset + typography + form elements.
   Loaded after tokens.css, before everything else.
   ═══════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────
   1. MODERN RESET
   ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--if-header-h) + 16px);
}

body {
  min-height: 100vh;
  font-family: var(--if-font-body);
  font-size: var(--if-fs-body);
  font-weight: var(--if-fw-regular);
  line-height: var(--if-lh-relaxed);
  color: var(--if-body);
  background: var(--if-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}


/* ─────────────────────────────────────────────────────────────
   2. TYPOGRAPHY
   ───────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--if-font-display);
  font-weight: var(--if-fw-medium);
  line-height: var(--if-lh-snug);
  color: var(--if-charcoal);
  letter-spacing: var(--if-track-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--if-fs-h1);
  line-height: var(--if-lh-tight);
}

h2 {
  font-size: var(--if-fs-h2);
  line-height: var(--if-lh-tight);
}

h3 {
  font-size: var(--if-fs-h3);
}

h4 {
  font-size: var(--if-fs-h4);
}

h5 {
  font-size: var(--if-fs-h5);
}

h6 {
  font-size: var(--if-fs-sm);
  text-transform: uppercase;
  letter-spacing: var(--if-track-wider);
  font-family: var(--if-font-body);
  font-weight: var(--if-fw-semi);
}

p {
  font-size: var(--if-fs-body);
  line-height: var(--if-lh-relaxed);
  color: var(--if-body);
}

p + p {
  margin-top: var(--if-s4);
}

strong,
b {
  font-weight: var(--if-fw-semi);
  color: var(--if-ink);
}

small {
  font-size: var(--if-fs-sm);
  color: var(--if-muted);
}

/* Eyebrow label — used above section titles */
.if-eyebrow {
  display: inline-block;
  font-family: var(--if-font-body);
  font-size: var(--if-fs-xs);
  font-weight: var(--if-fw-medium);
  letter-spacing: var(--if-track-widest);
  text-transform: uppercase;
  color: var(--if-gold-deep);
  margin-bottom: var(--if-s3);
}


/* ─────────────────────────────────────────────────────────────
   3. LINKS
   ───────────────────────────────────────────────────────────── */
a {
  color: var(--if-charcoal);
  transition: color var(--if-dur-fast) var(--if-ease);
}

a:hover {
  color: var(--if-gold-deep);
}

/* Underlined link variant */
.if-link {
  position: relative;
  display: inline-block;
}

.if-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: var(--if-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--if-dur) var(--if-ease);
}

.if-link:hover::after {
  transform: scaleX(1);
}


/* ─────────────────────────────────────────────────────────────
   4. FOCUS — accessibility
   Never remove outlines. Make them beautiful instead.
   ───────────────────────────────────────────────────────────── */
:focus {
  outline: none;
}

:focus-visible {
  outline: var(--if-focus-width) solid var(--if-focus-color);
  outline-offset: var(--if-focus-offset);
  border-radius: var(--if-r-xs);
}


/* ─────────────────────────────────────────────────────────────
   5. SELECTION
   ───────────────────────────────────────────────────────────── */
::selection {
  background: var(--if-gold);
  color: var(--if-white);
}

::-moz-selection {
  background: var(--if-gold);
  color: var(--if-white);
}


/* ─────────────────────────────────────────────────────────────
   6. SCROLLBAR (desktop only, subtle)
   ───────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: var(--if-ivory);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--if-line-strong);
    border-radius: var(--if-r-pill);
    border: 2px solid var(--if-ivory);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--if-gold);
  }
}


/* ─────────────────────────────────────────────────────────────
   7. HORIZONTAL RULE — thin gold divider
   ───────────────────────────────────────────────────────────── */
hr {
  border: 0;
  height: 1px;
  background: var(--if-line);
  margin: var(--if-s6) 0;
}

hr.if-hr-gold {
  height: 1px;
  width: 64px;
  background: var(--if-gold);
  margin: var(--if-s5) auto;
}


/* ─────────────────────────────────────────────────────────────
   8. FORM ELEMENTS
   ───────────────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--if-font-body);
  font-size: var(--if-fs-body);
  color: var(--if-ink);
  background: var(--if-white);
  border: 1px solid var(--if-line);
  border-radius: var(--if-r-sm);
  transition: border-color var(--if-dur-fast) var(--if-ease),
              box-shadow var(--if-dur-fast) var(--if-ease);
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--if-faint);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--if-line-strong);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--if-gold);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.15);
  outline: none;
}

input:disabled,
textarea:disabled,
select:disabled {
  background: var(--if-ivory);
  color: var(--if-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: var(--if-lh-relaxed);
}

/* Select — custom arrow */
select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%232E2C29' stroke-width='1.5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  cursor: pointer;
}

/* Checkbox and radio */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  accent-color: var(--if-gold);
  cursor: pointer;
  vertical-align: middle;
}

/* Label */
label {
  display: block;
  font-size: var(--if-fs-sm);
  font-weight: var(--if-fw-medium);
  color: var(--if-ink);
  margin-bottom: var(--if-s2);
  letter-spacing: 0.02em;
}

label .if-required {
  color: var(--if-sale);
  margin-left: 2px;
}

/* Field group */
.if-field {
  margin-bottom: var(--if-s5);
}

.if-field__help {
  display: block;
  font-size: var(--if-fs-xs);
  color: var(--if-muted);
  margin-top: var(--if-s2);
  font-weight: var(--if-fw-regular);
  letter-spacing: 0;
}


/* ─────────────────────────────────────────────────────────────
   9. BUTTONS — base (variants come in components.css)
   ───────────────────────────────────────────────────────────── */
button,
input[type="submit"],
input[type="button"],
.if-btn {
  font-family: var(--if-font-body);
  font-size: var(--if-fs-sm);
  font-weight: var(--if-fw-medium);
  letter-spacing: var(--if-track-wide);
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--if-dur) var(--if-ease);
  -webkit-appearance: none;
  appearance: none;
}

button:disabled,
input[type="submit"]:disabled,
.if-btn:disabled,
.if-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}


/* ─────────────────────────────────────────────────────────────
   10. LISTS — utility
   ───────────────────────────────────────────────────────────── */
.if-list-dot li {
  position: relative;
  padding-left: var(--if-s5);
  margin-bottom: var(--if-s2);
}

.if-list-dot li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--if-gold);
}

.if-list-check li {
  position: relative;
  padding-left: var(--if-s6);
  margin-bottom: var(--if-s3);
}

.if-list-check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--if-gold-deep);
  font-weight: var(--if-fw-semi);
}


/* ─────────────────────────────────────────────────────────────
   11. ACCESSIBILITY HELPERS
   ───────────────────────────────────────────────────────────── */

/* Screen reader only — invisible but readable by assistive tech */
.if-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to content link — appears on keyboard focus */
.if-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: var(--if-z-toast);
  padding: 12px 20px;
  background: var(--if-charcoal);
  color: var(--if-white);
  font-size: var(--if-fs-sm);
  font-weight: var(--if-fw-medium);
  letter-spacing: var(--if-track-wide);
  text-transform: uppercase;
  border-radius: var(--if-r-sm);
  transition: top var(--if-dur) var(--if-ease);
}

.if-skip-link:focus {
  top: 16px;
  color: var(--if-white);
}


/* ─────────────────────────────────────────────────────────────
   12. TEXT UTILITIES
   ───────────────────────────────────────────────────────────── */
.if-text-center   { text-align: center; }
.if-text-left     { text-align: left; }
.if-text-right    { text-align: right; }

.if-text-gold     { color: var(--if-gold-deep); }
.if-text-muted    { color: var(--if-muted); }
.if-text-sale     { color: var(--if-sale); }
.if-text-success  { color: var(--if-success); }

.if-uppercase {
  text-transform: uppercase;
  letter-spacing: var(--if-track-wider);
}

.if-tabular-nums {
  font-variant-numeric: tabular-nums;
}


/* ─────────────────────────────────────────────────────────────
   13. WORDPRESS CORE CLASSES — minimal styling
   WordPress generates these; we align them with our design.
   ───────────────────────────────────────────────────────────── */
.alignleft {
  float: left;
  margin: 0 var(--if-s5) var(--if-s4) 0;
}

.alignright {
  float: right;
  margin: 0 0 var(--if-s4) var(--if-s5);
}

.aligncenter {
  margin-inline: auto;
  display: block;
}

.wp-caption {
  max-width: 100%;
  margin-bottom: var(--if-s5);
}

.wp-caption-text {
  font-size: var(--if-fs-sm);
  color: var(--if-muted);
  text-align: center;
  padding-top: var(--if-s2);
  font-style: italic;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* WordPress admin bar spacing */
.admin-bar .if-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .if-header {
    top: 46px;
  }
}


/* ─────────────────────────────────────────────────────────────
   14. PRINT STYLES — clean printouts
   ───────────────────────────────────────────────────────────── */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  img {
    max-width: 100% !important;
  }

  @page {
    margin: 1cm;
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }

  .if-header,
  .if-footer,
  .if-whatsapp,
  .if-back-to-top,
  button,
  .if-btn {
    display: none !important;
  }
}