/*
 Theme Name:   Divi Child
 Theme URI:    https://sabasabai.no
 Description:  Sabasabai unified child theme stylesheet (recipes + shop + Divi header)
 Author:       Tore
 Author URI:   https://aliom.no
 Template:     Divi
 Version:      1.7.5-alpha

 ------------------------------------------------------------
 Version History
 ------------------------------------------------------------
 1.7.1 - Blog grid 4-column layout + hover zoom
 1.7.2 - Uniform height on desktop/tablet
 1.7.3 - Compact spacing between image and title
 1.7.4 - Mobile layout fix (safe single column)
 1.7.5 - Cleaned Ingredient Insights & Steps Overview (deprecated old image/product columns)
 ------------------------------------------------------------

 TABLE OF CONTENTS
 ------------------------------------------------------------
  0) Base / Variables / Resets
  1) Ingredient Insights (layout + Woo product)   [Deprecated + New clean]
  2) ACF Gallery Slider
  3) Steps Overview                               [Deprecated + New clean]
  4) Sticky Stack
  5) Divi Builder Preview Fixes
  6) Woo Buttons – site-wide gold
  7) Woo Button Motion Smoothing
  8) Theme Builder Add-to-Cart Fix
  9) Cart Totals Styling
 10) Blog Grid (4-column, even height, hover zoom, mobile safe)
 11) Woo Bundled Products
 12) Divi Header Search
 ------------------------------------------------------------
*/

/* =========================================================
   0) BASE / VARIABLES / RESETS
   --------------------------------------------------------- */
:root {
  --saba-gold: #c9a646;           /* warm golden-yellow accent */
  --saba-gold-darker: #a38334;    /* deeper gold hover tone */
  --saba-bluegray: #627e8b;       /* calm blue-gray base */
  --saba-green: #2f6f5e;          /* organic green tone */
  --saba-red: #a63a3a;            /* coral-red accent */
  --saba-graphite: #2e2f31;       /* soft dark neutral */
  --saba-ivory: #eae3d7;          /* warm ivory background */
  --header-sticky-height: 72px;   /* used for sticky offsets */
}

* {
  box-sizing: border-box;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* =========================================================
   1) INGREDIENT INSIGHTS
   Displays ingredient descriptions with linked Woo products.
   --------------------------------------------------------- */

/* === Deprecated 2025-12-11 === */
.saba-insights {
  display: grid;
  gap: 1.5rem;
}

.saba-insight {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1rem 0;
}

.saba-insight-text {
  flex: 1 1 65%;
}

.saba-insight-product {
  flex: 0 0 35%;
}

.saba-insight-product img {
  width: 100%;
  height: auto;
}

/* Buttons in product area */
.saba-insight-product :is(a.button, button.button, input.button) {
  display: inline-block;
  width: 100%;
  margin-top: 0.5rem;
  text-align: center;
  border-radius: 6px;
}

/* Hover magnifying glass overlay */
.saba-insight-product .saba-prod-link {
  position: relative;
  display: block;
}

