/* ===================================================================
   REWEAR THEME — unified design system
   Load this AFTER assets/css/main.css on every page.
   It does not replace main.css; it fixes bugs and unifies components
   that were previously styled differently on every page.
=================================================================== */

:root{
  /* ---- BRAND COLORS (updated to match the new hanger/needle logo) ----
     Sampled straight from Logo.png: a warm caramel-gold (#AD7A49) paired
     with a near-black wordmark. Replaces the old rose-pink (#F50963)
     everywhere the codebase reads --primary / --tp-theme-1 / --rw-primary. */
  --primary: #AD7A49;
  --primary-dark: #7C5734;
  --primary-darker: #5F4328;
  --primary-soft: #F6EFE6;

  /* aliases so every stylesheet that reads a differently-named primary
     var (product-card.css uses --rw-primary, main.css uses --tp-theme-1)
     picks up the same gold automatically. */
  --rw-primary: var(--primary);
  --rw-primary-dark: var(--primary-dark);
  --tp-theme-1: var(--primary);

  /* one price color, used everywhere instead of 3 different greens/pinks */
  --rw-price: #16a34a;
  --rw-price-old: #9ca3af;

  --rw-text: #211a12;
  --rw-muted: #6b6058;
  --rw-border: #e9e1d6;
  --rw-bg-soft: #faf7f2;
  --rw-cream: #f6efe4;
  --rw-dark: #14100c;
  --rw-ink: #1c150e;
  --rw-radius: 14px;
}

/* ===================================================================
   0. HORIZONTAL SCROLLBAR FIX (without breaking the sticky header)
   The full-bleed category strips below use a `100vw` negative-margin
   trick, which overflows the page horizontally by the width of the
   scrollbar in most browsers. Clipping that overflow has to happen on
   <body>, not <html> — putting overflow-x on <html> (or on both) turns
   <body> into its own scroll container, which is what was silently
   breaking `position: sticky` on the header. This keeps <html> as the
   real scrolling element (so sticky keeps working) while still hiding
   the stray horizontal scrollbar.
=================================================================== */
html{ overflow-x: visible; }
body{ overflow-x: hidden; max-width: 100%; }
*{ box-sizing: border-box; }

/* ===================================================================
   1. CANONICAL PRODUCT CARD
   One card component, used on: homepage (Latest Products + per-category
   rails) and category.php grid. Same HTML class names in both places
   so they always look and behave identically.

   Structure:
   <div class="rw-card">
     <div class="rw-card-media">
       <img class="rw-card-img">
       <span class="rw-badge-discount">-20% OFF</span>
       <span class="rw-badge-condition">New</span>
       <button class="rw-card-fav">...</button>
     </div>
     <div class="rw-card-body">
       <h3 class="rw-card-title">...</h3>
       <div class="rw-card-meta">...</div>
       <div class="rw-card-price-row">
         <div class="rw-card-price">...</div>
         <button class="rw-card-cart">...</button>
       </div>
       <div class="rw-card-bid">...</div>       <!-- optional, pushed to bottom -->
     </div>
   </div>
=================================================================== */

.rw-card{
  background:#fff;
  border:1px solid var(--rw-border);
  border-radius:var(--rw-radius);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  height:100%;                 /* stretches to match tallest card in row */
  transition:transform .18s ease, box-shadow .18s ease;
}
.rw-card:hover{
  transform:translateY(-3px);
  box-shadow:0 14px 30px rgba(17,24,39,.10);
}

/* fixed-ratio image box: no more giant blank white areas above cards */
.rw-card-media{
  position:relative;
  width:100%;
  aspect-ratio:4/3;
  background:var(--rw-cream);
  overflow:hidden;
}
.rw-card-img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .3s ease;
}
.rw-card:hover .rw-card-img{ transform:scale(1.04); }

