/*
Theme Name: Sweet Angels Mobile App WooCommerce Theme
Theme URI: https://sweetangels.in/
Author: Sweet Angels Heaven4kids (Nilesh Sangtani)
Author URI: https://sweetangels.in/
Description: Fully customizable Mobile-App Style WooCommerce Theme (v3.0) for Sweet Angels (sweetangels.in). Features constrained Square/Wide Logo support, Universal AJAX Add-to-Cart with Slide-Out Mini-Cart Drawer, Sticky App Header, 5-Icon Bottom Navigation Bar, Equal-Height Grid (2 on Mobile / 3 on Desktop), 12-Word Max Product Titles, and Slim Responsive Add to Cart Buttons.
Version: 3.0.0
License: GPL v2 or later
Text Domain: sweet-angels-woo
Requires at least: 6.0
Requires PHP: 7.4
*/

:root {
  --wc-app-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --wc-app-bg: #fdf8fa;
  --wc-app-card: #ffffff;
  --wc-app-text: #0f172a;
  --wc-app-muted: #64748b;
  --wc-app-accent: #ec4899;
  --wc-app-accent-hover: #db2777;
  --wc-app-soft-blue: #f0f9ff;
  --wc-app-border: #f1e4ec;
  --wc-app-badge-bg: #fbbf24;
  --wc-app-badge-text: #0f172a;
  --wc-app-header-h: 60px;
  --wc-app-logo-size: 42px;
  --wc-app-logo-radius: 8px;
  --wc-app-title-size: 13.5px;
  --wc-app-mobile-cols: 2;
  --wc-app-desktop-cols: 3;
  --wc-app-card-radius: 12px;
  --wc-app-btn-bg: #ec4899;
  --wc-app-btn-text: #ffffff;
  --wc-app-btn-h: 34px;
  --wc-app-btn-radius: 7px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 0 76px 0 !important;
  font-family: var(--wc-app-font);
  background-color: var(--wc-app-bg);
  color: var(--wc-app-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wc-app-main-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px 14px 40px;
}

/* ==========================================================================
   1. STICKY MOBILE-APP HEADER & STRICT SQUARE LOGO CONSTRAINTS
   ========================================================================== */
.wc-app-top-header {
  position: sticky;
  top: 0;
  z-index: 999;
  height: var(--wc-app-header-h, 60px);
  max-height: var(--wc-app-header-h, 60px);
  background: var(--wc-app-card);
  border-bottom: 1px solid var(--wc-app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  overflow: hidden;
}

.wc-app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-height: 100%;
}

.wc-app-logo,
.wc-app-top-header .custom-logo-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  color: var(--wc-app-text) !important;
  max-height: calc(var(--wc-app-header-h, 60px) - 10px) !important;
  overflow: hidden !important;
}