.saba-insight-product .saba-prod-link img {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.saba-insight-product .saba-prod-link:hover img {
  opacity: 0.85;
  transform: scale(1.01);
}

.saba-insight-product .saba-prod-link::after {
  content: "\1F50D";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 42px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.saba-insight-product .saba-prod-link:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
/* === End Deprecated === */

/* =========================================================
   1) INGREDIENT INSIGHTS (clean version)
   Displays ingredient descriptions with inline WYSIWYG images.
   --------------------------------------------------------- */
.saba-insights {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.saba-insight {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.saba-insight-text h3 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
  color: var(--saba-graphite);
}

.saba-insight-text img {
  margin-top: 0.5rem;
  border-radius: 6px;
  max-width: 100%;
  height: auto;
}

/* =========================================================
   2) ACF GALLERY SLIDER
   Simple responsive image slider with optional captions.
   --------------------------------------------------------- */
.saba-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.saba-slider-track {
  display: flex;
  transition: transform 0.5s ease;
}

.saba-slide {
  flex: 0 0 100%;
  position: relative;
}

.saba-slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.saba-slide:hover figcaption {
  opacity: 1;
}

/* ACF Slider: hide nav and progress elements from [saba_acf_gallery] */
.saba-slider .saba-nav,
.saba-slider .saba-dots {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Prevent any extra spacing below slider */
.saba-slider {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}


/* =========================================================
   3) STEPS OVERVIEW
   Displays cooking steps (with optional image).
   --------------------------------------------------------- */

/* === Deprecated 2025-12-11 === 
.saba-steps {
  display: grid;
  gap: 0;
}

.saba-step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 0.5rem 0;
}

.saba-step-text {
  flex: 1 1 65%;
}

.saba-step-media {
  flex: 0 0 35%;
}

.saba-step h3,
.saba-step h4 {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
  line-height: 1.3;
}

.saba-step h3::first-letter,
.saba-step h4::first-letter {
  font-weight: 700;
  color: var(--saba-gold);
}
/* === End Deprecated === */

/* =========================================================
   3) STEPS OVERVIEW (clean version)
   Displays numbered steps with optional inline images.
   --------------------------------------------------------- */
.saba-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  counter-reset: step;
}

.saba-step {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  counter-increment: step;
}

.saba-step-text h3 {
  position: relative;
  font-size: 1.3rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  color: var(--saba-graphite);
}

.saba-step-text h3::before {
  content: counter(step) ". ";
  color: var(--saba-gold);
  font-weight: 700;
}

.saba-step-text img {
  margin-top: 0.5rem;
  border-radius: 6px;
  max-width: 100%;
  height: auto;
}

/* =========================================================
   4) STICKY STACK
   Keeps product box or title sticky beside content.
   --------------------------------------------------------- 
@media (min-width: 981px) {
  .sticky-stack {
    position: sticky;
    top: var(--header-sticky-height);
    z-index: 10;
  }
}

.sticky-product-box {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.sticky-product-box img {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.sticky-product-box .saba-prod-link:hover img {
  opacity: 0.85;
  transform: scale(1.01);
}

/* =========================================================
   5) DIVI BUILDER PREVIEW FIXES
   Adjusts layout inside the Visual Builder.
   --------------------------------------------------------- */
.et-fb .saba-insight,
.et-fb .saba-step {
  flex-direction: column;
}

.et-fb .saba-insight-text,
.et-fb .saba-step-text {
  flex: 1 1 100%;
}
/* ============================================================
   6) WOO BUTTONS – STRUCTURAL BASELINE (CLEAN RESET)
   ------------------------------------------------------------
   Version: 2.4-clean
   Date: 2025-12-07
   Author: Tore
   Purpose:
     Removes all color overrides now handled in Divi Global
     Defaults. Keeps only alignment, spacing, and form styling
     relevant to WooCommerce product pages.
   ------------------------------------------------------------
   Version History
   ------------------------------------------------------------
   1.0 - Original gold baseline for WooCommerce
   2.0 - Reset for Divi baseline
   2.1 - Solid gold + darker hover
   2.2 - Gradient experiments (removed)
   2.3 - Global gradient override (removed)
   2.4 - Clean structural baseline before Global Header setup
   ============================================================ */


/* ------------------------------------------------------------
   BUTTON VISUALS – REMOVED
   ------------------------------------------------------------
   All color, gradient, and hover styling is now defined
   through Divi Theme Builder (Global Defaults).
   ------------------------------------------------------------ */


/* ------------------------------------------------------------
   PRODUCT FORM ALIGNMENT
   ------------------------------------------------------------ */

/* -- Flex layout: aligns quantity + add-to-cart nicely -- 
body.single-product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* -- Quantity input field -- 
body.single-product form.cart .quantity input.qty {
  padding: 0.45em 0.7em;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  font-size: 1em;
  line-height: 1.2;
}

/* -- Variation dropdown reset to Divi baseline -- 
body.single-product form.cart select {
  appearance: auto;
  background-color: #fff;
  padding: 0.45em 1.75em 0.45em 0.7em;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  line-height: 1.3;
}

/* -- Hover cue for dropdowns -- 
body.single-product form.cart select:hover {
  border-color: #be9b4a;
}


/* ------------------------------------------------------------
   END SECTION 6
   ------------------------------------------------------------ */

/* =========================================================
   8) THEME BUILDER ADD-TO-CART FIX
   Ensures Add to Cart modules display properly.
   --------------------------------------------------------- */
.et-l .et_pb_module.et_pb_wc_add_to_cart form.cart {
  display: block !important;
}

/* =========================================================
   9) CART TOTALS STYLING
   Adds padding and contrast for tax rows.
   --------------------------------------------------------- */
.woocommerce .cart_totals .custom-tax-row th,
.woocommerce .cart_totals .custom-tax-row td {
  font-weight: 500;
  color: #333;
  border-top: none;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

/* =========================================================
   10) BLOG GRID
   4-column responsive layout, even heights, hover zoom, safe on mobile.
   --------------------------------------------------------- */
#blog-grid-1.et_pb_blog_grid .et_pb_salvattore_content[data-columns]::before,
#blog-grid-1 .et_pb_salvattore_content[data-columns]::before {
  content: '4 .column.size-1of4';
}

#blog-grid-1 .et_pb_salvattore_content .column.size-1of4 {
  width: 25% !important;
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 980px) {
  #blog-grid-1 .et_pb_salvattore_content[data-columns]::before {
    content: '2 .column.size-1of2';
  }
  #blog-grid-1 .et_pb_salvattore_content .column.size-1of2 {
    width: 50% !important;
  }
}

