/* ============================================================
   Rock Box - Cart flow shared stylesheet
   ------------------------------------------------------------
   Purpose
     Single source of truth for design tokens shared across all
     three cart-flow surfaces: mini-cart drawer, /your-record-bag/
     (cart page) and /checkout/. Contains the brand palette as
     CSS custom properties + shared utility classes for repeated
     visual patterns (like the uppercase warm-grey section label).

   What lives here
     - Brand palette (--rb-charcoal, --rb-red etc)
     - Font stack tokens (--rb-font-heading, --rb-font-body)
     - Shared utility classes (.rb-section-label)

   What does NOT live here
     - Surface-specific layout (drawer positioning, sidebar chrome,
       cart page grid). Each surface owns its layout in its own
       CSS file:
         rb-mini-cart.css     - drawer + items + qty controls
         rb-checkout.css      - two-column layout + sidebar
         rb-cart.css          - your-record-bag page (Phase 6)

   How consumers use it
     Each consumer file references custom properties via var().
     Fallback values are always supplied so if this shared file
     fails to load for any reason, the consumer still renders
     with correct colours:
         color: var(--rb-red, #e4032c);

   Loading
     Enqueued site-wide via rb_enqueue_cart_shared() in
     wc-functions.php on wp_enqueue_scripts priority 10.
     Priority is BEFORE both consumer files (mini-cart at 20,
     checkout at 20) so the custom properties are declared in
     the cascade before consumers reference them.

   Future migration
     rb-checkout.css already uses CSS custom properties from its
     5I consolidation (13 July 2026). rb-mini-cart.css uses hex
     literals throughout; to be migrated to var() calls when this
     shared file lands. rb-cart.css (Phase 6) will consume tokens
     from day one.
   ============================================================ */


/* --- 1. Brand palette ------------------------------------- */
/* Rock Box Colour Sheets, verified 13 July 2026.
   Any change here propagates to all cart-flow surfaces. */

:root {
    --rb-charcoal: #3d3d3b;         /* Primary charcoal - panels, backgrounds */
    --rb-charcoal-deep: #1e1e1c;    /* Deep charcoal - body text on light bg */
    --rb-red: #e4032c;              /* Primary brand red - CTAs, accents */
    --rb-red-tint: rgba(228, 3, 44, 0.04);  /* Ultra-light red tint - notice bg */
    --rb-red-hover: #b60024;        /* Darker red for button hover state */
    --rb-warm-grey: #a4a1a0;        /* Secondary warm grey - labels, meta */
    --rb-divider: #555553;          /* Divider lines on charcoal panels */
    --rb-field-border: #d0cfce;     /* Form field borders (light bg surfaces) */
    --rb-field-bg: #fafafa;         /* Form field background */
    --rb-white: #fff;
    --rb-black: #000;
}


/* --- 2. Font stacks --------------------------------------- */
/* Named tokens so consumers reference intent, not specifics.
   If font choices change, they change here once. */

:root {
    --rb-font-heading: 'Raleway', sans-serif;   /* Section titles, headings */
    --rb-font-body: 'Cabin', sans-serif;        /* Body copy, meta */
}


/* --- 3. Shared utility classes ---------------------------- */

/* Section label - uppercase warm-grey, letter-spaced, small
   caps-style. Used for labels like "SUBTOTAL", "SHIPMENT",
   "RECORD TOKENS" in the cart flow. Any surface that needs
   this treatment can add this class to a semantic element
   (span, label, th) and get consistent typography. */

.rb-section-label {
    font-family: var(--rb-font-heading, 'Raleway', sans-serif);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rb-warm-grey, #a4a1a0);
}

/* --- 4. Stock message colour overrides on charcoal ------- */
/* Applied on cart-flow surfaces where product rows sit on   */
/* charcoal grounds: mini-cart drawer, checkout sidebar,     */
/* /your-record-bag/ (cart page). Base .rb-stock.* rules in  */
/* custom.css remain the site-wide default for product cards,*/
/* single product pages etc.                                  */

.rb-mini-cart-drawer .rb-stock.in-stock,
.rb-mini-cart-drawer .rb-stock.pre-order,
.rb-checkout-sidebar .rb-stock.in-stock,
.rb-checkout-sidebar .rb-stock.pre-order,
.woocommerce-cart .rb-stock.in-stock,
.woocommerce-cart .rb-stock.pre-order {
    border-left-color: #5fb85c;
}

.rb-mini-cart-drawer .rb-stock.on-backorder,
.rb-checkout-sidebar .rb-stock.on-backorder,
.woocommerce-cart .rb-stock.on-backorder {
    border-left-color: #6aa8e8;
}

/* Supplier low or no stock: Early Bird yellow bar (same on charcoal). */
.rb-mini-cart-drawer .rb-stock.supplier-low,
.rb-checkout-sidebar .rb-stock.supplier-low,
.woocommerce-cart .rb-stock.supplier-low {
    border-left-color: #FAC400;
}

/* Supplier deleting (Oct 2026): orange bar, brighter on charcoal. */
.rb-mini-cart-drawer .rb-stock.supplier-deleting,
.rb-checkout-sidebar .rb-stock.supplier-deleting,
.woocommerce-cart .rb-stock.supplier-deleting {
    border-left-color: #FF9F43;
}

/* Stock message text on charcoal (Oct 2026). .rb-stock inherits its text
   colour, which on these surfaces was the page charcoal (#3d3d3b) - the
   message was invisible on the charcoal rows. Light grey as used for the
   pre-order note here (~6.4:1 contrast); the bar carries the state colour. */
.rb-mini-cart-drawer .rb-stock,
.rb-checkout-sidebar .rb-stock,
.woocommerce-cart .rb-stock {
    color: #c9c6c4;
}

/* YITH Pre-Order plugin output (charge-type note) renders with
   the site's default body text colour (#636363), tuned for white
   backgrounds. Override to the same on-charcoal grey used for
   on-backorder stock messages, for consistent readability. */
.woocommerce-cart .ywpo-charge-type-info {
    color: #c9c6c4;
}

/* The pre-order availability date sits on its own line looking
   orphaned/disconnected on the cart page - hide it here. The
   charge-type note above already conveys this is a pre-order. */
.woocommerce-cart .ywpo_availability_date.pre_order_on_cart {
    display: none;
}