.rw-badge-discount{
  position:absolute; top:10px; left:10px;
  background:#ef4444; color:#fff;
  padding:4px 9px; border-radius:6px;
  font-size:11px; font-weight:700; letter-spacing:.2px;
  z-index:2;
}
.rw-badge-condition{
  position:absolute; top:10px; right:10px;
  background:#fff; color:var(--rw-text);
  border:1px solid var(--primary);
  padding:4px 10px; border-radius:20px;
  font-size:11px; font-weight:700;
  z-index:2;
}

.rw-card-body{
  padding:12px 14px 14px;
  display:flex;
  flex-direction:column;
  flex:1;                       /* fills remaining card height */
}

.rw-card-title{
  font-size:13px;
  font-weight:700;
  color:var(--rw-text);
  line-height:1.35;
  margin:0 0 6px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height:2.5em;             /* keeps title area equal even for 1-line titles */
}

.rw-card-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  font-size:11px;
  color:var(--rw-muted);
  margin-bottom:6px;
}
.rw-card-meta i{ color:var(--primary); margin-right:4px; }

.rw-card-price-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:auto;              /* pins price row to bottom of the card body */
}
.rw-card-price{
  font-weight:700;
  font-size:13px;
  color:var(--rw-price);
  display:flex;
  align-items:center;
  gap:6px;
}
.rw-card-price .old{
  text-decoration:line-through;
  color:var(--rw-price-old);
  font-weight:500;
  font-size:11px;
}
.rw-card-cart{
  flex-shrink:0;
  width:34px; height:34px;
  display:inline-flex; align-items:center; justify-content:center;
  background:#fff; color:var(--rw-muted);
  border:1px solid var(--rw-border); border-radius:9px;
}
.rw-card-cart:hover{ color:var(--primary); border-color:var(--primary); }

