/* Bundle Layout */
.single-product div.product.product-type-bundle {
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 2em auto;
  padding: 0 2em;
}

/* Timer Section - Full width above main content */
.qbnd-bundle-timer {
  width: 100%;
  margin-bottom: 2em;
  background: #fff;
  border: 2px solid #fbd38d;
  border-radius: 12px;
  padding: 1.2em;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Main Product Content Container */
.qbnd-main-product-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Product Gallery */
.single-product div.product.product-type-bundle .woocommerce-product-gallery {
  width: 100% !important;
  float: none !important;
  margin-bottom: 1em;
}

.single-product div.product.product-type-bundle .woocommerce-product-gallery img {
  height: 420px;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Product Summary */
.single-product div.product.product-type-bundle .summary {
  width: 100% !important;
  float: none !important;
  margin-bottom: 2em;
}

/* Bundle Timer */
.qbnd-timer-message {
  font-weight: 600;
  font-size: 1.1em;
  margin-bottom: 0.8em;
  color: #2d3748;
}

.qbnd-timer-countdown {
  display: flex;
  justify-content: center;
  gap: 1em;
  font-size: 1.2em;
  font-weight: 700;
}

/* Bundle Price Display - Compact Design */
.qbnd-bundle-price {
  background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 50px;
  padding: 0.8em 1.5em;
  margin: 0.5em 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Original Price */
.qbnd-bundle-price del {
  color: #94a3b8;
  font-size: 1em;
  font-weight: 500;
  position: relative;
}

.qbnd-bundle-price del::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: #f87171;
  left: 0;
  top: 50%;
}

/* Final Price */
.qbnd-bundle-price ins {
  text-decoration: none;
  font-weight: 700;
  font-size: 1.4em;
  color: #0f172a;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Savings Badge */
.qbnd-savings {
  background: #22c55e;
  color: white;
  padding: 0.4em 1em;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  white-space: nowrap;
}

/* Free Products Indicator */
.qbnd-free-products {
  display: inline-block;
  background: #48BB78;
  color: white;
  padding: 0.2em 0.6em;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  margin-left: 0.5em;
  vertical-align: middle;
}

.qbnd-bundle-price .qbnd-free-products {
  background: linear-gradient(135deg, #48BB78 0%, #38A169 100%);
  box-shadow: 0 2px 4px rgba(72, 187, 120, 0.2);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .qbnd-bundle-price {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.6em 1em;
    gap: 0.8em;
  }

  .qbnd-bundle-price del,
  .qbnd-bundle-price ins,
  .qbnd-savings {
    font-size: 0.9em;
  }
}

/* Bundled Products List */
.qbnd-bundled-products {
  background: #fff;
  border-radius: 12px;
  padding: 0.8em;
  margin-bottom: 1.5em;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  height: 420px;
  display: flex;
  flex-direction: column;
}

.qbnd-bundled-products-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5em;
  padding-bottom: 0.3em;
  border-bottom: 2px solid #e2e8f0;
  flex-shrink: 0;
}

.qbnd-bundled-products-list {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  overflow-y: auto;
  padding-right: 0.5em;
  flex: 1;
}

/* Custom Scrollbar */
.qbnd-bundled-products-list::-webkit-scrollbar {
  width: 6px;
}

.qbnd-bundled-products-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.qbnd-bundled-products-list::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.qbnd-bundled-products-list::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.qbnd-bundled-product {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.5em;
  background: #f8fafc;
  border-radius: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  height: 85px;
}

.qbnd-bundled-product:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.qbnd-bundled-product-image {
  width: 65px;
  height: 65px;
  flex-shrink: 0;
}

.qbnd-bundled-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.qbnd-bundled-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.qbnd-bundled-product-title {
  font-size: 0.95em;
  font-weight: 600;
  margin-bottom: 0.2em;
  line-height: 1.2;
}

.qbnd-bundled-product-title a {
  color: #2d3748;
  text-decoration: none;
}

.qbnd-bundled-product-quantity {
  display: inline-block;
  padding: 0.15em 0.5em;
  background: #e2e8f0;
  border-radius: 4px;
  font-size: 0.85em;
  margin-left: 0.4em;
}

.qbnd-bundled-product-price {
  color: #2d3748;
  font-weight: 600;
  font-size: 0.95em;
}

/* Add to Cart Button */
.qbnd-bundle-add-to-cart {
  margin-top: 2em;
  text-align: center;
}

.qbnd-add-bundle-to-cart {
  background: linear-gradient(to right, #4299e1, #667eea) !important;
  color: white !important;
  padding: 1em 2em !important;
  font-size: 1.1em !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 6px rgba(66, 153, 225, 0.2) !important;
}

.qbnd-add-bundle-to-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(66, 153, 225, 0.3) !important;
}

/* Responsive Design */
@media (min-width: 768px) {
  .single-product div.product.product-type-bundle {
    display: flex;
    flex-direction: column;
  }

  .single-product div.product.product-type-bundle .product-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    align-items: start;
  }

  .single-product div.product.product-type-bundle .woocommerce-product-gallery {
    width: 100% !important;
    float: none !important;
    margin-bottom: 2em;
  }

  .single-product div.product.product-type-bundle .summary {
    width: 100% !important;
    float: none !important;
    margin-bottom: 2em;
  }

  .qbnd-bundled-products {
    position: relative;
    /* Remove sticky */
  }
}

@media (min-width: 1024px) {
  .qbnd-bundled-products-list {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Loading States */
.qbnd-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Success Animation */
@keyframes successPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.qbnd-add-success {
  animation: successPulse 0.3s ease;
}

/* Notifications */
#qbnd-notifications {
  position: fixed;
  top: 32px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qbnd-notification {
  padding: 12px 20px;
  border-radius: 6px;
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

.qbnd-notification.success {
  border-left: 4px solid #48BB78;
}

.qbnd-notification.error {
  border-left: 4px solid #F56565;
}

.qbnd-notification .message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.qbnd-notification .close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.qbnd-notification .close:hover {
  opacity: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Add to Cart Button States */
.qbnd-add-bundle-to-cart {
  position: relative;
  transition: all 0.3s ease;
}

.qbnd-add-bundle-to-cart.loading {
  opacity: 0.7;
  cursor: wait;
}

.qbnd-add-bundle-to-cart.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Improve form layout */
.qbnd-bundle-form {
  display: flex;
  justify-content: center;
  margin-top: 2em;
}

.qbnd-bundle-form .qbnd-add-bundle-to-cart {
  min-width: 200px;
  text-align: center;
}

/* For non-admin users */
body:not(.admin-bar) #qbnd-notifications {
  top: 20px;
}

/* Cart Bundle Display */
.qbnd-bundle-contents {
  font-size: 0.9em;
  color: #4A5568;
  margin: 0.5em 0;
  padding-left: 1em;
  border-left: 2px solid #E2E8F0;
}

.qbnd-bundle-contents>* {
  margin: 0.25em 0;
}

.woocommerce-cart-form .qbnd-bundle-contents {
  max-width: 300px;
}

/* Bundle item in cart */
.woocommerce-cart-form__cart-item:has(.qbnd-bundle-contents) {
  background: #F7FAFC;
  border-radius: 8px;
  margin-bottom: 1em;
  padding: 1em;
  transition: background-color 0.2s;
}

.woocommerce-cart-form__cart-item:has(.qbnd-bundle-contents):hover {
  background: #EDF2F7;
}

.woocommerce-cart-form__cart-item:has(.qbnd-bundle-contents) .product-name strong {
  color: #2D3748;
  font-size: 1.1em;
}

/* Free price display in bundled products */
.qbnd-free-price {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.qbnd-free-price del {
  color: #94a3b8;
  font-size: 0.9em;
  text-decoration: line-through;
  opacity: 0.7;
}

.qbnd-free-price ins {
  text-decoration: none;
  color: #48BB78;
  font-weight: 600;
  font-size: 1.1em;
  background: linear-gradient(135deg, #48BB78 0%, #38A169 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}