/* Phone: 1 column */
@media (max-width: 767px) {
  #blog-grid-1 .et_pb_salvattore_content[data-columns]::before {
    content: '1 .column.size-1of1';
  }
  #blog-grid-1 .et_pb_salvattore_content .column.size-1of1 {
    width: 100% !important;
  }
}

/* Card styling */
#blog-grid-1 .et_pb_post {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
  margin: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* Uniform height across row */
#blog-grid-1 .et_pb_salvattore_content[data-columns] {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

#blog-grid-1 .et_pb_post .post-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#blog-grid-1 .et_pb_post .post-meta {
  margin-top: auto;
}

/* Hover lift */
#blog-grid-1 .et_pb_post:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: #ddd;
}

/* Featured image zoom */
#blog-grid-1 .et_pb_post .et_pb_image_container img {
  transition: transform 0.5s ease;
}

#blog-grid-1 .et_pb_post:hover .et_pb_image_container img {
  transform: scale(1.08);
}

/* Image corners match card corners */
#blog-grid-1 .et_pb_post .et_pb_image_container,
#blog-grid-1 .et_pb_post .et_pb_image_container img {
  border-radius: 8px 8px 0 0 !important;
  overflow: hidden;
  display: block;
}

/* Compact spacing */
#blog-grid-1 .et_pb_post .et_pb_image_container {
  margin-bottom: 0.6rem !important;
}

#blog-grid-1 .et_pb_post .entry-title {
  margin-top: 0 !important;
  margin-bottom: 0.4rem !important;
  line-height: 1.3;
}

#blog-grid-1 .et_pb_post .post-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#blog-grid-1 .et_pb_post p,
#blog-grid-1 .et_pb_post .post-meta {
  margin-top: 0.25rem !important;
}

/* Mobile: disable flex equal height */
@media (max-width: 767px) {
  #blog-grid-1 .et_pb_salvattore_content[data-columns] {
    display: block !important;
  }
  #blog-grid-1 .et_pb_post {
    display: block !important;
    height: auto !important;
  }
  #blog-grid-1 .et_pb_post .post-content {
    display: block !important;
  }
}