.rw-card-bid{ margin-top:10px; padding-top:10px; border-top:1px dashed var(--rw-border); }
.rw-card-bid .row-2{ display:flex; gap:6px; }
.rw-card-bid input{
  flex:1; height:34px; font-size:12px;
  border:1px solid var(--rw-border); border-radius:8px; padding:0 10px;
}
.rw-bid-toggle,.rw-buy-now{
  flex:1 1 48%;
  font-size:12px; font-weight:600;
  padding:7px 0; border-radius:8px; border:1px solid var(--primary);
  background:#fff; color:var(--primary);
  text-align:center; cursor:pointer;
}
.rw-buy-now{ background:var(--primary); color:#fff; border-color:var(--primary); }
.rw-bid-toggle:hover{ background:var(--primary-soft); }
.rw-bid-submit{
  height:34px; padding:0 14px; font-size:12px; font-weight:700;
  border:none; border-radius:8px; background:#16a34a; color:#fff;
}
.rw-bid-msg{ margin-top:6px; font-size:12px; color:#16a34a; font-weight:600; text-align:center; }
.rw-last-bid{ font-size:12px; color:var(--rw-muted); margin-top:8px; }
.rw-last-bid b{ color:var(--rw-text); }
.rw-wardrobe-tag{ font-size:12px; color:var(--rw-muted); margin-bottom:8px; font-weight:500; }
.rw-wardrobe-tag i{ color:var(--primary); margin-right:6px; }

/* equal-height rows: every .col in a card grid stretches its child .rw-card */
.rw-grid{ --bs-gutter-y:28px; }
.rw-grid > [class*="col"]{ display:flex; }

@media (max-width:576px){
  .rw-card{ border-radius:10px; }
  .rw-card-title{ font-size:11.5px; min-height:2.2em; margin-bottom:4px; }
  .rw-card-meta{ font-size:10px; gap:6px; margin-bottom:4px; }
  .rw-card-price{ font-size:12px; }
  .rw-card-price .old{ font-size:10px; }
  .rw-card-body{ padding:8px 9px 10px; }
  .rw-bid-toggle,.rw-buy-now{ font-size:10px; padding:5px 0; }
  .rw-card-cart{ width:28px; height:28px; border-radius:8px; }
  .rw-badge-discount,.rw-badge-condition{ font-size:9.5px; padding:3px 7px; top:6px; }
  .rw-badge-discount{ left:6px; } .rw-badge-condition{ right:6px; }
  .rw-grid{ --bs-gutter-y:16px; }
}

/* ===================================================================
   2. SITE-WIDE SECTION HEADINGS (unify spacing across homepage/category)
=================================================================== */
.tp-section-title{ color:var(--rw-text); }
.tp-section-subtitle-3{ color:var(--primary); }

/* ===================================================================
   3. MOBILE NAV — single source of truth (see header.php cleanup)
=================================================================== */
@media (max-width:1200px){
  .mobile-menu-btn{ display:block !important; }
}
.mobile-menu-list a:hover{ background:var(--primary); }

/* ===================================================================
   5. TYPOGRAPHY & SECTION HEADER REDESIGN
   The template's default heading style used a hollow "outline" text
   effect (-webkit-text-stroke, transparent fill) on every section
   title site-wide. Replacing with solid, bold modern headings + a
   proper pill-style eyebrow label, consistent everywhere.
=================================================================== */
.tp-section-subtitle-3{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--primary-soft); color:var(--primary) !important;
  padding:5px 14px; border-radius:999px;
  font-size:11px !important; font-weight:700 !important;
  letter-spacing:1px; text-transform:uppercase;
  margin-bottom:12px;
}
.tp-section-subtitle-3::before{
  content:''; width:6px; height:6px; border-radius:50%; background:var(--primary);
}
.tp-section-title{
  font-size:28px !important;
  font-weight:800 !important;
  color:#14141a !important;
  letter-spacing:-0.5px;
  line-height:1.15;
}
.tp-section-title span{
  -webkit-text-stroke: 0 !important;
  color:var(--primary) !important;
}
.tp-section-title i{
  font-style:normal;
  -webkit-text-stroke: 0 !important;
  color:#14141a !important;
}
@media (max-width:767px){ .tp-section-title{ font-size:21px !important; } }
@media (max-width:480px){ .tp-section-title{ font-size:18px !important; } .tp-section-subtitle-3{ font-size:10px !important; padding:4px 12px; } }

/* alternating section rhythm so the page doesn't read as one flat slab */
.tp-category-3-area{ background:#fff; }
#home-products{ background:#fbfbfc; border-radius:24px; padding-top:50px; padding-bottom:10px; }

/* buttons: consistent rounded-pill treatment site-wide */
.tp-btn-theme, .tp-btn-white{ border-radius:999px !important; font-weight:700 !important; letter-spacing:.2px; }
.hw-viewall{ background:linear-gradient(135deg,var(--primary),var(--primary-dark)); }

/* ===================================================================
   6. MOBILE CARD OVERFLOW FIX
   row-cols-2 forced 2 cards per row even on very narrow phones,
   cramming price/buttons and cutting off text. Single column below
   480px gives each card room to breathe.
=================================================================== */
@media (max-width:480px){
  #home-products-grid > .col,
  #category-products-container .row > .col,
  .row.row-cols-2 > .col{
     flex:0 0 100% !important;
     max-width:100% !important;
  }
}

/* ===================================================================
   7. LOGO TEXT FALLBACK (main.css .brand-text outline style)
=================================================================== */
.brand-text{
  -webkit-text-stroke: 1.5px var(--primary) !important;
  color:transparent;
}
.brand-text:hover{
  color:var(--primary) !important;
  -webkit-text-stroke: 0 !important;
}

/* ===================================================================
   8. LIGHT HEADER — the theme's header sits transparent/absolute over
   the hero by default (see main.css .tp-header-transparent), which is
   why the logo used to disappear against dark/busy hero imagery. Every
   header variant now gets a solid light background so the logo (dark
   wordmark + gold hanger) always reads clearly, on every page.
=================================================================== */
.tp-header-transparent,
.tp-header-style-1,
.tp-header-style-2,
.tp-header-style-3,
.tp-header-inner-style,
.tp-header-top-style,
.header-sticky,
.tp-header-style-2.header-sticky,
header.tp-header-transparent{
  background-color:#fff !important;
  box-shadow:0 1px 0 var(--rw-border), 0 6px 20px rgba(28,21,14,.05) !important;
}
/* nav links / icons already default to a dark color in main.css, so no
   extra text-color overrides are needed once the background is light */
.tp-header-logo img{ max-height:46px; width:auto; }
@media (max-width:767px){ .tp-header-logo img{ max-height:38px; } }

/* ===================================================================
   9. FLOATING ACTION BUTTONS — scroll-to-top must always sit directly
   above the WhatsApp bubble, same right edge, with a clean gap between
   them, on every screen size (they used to overlap on mobile because
   both buttons hard-coded their own bottom/right offsets).
=================================================================== */
.floating-whatsapp{
  right:22px !important;
  bottom:22px !important;
  width:56px !important;
  height:56px !important;
}
.back-to-top-wrapper{
  right:22px !important;
  left:auto !important;
}
.back-to-top-wrapper.back-to-top-btn-show{
  bottom:92px !important;   /* whatsapp bottom(22) + whatsapp height(56) + 14px gap */
}
.back-to-top-btn,
.back-to-top-wrapper{
  width:48px !important;
  height:48px !important;
}
.back-to-top-btn{
  line-height:48px !important;
  background:var(--primary) !important;
}

@media (max-width:767px){
  .floating-whatsapp{
    right:14px !important;
    bottom:14px !important;
    width:50px !important;
    height:50px !important;
  }
  .back-to-top-wrapper{
    right:14px !important;
  }
  .back-to-top-wrapper.back-to-top-btn-show{
    bottom:78px !important;  /* whatsapp bottom(14) + whatsapp height(50) + 14px gap */
  }
  .back-to-top-btn,
  .back-to-top-wrapper{
    width:42px !important;
    height:42px !important;
  }
  .back-to-top-btn{ line-height:42px !important; }
}

/* ===================================================================
   10. MOBILE COMPACT MODE — shrink typography, form fields, and card
   text site-wide (buyer + seller + admin pages) so nothing overflows
   or looks oversized on small screens. .rw-card already has its own
   mobile rules above; this section covers everything else: generic
   headings, paragraphs, buttons, inputs/selects/textareas, and tables,
   which is what the seller "add product" / admin forms are built from.
=================================================================== */
@media (max-width:768px){
  h1{ font-size:26px !important; }
  h2{ font-size:22px !important; }
  h3{ font-size:19px !important; }
  h4{ font-size:16px !important; }
  h5{ font-size:14.5px !important; }
  h6{ font-size:13px !important; }
  body, p{ font-size:13px !important; line-height:1.55 !important; }

  label, .form-label{ font-size:12px !important; margin-bottom:4px !important; }

  input:not([type=checkbox]):not([type=radio]),
  select,
  textarea,
  .form-control,
  .form-select{
    font-size:13px !important;
    height:38px !important;
    padding:6px 10px !important;
    border-radius:8px !important;
  }
  textarea.form-control{ height:auto !important; }
  select2-container,
  .select2-container .select2-selection--single{
    height:38px !important;
  }
  .select2-container .select2-selection--single .select2-selection__rendered{
    font-size:13px !important;
    line-height:38px !important;
  }

  .btn, .tp-btn, .tp-btn-theme, .tp-btn-white, button{
    font-size:12.5px !important;
    padding:8px 16px !important;
  }

  table{ font-size:12px !important; }
  table th, table td{ padding:6px 8px !important; }

  .card, .tp-cart-checkout-box, .checkout-cart-total{
    padding:12px !important;
    border-radius:10px !important;
  }
}

@media (max-width:480px){
  h1{ font-size:22px !important; }
  h2{ font-size:19px !important; }
  h3{ font-size:17px !important; }
  body, p{ font-size:12.5px !important; }

  input:not([type=checkbox]):not([type=radio]),
  select,
  textarea,
  .form-control,
  .form-select{
    font-size:12.5px !important;
    height:36px !important;
    padding:5px 9px !important;
  }

  .btn, .tp-btn, .tp-btn-theme, .tp-btn-white, button{
    font-size:12px !important;
    padding:7px 14px !important;
  }
}