/* Mini Cart Styles */
.shopping-bag-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
}

/* Remove pointer cursor on cart page */
body.woocommerce-cart .shopping-bag-toggle {
  cursor: default;
}

/* Hide cart icon on checkout page */
body.woocommerce-checkout .shopping-bag-toggle {
  display: none !important;
}

.shopping-bag-toggle .icon {
  position: relative;
  display: inline-block;
}

.shopping-bag-toggle .cart-count {
  position: absolute;
  top: -0.1em;
  right: -9px;
  background: #333;
  color: #fff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shopping-bag-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  z-index: 10000;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s;
}

.shopping-bag-panel.active {
  visibility: visible;
  opacity: 1;
}

.shopping-bag-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
}

.shopping-bag-panel.active .shopping-bag-panel-overlay {
  display: block;
}

.shopping-bag-panel-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 10001;
}

.shopping-bag-panel.active .shopping-bag-panel-content {
  transform: translateX(0);
}

.shopping-bag-panel-header {
  padding: 20px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.shopping-bag-panel-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.shopping-bag-close {
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.shopping-bag-close:hover {
  color: #da373d;
}

.shopping-bag-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.shopping-bag-panel-body .products-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  min-height: 100px;
}

/* Mini Cart Loader */
.shopping-bag-panel-body .mini-cart-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 10;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.shopping-bag-panel-body .mini-cart-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.shopping-bag-panel-body .mini-cart-loader .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #F6F2EF;
  border-top-color: #E28C69;
  border-radius: 50%;
  animation: mini-cart-spin 0.8s linear infinite;
  margin-bottom: 15px;
}

.shopping-bag-panel-body .mini-cart-loader .loader-text {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  font-family: "Inter Tight", sans-serif;
}

@keyframes mini-cart-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Mini Cart Skeleton Loader */
.shopping-bag-panel-body .mini-cart-skeleton {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 0;
  margin: 0;
}

.shopping-bag-panel-body .skeleton-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  position: relative;
  background: #fff;
}

.shopping-bag-panel-body .skeleton-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #F6F2EF 25%, #F9F7F5 50%, #F6F2EF 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.shopping-bag-panel-body .skeleton-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shopping-bag-panel-body .skeleton-title {
  height: 16px;
  background: linear-gradient(90deg, #F6F2EF 25%, #F9F7F5 50%, #F6F2EF 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  width: 80%;
}

.shopping-bag-panel-body .skeleton-title.short {
  width: 60%;
}

.shopping-bag-panel-body .skeleton-price {
  height: 14px;
  background: linear-gradient(90deg, #F6F2EF 25%, #F9F7F5 50%, #F6F2EF 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  width: 40%;
}

.shopping-bag-panel-body .skeleton-quantity {
  height: 12px;
  background: linear-gradient(90deg, #F6F2EF 25%, #F9F7F5 50%, #F6F2EF 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  width: 30%;
  margin-top: 4px;
}

.shopping-bag-panel-body .skeleton-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(90deg, #F6F2EF 25%, #F9F7F5 50%, #F6F2EF 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Mobile skeleton adjustments */
@media (max-width: 767px) {
  .shopping-bag-panel-body .skeleton-item {
    padding: 12px;
  }
  
  .shopping-bag-panel-body .skeleton-image {
    width: 60px;
    height: 60px;
  }
}

.shopping-bag-panel-body .products-list article.product {
  display: flex;
  gap: 15px;
  padding: 15px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  position: relative;
}

.shopping-bag-panel-body .products-list article.product .product-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.shopping-bag-panel-body .products-list article.product .product-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.shopping-bag-panel-body .products-list article.product .product-body {
  flex: 1;
  min-width: 0;
}

.shopping-bag-panel-body .products-list article.product .product-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  width: 95%;
}

.shopping-bag-panel-body .products-list article.product .product-title a {
  color: #333;
  text-decoration: none;
}

.shopping-bag-panel-body .products-list article.product .product-price {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.shopping-bag-panel-body .products-list article.product .custom-quantity-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.shopping-bag-panel-body .products-list article.product .custom-quantity-input-wrapper .pre {
  margin: 0;
  font-size: 12px;
  color: #666;
}

.shopping-bag-panel-body .products-list article.product .custom-quantity-input-wrapper .quantity-inner {
  font-size: 14px;
  font-weight: 500;
}

.shopping-bag-panel-body .products-list article.product .product-remote-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.shopping-bag-panel-body .products-list article.product .product-remote-button:hover {
  opacity: 1;
}

.shopping-bag-panel-body .products-list article.product .product-remote-button img {
  width: 16px;
  height: 16px;
}

/* Bundle child items styling */
.shopping-bag-panel-body .products-list article.product.cb-child-item {
  background: #fafafa;
  border-left: 3px solid #ccc;
  margin-left: 20px;
}

.shopping-bag-panel-body .products-list article.product.cb-child-item .product-remote-button {
  display: none;
}

.shopping-bag-panel-footer {
  padding: 20px;
  border-top: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.shopping-bag-panel-footer .subtotal-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.shopping-bag-panel-footer .subtotal-label {
  font-size: 16px;
  font-weight: 600;
}

.shopping-bag-panel-footer .subtotal-inner {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.shopping-bag-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shopping-bag-actions .btn-view-cart,
.shopping-bag-actions .btn-checkout {
  display: block;
  padding: 12px 20px;
  text-align: center;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.3s;
}

.shopping-bag-actions .btn-view-cart {
  background: transparent;
  border: 1px solid #333;
  color: #333;
}

.shopping-bag-actions .btn-view-cart:hover {
  opacity: 0.8;
}

.shopping-bag-actions .btn-checkout {
  background: linear-gradient(90deg, #E28C69 -12.71%, #EED187 100%);
  color: #333;
  border: none;
}

.shopping-bag-actions .btn-checkout:hover {
  opacity: 0.9;
}

/* Empty cart state */
.shopping-bag-panel-body .products-list:empty::before {
  content: "Your cart is empty";
  display: block;
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 14px;
}

/* Body lock when cart is open */
body.mini-cart-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .shopping-bag-panel {
    max-width: 100%;
  }
  
  .shopping-bag-panel-body .products-list article.product {
    padding: 12px;
  }
  
  .shopping-bag-panel-body .products-list article.product .product-image {
    width: 60px;
    height: 60px;
  }
}