/*
Theme Name: Longevity Healthcare – Woo Fixed
*/

/* ===============================
   HEADER/FOOTER FIXES
   Let WooCommerce handle its own content
================================ */

/* Ensure header stays ABOVE WooCommerce content */
#navbar {
  z-index: 9999 !important;
}

/* Force navbar height */
#navbar > div > div {
  height: 80px !important;
  min-height: 80px !important;
}

/* Force logo size - override WooCommerce image styles */
#navbar img,
#navbar .logo-color-filter,
.woocommerce #navbar img,
.woocommerce-page #navbar img {
  height: 75px !important;
  max-height: 75px !important;
  width: auto !important;
}

/* Nav container full width */
#navbar > div {
  max-width: 1280px !important;
  width: 100% !important;
}

/* Mobile menu needs even higher z-index */
#mobile-menu {
  z-index: 10000 !important;
}

/* ===============================
   PROTECT FOOTER FROM WOOCOMMERCE STYLES
================================ */
footer img,
.site-footer img,
footer .logo-color-filter,
.woocommerce footer img,
.woocommerce-page footer img {
  height: auto !important;
  max-height: none !important;
  width: auto !important;
  max-width: 100% !important;
}

/* Footer logo specific sizing */
footer .h-12,
.woocommerce-page footer .h-12 {
  height: 3rem !important;
}

/* Footer spacing - ensure gap above footer */
footer,
.site-footer {
  margin-top: 60px !important;
}

.woocommerce-cart footer,
.woocommerce-checkout footer {
  margin-top: 0 !important;
}

/* Admin bar offset for sticky nav */
.admin-bar #navbar {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    .admin-bar #navbar {
        top: 46px !important;
    }
}

/* Scroll padding for anchor links */
html {
  scroll-padding-top: 120px;
}

/* ===============================
   WooCommerce Single Product Layout Fix
================================ */

/* Main product container */
.woocommerce div.product {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px;
}

/* Left: product image */
.woocommerce div.product .woocommerce-product-gallery {
  flex: 0 0 45%;
  max-width: 45%;
}

.woocommerce div.product .woocommerce-product-gallery img {
  max-height: 650px;
  max-width: 100%;
  height: auto !important;
  object-fit: contain;
}

/* Right: product summary */
.woocommerce div.product .summary {
  flex: 1;
  max-width: 55%;
  min-width: 300px;
}