/* Bulletproof Square & Rectangular Logo Image Constraints (Never Full-Screen) */
.wc-app-logo-img-box {
  width: var(--wc-app-logo-size, 42px) !important;
  height: var(--wc-app-logo-size, 42px) !important;
  max-width: var(--wc-app-logo-size, 42px) !important;
  max-height: var(--wc-app-logo-size, 42px) !important;
  border-radius: var(--wc-app-logo-radius, 8px) !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.wc-app-top-header img,
.wc-app-top-header img.custom-logo,
.wc-app-top-header .custom-logo-link img,
.wc-app-logo img,
img.wc-app-logo-img {
  height: var(--wc-app-logo-size, 42px) !important;
  max-height: var(--wc-app-logo-size, 42px) !important;
  width: auto !important;
  max-width: 140px !important;
  object-fit: contain !important;
  border-radius: var(--wc-app-logo-radius, 8px) !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wc-app-logo-badge {
  min-width: var(--wc-app-logo-size, 42px);
  height: var(--wc-app-logo-size, 42px);
  padding: 0 6px;
  border-radius: var(--wc-app-logo-radius, 8px);
  background: var(--wc-app-badge-bg);
  color: var(--wc-app-badge-text);
  font-weight: 800;
  font-size: 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  flex-shrink: 0;
}

.wc-app-logo-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wc-app-logo-text {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--wc-app-text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-app-logo-sub {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--wc-app-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-app-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.wc-app-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--wc-app-text);
  background: transparent;
  border: none;
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.wc-app-icon-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.wc-app-icon-btn svg {
  width: 20px;
  height: 20px;
}

.wc-app-cart-count {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9999px;
  background: var(--wc-app-accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ==========================================================================
   2. SEARCH BAR & HORIZONTAL CATEGORY STRIP
   ========================================================================== */
.wc-app-search-bar {
  display: none;
  background: var(--wc-app-card);
  border-bottom: 1px solid var(--wc-app-border);
  padding: 10px 14px;
}

.wc-app-search-bar.is-open {
  display: block;
}

.wc-app-search-bar form {
  display: flex;
  gap: 8px;
  max-width: 680px;
  margin: 0 auto;
}

.wc-app-search-bar input[type="search"] {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--wc-app-border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--wc-app-bg);
  color: var(--wc-app-text);
}

.wc-app-search-bar button {
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--wc-app-btn-bg);
  color: var(--wc-app-btn-text);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.wc-app-category-strip {
  background: var(--wc-app-card);
  border-bottom: 1px solid var(--wc-app-border);
  padding: 8px 14px;
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.wc-app-category-strip::-webkit-scrollbar {
  display: none;
}

.wc-app-category-strip ul {
  display: inline-flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wc-app-category-strip a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--wc-app-text);
  background: var(--wc-app-bg);
  border: 1px solid var(--wc-app-border);
}

.wc-app-category-strip .current-menu-item a,
.wc-app-category-strip a:hover {
  background: var(--wc-app-accent);
  color: #ffffff;
  border-color: var(--wc-app-accent);
}

/* ==========================================================================
   3. EQUAL-HEIGHT PRODUCT GRID (2 ON MOBILE, 3 ON DESKTOP)
   ========================================================================== */
.woocommerce ul.products,
.woocommerce-page ul.products,
.wc-block-grid__products {
  display: grid !important;
  grid-template-columns: repeat(var(--wc-app-mobile-cols, 2), minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  clear: both !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after {
  display: none !important;
}

@media (min-width: 768px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products,
  .wc-block-grid__products {
    grid-template-columns: repeat(var(--wc-app-desktop-cols, 3), minmax(0, 1fr)) !important;
    gap: 20px !important;
  }
}

/* Individual Equal-Height Product Tile */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.wc-block-grid__product {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 10px !important;
  background: var(--wc-app-card);
  border: 1px solid var(--wc-app-border);
  border-radius: var(--wc-app-card-radius, 12px);
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100% !important;
  position: relative !important;
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
.woocommerce-page ul.products li.product a.woocommerce-LoopProduct-link {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  text-decoration: none !important;
  color: inherit !important;
}

/* Uniform 1:1 Square Product Thumbnail */
.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img,
.wc-block-grid__product-image img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  background: var(--wc-app-soft-blue) !important;
  margin: 0 0 10px 0 !important;
  display: block !important;
}

/* 4. Aligned 12-Word Max Product Title Container */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h3,
.wc-block-grid__product-title {
  font-size: var(--wc-app-title-size, 13.5px) !important;
  line-height: 1.35 !important;
  font-weight: 600 !important;
  color: var(--wc-app-text) !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
  min-height: 2.7em !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.woocommerce ul.products li.product .price,
.wc-block-grid__product-price {
  margin-top: auto !important;
  margin-bottom: 8px !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: var(--wc-app-text) !important;
  display: block !important;
}

/* 5. Slim & Responsive Add to Cart Button (Clickable & Unblocked) */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce ul.products li.product a.button,
.wc-block-grid__product-add-to-cart .wp-block-button__link {
  position: relative !important;
  z-index: 5 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  width: 100% !important;
  height: var(--wc-app-btn-h, 34px) !important;
  padding: 0 10px !important;
  border-radius: var(--wc-app-btn-radius, 7px) !important;
  background-color: var(--wc-app-btn-bg) !important;
  color: var(--wc-app-btn-text) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  line-height: var(--wc-app-btn-h, 34px) !important;
  text-align: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  border: none !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  transition: opacity 0.15s ease, transform 0.15s ease !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .add_to_cart_button:hover {
  opacity: 0.92 !important;
}

.woocommerce ul.products li.product .button.loading {
  opacity: 0.7 !important;
}

/* Hide duplicate WooCommerce 'View cart' link inside card so grid stays aligned */
.woocommerce ul.products li.product a.added_to_cart.wc-forward {
  display: none !important;
}

/* ==========================================================================
   6. SINGLE PRODUCT, CART, CHECKOUT & MY ACCOUNT APP STYLING
   ========================================================================== */
.woocommerce div.product {
  background: var(--wc-app-card);
  border: 1px solid var(--wc-app-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
}

.woocommerce div.product form.cart {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.woocommerce div.product form.cart .quantity input.qty {
  width: 64px;
  height: 40px;
  border: 1px solid var(--wc-app-border);
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
  flex: 1;
  min-width: 180px;
  height: 40px !important;
  border-radius: var(--wc-app-btn-radius, 7px) !important;
  background-color: var(--wc-app-btn-bg) !important;
  color: var(--wc-app-btn-text) !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer !important;
}

.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce,
.woocommerce-account .woocommerce {
  background: var(--wc-app-card);
  border: 1px solid var(--wc-app-border);
  border-radius: 16px;
  padding: 16px;
}

.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
  background-color: var(--wc-app-btn-bg) !important;
  color: var(--wc-app-btn-text) !important;
  border-radius: var(--wc-app-btn-radius, 7px) !important;
  border: none !important;
  font-weight: 600 !important;
}

/* ==========================================================================
   7. SLIDE-OUT MINI-CART DRAWER & MOBILE TOAST NOTIFICATION
   ========================================================================== */
.wc-app-slide-drawer,
.wc-app-mini-cart-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1005;
}

.wc-app-slide-drawer.is-open,
.wc-app-mini-cart-drawer.is-open {
  display: flex;
}

.wc-app-slide-drawer-panel {
  width: 280px;
  max-width: 82vw;
  height: 100%;
  background: var(--wc-app-card);
  border-right: 1px solid var(--wc-app-border);
  padding: 18px 16px;
  overflow-y: auto;
}

.wc-app-mini-cart-panel {
  width: 340px;
  max-width: 88vw;
  height: 100%;
  background: var(--wc-app-card);
  border-left: 1px solid var(--wc-app-border);
  padding: 18px 16px;
  overflow-y: auto;
  margin-left: auto;
  display: flex;
  flex-direction: column;
}

.wc-app-slide-drawer-backdrop {
  flex: 1;
  background: rgba(0, 0, 0, 0.45);
}

.wc-app-toast-banner {
  position: fixed;
  bottom: 74px;
  left: 14px;
  right: 14px;
  max-width: 460px;
  margin: 0 auto;
  z-index: 1002;
  background: #059669;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.wc-app-toast-banner.is-visible {
  display: flex;
}

.wc-app-toast-banner a {
  color: #ffffff;
  text-decoration: underline;
  font-weight: 700;
  white-space: nowrap;
}

/* ==========================================================================
   8. FIXED 5-ICON BOTTOM NAVIGATION BAR
   ========================================================================== */
.wc-app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  height: 62px;
  background: var(--wc-app-card);
  border-top: 1px solid var(--wc-app-border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.wc-app-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: var(--wc-app-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
}

.wc-app-bnav-item svg {
  width: 20px;
  height: 20px;
}

.wc-app-bnav-item.active {
  color: var(--wc-app-accent);
  font-weight: 600;
}

.wc-app-bnav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 24px;
  height: 2.5px;
  border-radius: 0 0 4px 4px;
  background: var(--wc-app-accent);
}

.wc-app-bnav-icon-wrap {
  position: relative;
  display: inline-flex;
}
