/*
Theme Name: Buildpieces
Theme URI: https://buildpieces.com
Author: emadth
Author URI: https://buildpieces.com
Description: A professional WooCommerce WordPress theme using Tailwind CSS.
Version: 2.6.7
Text Domain: buildpieces
Domain Path: /languages
Tags: e-commerce, custom-background, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

/* ==========================================================================
   In-Card Cart Quantity Limit Alert Styles & Transitions
   ========================================================================== */
.cart-alert-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s ease,
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 0;
  overflow: hidden;
}

.cart-alert-wrapper.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0) scale(1);
  margin-bottom: 1.25rem;
}

.cart-alert-wrapper > .cart-alert-inner {
  min-height: 0;
  overflow: hidden;
  padding-bottom: 2px;
}

.bp-cart-alert-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.875rem !important;
  padding: 0.875rem 1.125rem !important;
  border-radius: 0.875rem !important;
  background-color: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  box-shadow: 0 1px 3px 0 rgba(239, 68, 68, 0.1) !important;
}

.bp-cart-alert-icon-box {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2rem !important;
  height: 2rem !important;
  border-radius: 0.625rem !important;
  background-color: #e51d2e !important;
  color: #ffffff !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(229, 29, 46, 0.25) !important;
}

.bp-cart-alert-icon-box svg {
  width: 1rem !important;
  height: 1rem !important;
}

.bp-cart-alert-msg {
  margin: 0 !important;
  font-size: 0.8125rem !important;
  font-weight: 800 !important;
  color: #991b1b !important;
  line-height: 1.4 !important;
  letter-spacing: -0.01em !important;
}

.bp-cart-alert-close {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1.75rem !important;
  height: 1.75rem !important;
  border-radius: 0.5rem !important;
  background: transparent !important;
  border: none !important;
  color: #ef4444 !important;
  font-size: 1.35rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
}

.bp-cart-alert-close:hover {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
}

@keyframes bpItemLimitPulse {
  0% { background-color: rgba(254, 242, 242, 0); }
  25% { background-color: rgba(254, 242, 242, 0.95); }
  100% { background-color: rgba(254, 242, 242, 0); }
}

.cart-item-row.bp-item-limit-pulse {
  animation: bpItemLimitPulse 0.9s ease-out !important;
  border-radius: 14px;
}

/* ==========================================================================
   Product Spec Abbreviations for Mobile & Desktop (Pcs / Figures)
   ========================================================================== */
@media (max-width: 639.98px) {
  .spec-label-desktop {
    display: none !important;
  }
  .spec-label-mobile {
    display: inline !important;
  }
}

@media (min-width: 640px) {
  .spec-label-desktop {
    display: inline !important;
  }
  .spec-label-mobile {
    display: none !important;
  }
}

/* ==========================================================================
   Mobile 1-Star Rating Display (Hides Stars 2-5 on Mobile)
   ========================================================================== */
@media (max-width: 639.98px) {
  .bp-star-secondary {
    display: none !important;
  }
}

@media (min-width: 640px) {
  .bp-star-secondary {
    display: inline-flex !important;
  }
}

/* ==========================================================================
   WooCommerce Account Notices: Zero margin when empty, spacing when alert present
   ========================================================================== */
.woocommerce-account .woocommerce-notices-wrapper,
.woocommerce-MyAccount-content > .woocommerce-notices-wrapper {
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide / collapse when completely empty or containing no alert elements */
.woocommerce-account .woocommerce-notices-wrapper:empty,
.woocommerce-MyAccount-content > .woocommerce-notices-wrapper:empty,
.woocommerce-account .woocommerce-notices-wrapper.bp-notices-empty,
.woocommerce-MyAccount-content > .woocommerce-notices-wrapper.bp-notices-empty,
.woocommerce-account .woocommerce-notices-wrapper:not(:has(.woocommerce-message, .woocommerce-error, .woocommerce-info, .woocommerce-info-notices, .woocommerce-notice, [role="alert"])),
.woocommerce-MyAccount-content > .woocommerce-notices-wrapper:not(:has(.woocommerce-message, .woocommerce-error, .woocommerce-info, .woocommerce-info-notices, .woocommerce-notice, [role="alert"])) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  border: none !important;
}

/* When it contains an alert / message / error / info, give it proper bottom margin */
.woocommerce-account .woocommerce-notices-wrapper:has(.woocommerce-message, .woocommerce-error, .woocommerce-info, .woocommerce-info-notices, .woocommerce-notice, [role="alert"]),
.woocommerce-MyAccount-content > .woocommerce-notices-wrapper:has(.woocommerce-message, .woocommerce-error, .woocommerce-info, .woocommerce-info-notices, .woocommerce-notice, [role="alert"]),
.woocommerce-account .woocommerce-notices-wrapper.bp-notices-has-alert,
.woocommerce-MyAccount-content > .woocommerce-notices-wrapper.bp-notices-has-alert {
  display: block !important;
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
}

/* ==========================================================================
   WooCommerce Notices Space-Between Layout
   ========================================================================== */
.woocommerce-notices-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

ul.woocommerce-message,
ul.woocommerce-error,
ul.woocommerce-info {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 0 1rem 0 !important;
  background: transparent !important;
  border: none !important;
  box-sizing: border-box !important;
}

ul.woocommerce-message > li,
div.woocommerce-message,
li.woocommerce-message,
ul.woocommerce-error > li,
div.woocommerce-error,
li.woocommerce-error {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
  box-sizing: border-box !important;
}

.woocommerce-message-content,
.woocommerce-error-content {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.woocommerce-message-actions,
.woocommerce-error-actions {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  margin-left: auto !important;
}

.woocommerce-message .button,
.woocommerce-error .button,
.woocommerce-message-actions .button,
.woocommerce-error-actions .button {
  margin-left: auto !important;
  order: 2 !important;
  flex-shrink: 0 !important;
  float: none !important;
}

@media (max-width: 640px) {
  ul.woocommerce-message > li,
  div.woocommerce-message,
  li.woocommerce-message,
  ul.woocommerce-error > li,
  div.woocommerce-error,
  li.woocommerce-error {
    padding: 0.875rem 1rem 0.875rem 3.125rem !important;
    background-position: 1rem 0.875rem !important;
    background-size: 1.375rem 1.375rem !important;
    gap: 0.625rem !important;
    border-radius: 0.875rem !important;
  }

  .woocommerce-message-content,
  .woocommerce-error-content {
    width: 100% !important;
    font-size: 0.8125rem !important;
    line-height: 1.4 !important;
  }

  .woocommerce-message-actions,
  .woocommerce-error-actions {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    margin-left: 0 !important;
    margin-top: 0.25rem !important;
  }

  .woocommerce-message .button,
  .woocommerce-error .button,
  .woocommerce-message-actions .button,
  .woocommerce-error-actions .button {
    margin-left: auto !important;
    padding: 0.375rem 0.875rem !important;
    font-size: 0.75rem !important;
  }
}

/* ==========================================================================
   eBay-Style Product Image Zoom (+/- Cursor)
   ========================================================================== */
#main-product-stage-container {
  cursor: zoom-in !important;
  overflow: hidden !important;
  position: relative !important;
  touch-action: pan-y !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

#main-product-stage-container.is-zoomed {
  cursor: zoom-out !important;
}

#main-product-stage-image {
  pointer-events: none !important;
  will-change: transform, transform-origin;
  transform-origin: center center;
}