/* ===============================
   ADD TO CART BUTTON - Blue Gradient
================================ */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce .cart .button,
.woocommerce .cart input.button,
.single_add_to_cart_button,
.woocommerce a.added_to_cart {
  background: linear-gradient(135deg, #062657 0%, #0a3a8a 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 14px 28px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 6px -1px rgba(6, 38, 87, 0.2) !important;
  text-decoration: none !important;
  display: inline-block !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.single_add_to_cart_button:hover {
  background: linear-gradient(135deg, #0a3a8a 0%, #0d4bc4 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 12px -2px rgba(6, 38, 87, 0.3) !important;
}

/* View Cart link after adding */
.woocommerce a.added_to_cart {
  margin-top: 10px !important;
  font-size: 12px !important;
  padding: 10px 20px !important;
}

/* ===============================
   WOOCOMMERCE NOTICES - Brand Blue/White
================================ */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner,
.wc-block-components-notice-banner.is-success {
  background: linear-gradient(135deg, #062657 0%, #0a3a8a 100%) !important;
  color: #fff !important;
  border: none !important;
  border-left: none !important;
  border-radius: 8px !important;
  padding: 18px 25px !important;
  margin: 20px auto !important;
  max-width: 1200px !important;
  box-shadow: 0 4px 12px rgba(6, 38, 87, 0.2) !important;
}

/* Notice container wrapper */
.woocommerce-notices-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: #fff !important;
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  margin-right: 12px !important;
  float: none !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Add left padding to message for icon space */
.woocommerce-message,
.woocommerce-info {
  padding-left: 25px !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.wc-block-components-notice-banner__content::before {
  color: #fff !important;
}

.woocommerce-message a,
.woocommerce-info a,
.wc-block-components-notice-banner a {
  color: #fff !important;
  background: rgba(255,255,255,0.2) !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

.woocommerce-message a:hover,
.wc-block-components-notice-banner a:hover {
  background: rgba(255,255,255,0.3) !important;
}

/* Error notice - keep it distinguishable but on brand */
.woocommerce-error {
  background: linear-gradient(135deg, #8B5E3C 0%, #a67044 100%) !important;
}

/* ===============================
   CART & CHECKOUT PAGE STYLING
================================ */

/* Main content wrapper - add spacing from header */
.woocommerce-cart #primary,
.woocommerce-checkout #primary,
.woocommerce-cart .site-main,
.woocommerce-checkout .site-main,
.woocommerce-cart .content-area,
.woocommerce-checkout .content-area {
  padding-top: 40px !important;
}

.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px 20px;
}

/* WooCommerce Blocks checkout (new block-based checkout) */
.wc-block-checkout,
.wc-block-cart {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px 20px;
}

/* Ensure main content area has proper spacing */
.woocommerce-cart main,
.woocommerce-checkout main {
  min-height: calc(100vh - 400px);
  padding-bottom: 60px;
}

/* Cart table styling */
.woocommerce table.shop_table {
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  overflow: hidden;
}

.woocommerce table.shop_table th {
  background: #f8fafc !important;
  color: #062657 !important;
  font-weight: 600 !important;
  padding: 15px !important;
}

.woocommerce table.shop_table td {
  padding: 15px !important;
  vertical-align: middle !important;
}

/* Cart totals box */
.woocommerce .cart_totals,
.woocommerce-checkout .woocommerce-checkout-review-order {
  background: #f8fafc;
  padding: 25px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.woocommerce .cart_totals h2,
.woocommerce-checkout h3 {
  color: #062657 !important;
  font-weight: 700 !important;
  margin-bottom: 20px !important;
}

/* Proceed to checkout / Place order button */
.woocommerce .wc-proceed-to-checkout a.checkout-button,
.woocommerce #place_order {
  background: linear-gradient(135deg, #062657 0%, #0a3a8a 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 16px 32px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  width: 100% !important;
  margin-top: 15px !important;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce #place_order:hover {
  background: linear-gradient(135deg, #0a3a8a 0%, #0d4bc4 100%) !important;
}

/* Block Cart - Proceed to Checkout link */
.wc-block-cart__submit-container a.wc-block-cart__submit-button,
.wc-block-components-checkout-return-to-cart-button,
a.wc-block-cart__submit-button {
  background: linear-gradient(135deg, #062657 0%, #0a3a8a 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 16px 32px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  display: inline-block !important;
  text-align: center !important;
  width: 100% !important;
}

/* "Proceed to Checkout" text link below OR */
.wc-block-cart__submit-container .wc-block-components-checkout-place-order-button,
.wc-block-cart .wp-block-woocommerce-proceed-to-checkout-block a {
  color: #062657 !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.wc-block-cart .wp-block-woocommerce-proceed-to-checkout-block a:hover {
  color: #0a3a8a !important;
  text-decoration: underline !important;
}

/* Checkout form styling */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3 {
  color: #062657;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #062657;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  padding: 12px 15px !important;
  font-size: 14px !important;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus {
  border-color: #062657 !important;
  box-shadow: 0 0 0 2px rgba(6, 38, 87, 0.1) !important;
  outline: none !important;
}

/* FORCE TABS & RELATED PRODUCTS TO NEW ROW */
.woocommerce-tabs,
.related.products,
.upsells.products {
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 40px auto 0;
  padding: 0;
  display: block !important;
  clear: both;
}

/* Related products heading */
.related.products > h2,
.upsells.products > h2 {
  width: 100%;
  text-align: left;
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 600;
  color: #062657;
}

/* Related products grid */
.related.products ul.products,
.upsells.products ul.products,
.woocommerce .related ul.products,
.woocommerce .upsells ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

/* Remove WooCommerce clearfix pseudo-elements */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after,
.related.products ul.products::before,
.related.products ul.products::after {
  display: none !important;
  content: none !important;
}

/* Product cards in related */
.woocommerce ul.products li.product,
.related.products ul.products li.product {
  text-align: center;
  padding: 15px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin: 0 !important;
  width: 100% !important;
  float: none !important;
}

.woocommerce ul.products li.product a img {
  width: 100% !important;
  height: auto !important;
  max-height: 200px;
  object-fit: contain;
  margin-bottom: 10px;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 14px !important;
  font-weight: 600;
  color: #062657;
  margin-bottom: 5px;
}

.woocommerce ul.products li.product .price {
  color: #8B5E3C;
  font-weight: 600;
  margin-bottom: 10px;
}

.woocommerce-breadcrumb {display:none;}

/* ===============================
   MOBILE RESPONSIVE
================================ */
@media (max-width: 768px) {
  /* Product layout - stack vertically */
  .woocommerce div.product {
    flex-direction: column;
    padding: 20px 15px;
    gap: 25px;
  }
  
  /* Product image - full width centered */
  .woocommerce div.product .woocommerce-product-gallery {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }
  
  .woocommerce div.product .woocommerce-product-gallery img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 400px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
  
  /* Product summary - full width */
  .woocommerce div.product .summary {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    min-width: unset;
    text-align: center;
  }
  
  /* Center the add to cart form */
  .woocommerce div.product .summary .cart {
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  /* Full width add to cart button on mobile */
  .single_add_to_cart_button {
    width: 100% !important;
    max-width: 300px !important;
  }
  
  /* Tabs & Related - full width */
  .woocommerce-tabs,
  .related.products,
  .upsells.products {
    padding: 0 10px;
    margin-top: 30px;
  }
  
  /* Related products - 2 columns on mobile */
  .related.products ul.products,
  .upsells.products ul.products,
  .woocommerce .related ul.products,
  .woocommerce .upsells ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  
  /* Smaller product cards on mobile */
  .woocommerce ul.products li.product,
  .related.products ul.products li.product {
    padding: 10px;
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
  }
  
  .woocommerce ul.products li.product a img {
    max-height: 120px;
  }
  
  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 11px !important;
    line-height: 1.3;
  }
  
  /* Smaller buttons on mobile */
  .woocommerce ul.products li.product .button {
    padding: 8px 12px !important;
    font-size: 10px !important;
    width: 100% !important;
  }
  
  /* Related heading on mobile */
  .related.products > h2 {
    font-size: 16px;
    margin-bottom: 15px;
  }
}

/* Tablet breakpoint */
@media (max-width: 1024px) and (min-width: 769px) {
  .related.products ul.products,
  .upsells.products ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