/* =========================================================
   11) WOO BUNDLED PRODUCTS
   Typography and spacing tweaks for bundled kits.
   --------------------------------------------------------- 
body.single-product [class*="bundled_product"] .bundled_product_title {
  font-size: 1.1rem;
  font-weight: 700;
}

body.single-product [class*="bundled_product"] .bundled_product_excerpt {
  font-size: 0.95rem;
  line-height: 1.45;
}

body.single-product [class*="bundled_product"] .price {
  font-size: 0.96rem;
  color: #333;
}
*/
/* =========================================================
   12) DIVI HEADER SEARCH
   Smoothly expanding search field with brand colors.
   --------------------------------------------------------- */
#headerbar {
  transition: background-color 0.5s ease;
}

#headerbar .et_pb_menu__search-container {
  background: transparent !important;
  transition: background-color 0.4s ease;
}

#headerbar .et_pb_menu__search-container:not(.et_pb_menu__search-container--hidden) {
  background-color: var(--saba-ivory) !important;
}

#headerbar .et_pb_menu__search-input {
  background: #fff;
  color: #333;
  border: none;
  border-radius: 4px;
  padding: 8px 14px;
  width: 260px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: scaleX(0.85);
  transform-origin: left;
}

#headerbar .et_pb_menu__search-container:not(.et_pb_menu__search-container--hidden) .et_pb_menu__search-input {
  opacity: 1;
  transform: scaleX(1);
  transition: all 0.4s ease;
}

.site-main-menu .et_pb_menu__search-button {
  color: var(--saba-ivory);
  transition: color 0.3s;
}

.site-main-menu .et_pb_menu__close-search-button {
  color: var(--saba-bluegray);
}

.site-main-menu .et_pb_menu__close-search-button:hover {
  color: #40535c;
}
/* Cart block – continue shopping button */
.wc-block-cart a.sb-continue-shopping{
  display: block;
  width: 100%;
  box-sizing: border-box;

  margin-top: 16px;      /* increase gap - adjust 12–24px */
  padding: 14px 16px;    /* match your primary button's height feel */
  text-align: center;
}

/* Mobile fix: force full width + spacing for the injected button */
@media (max-width: 980px){

  .wc-block-cart .wc-block-cart__submit-container{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100%;
  }

  .wc-block-cart a.wc-block-cart__submit-button,
  .wc-block-cart a.sb-continue-shopping{
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }
}
/* === Cart buttons: same gold, different visual weight === */

/* ================================
   Cart (Woo Blocks) – both gold,
   primary vs secondary hierarchy
   ================================ */

.wc-block-cart a.wc-block-cart__submit-button,
.wc-block-cart button.wc-block-cart__submit-button,
.wc-block-cart a.sb-continue-shopping{
  background: #c9a646 !important;   /* fixed gold */
  border-color: #c9a646 !important;
  color: #ffffff !important;
}

/* PRIMARY: Fortsett til kassen (bigger/stronger) */
.wc-block-cart a.wc-block-cart__submit-button,
.wc-block-cart button.wc-block-cart__submit-button{
  font-size: 1.05rem !important;
  font-weight: 650 !important;
}

/* Make sure inner text also follows (Blocks often styles this) */
.wc-block-cart a.wc-block-cart__submit-button .wc-block-components-button__text,
.wc-block-cart button.wc-block-cart__submit-button .wc-block-components-button__text{
  font-size: 1.05rem !important;
  font-weight: 650 !important;
}

/* Same height for both buttons */
.wc-block-cart a.wc-block-cart__submit-button,
.wc-block-cart button.wc-block-cart__submit-button,
.wc-block-cart a.sb-continue-shopping{
  padding: 14px 16px !important;
  min-height: 52px !important;      /* tweak if needed */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1.2 !important;
}

/* Primary */
.wc-block-cart a.wc-block-cart__submit-button,
.wc-block-cart button.wc-block-cart__submit-button{
  font-size: 1.05rem !important;
  font-weight: 650 !important;
}

/* Secondary */
.wc-block-cart a.sb-continue-shopping{
  font-size: 0.95rem !important;
  font-weight: 500 !important;
}
