/*
Theme Name: Komestic Child 4
Theme URI: https://komestic.casethemes.net/
Description: Child theme for Komestic — updates outdated WooCommerce template overrides for compatibility with WooCommerce 10.5+ and fixes Stripe payment gateway integration.
Author: Fehfeh Beauty
Author URI: https://fehfehbeauty.com
Template: komestic
Version: 1.0.0
Requires PHP: 7.4
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: komestic-child
*/

/* ==========================================================================
   Child theme styles go below this line.
   The parent theme's styles are enqueued via functions.php.
   ========================================================================== */

/* ==========================================================================
   CHECKOUT: PAYMENT ERROR / NOTICE DISPLAY
   --------------------------------------------------------------------------
   The parent theme deliberately hides two notice containers:
     • main.scss:     .woocommerce-notices-wrapper { display:none }
     • checkout.scss: form.checkout .woocommerce-NoticeGroup { display:none }

   This means payment errors from Stripe (and any other gateway) are silently
   swallowed — the customer sees no feedback after a declined card etc.

   Fix:
   1. Un-hide both containers on checkout pages only.
   2. Style error / info / success notices to match the site design.
   3. Make the notice group a full-width flex row so it spans both columns
      (WooCommerce prepends it inside the flex form.checkout at runtime).
   ========================================================================== */

/* 1 – Un-hide the static notices wrapper (renders before the form) */
.woocommerce-checkout .woocommerce-notices-wrapper {
  display: block;
}

/* ==========================================================================
   MOBILE SIDEBAR: LOGO WIDTH
   --------------------------------------------------------------------------
   The parent theme sets .site-logo img { width: auto; height: 36px } globally.
   In the mobile sidebar the content area is ~260px (320px sidebar minus 30px
   padding each side), so a logo image narrower than 36px tall renders tiny.

   Fix: make the sidebar logo image span the full available width with
   automatic height to preserve aspect ratio.
   ========================================================================== */

.mobile-sidebar .sidebar-inner .site-logo img {
  width: 100%;
  height: auto;
}

/* 2 – Un-hide the AJAX notice group WooCommerce/Stripe prepends to form.checkout */
.woocommerce-checkout form.checkout .woocommerce-NoticeGroup {
  display: block;
  /* Span both flex columns — WooCommerce prepends this as the first flex child */
  flex: 0 0 100%;
  width: 100%;
  order: -1; /* ensure it always renders above the form columns */
}

/* 3a – Error notices (declined card, Stripe API errors, validation failures) */
.woocommerce-checkout .woocommerce-error,
.woocommerce-checkout
  form.checkout
  .woocommerce-NoticeGroup
  .woocommerce-error {
  background-color: #fff5f5;
  border: 1px solid #fca5a5;
  border-left: 4px solid #dc2626;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 0 0 20px 0;
  list-style: none;
  color: #dc2626;
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.6;
}

.woocommerce-checkout .woocommerce-error li,
.woocommerce-checkout
  form.checkout
  .woocommerce-NoticeGroup
  .woocommerce-error
  li {
  margin: 0;
  padding: 0;
}

.woocommerce-checkout .woocommerce-error li + li {
  margin-top: 5px;
}

/* Hide the icon pseudo-elements WooCommerce normally injects */
.woocommerce-checkout .woocommerce-error::before,
.woocommerce-checkout .woocommerce-error li::before {
  display: none;
}

/* 3b – Info notices (e.g. login prompts, coupon info) */
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout form.checkout .woocommerce-NoticeGroup .woocommerce-info {
  background-color: #eff6ff;
  border: 1px solid #93c5fd;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 0 0 20px 0;
  list-style: none;
  color: #1e40af;
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.6;
}

.woocommerce-checkout .woocommerce-info::before {
  display: none;
}

/* 3c – Success notices */
.woocommerce-checkout .woocommerce-message,
.woocommerce-checkout
  form.checkout
  .woocommerce-NoticeGroup
  .woocommerce-message {
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  border-left: 4px solid #16a34a;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 0 0 20px 0;
  list-style: none;
  color: #15803d;
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.6;
}

.woocommerce-checkout .woocommerce-message::before {
  display: none;
}
