/**
 * Shopify Buy Button SDK Styles v1.0.0
 */

/* Button Styles */
.shopify-buy-button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.shopify-buy-button:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.shopify-buy-button:active {
  transform: translateY(0) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Variant Selector */
.shopify-variant-select {
  width: 100%;
  padding: 12px 40px 12px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background-color: #fafafa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 400;
  color: #555;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 44px;
  transition: all 0.2s;
}

.shopify-variant-select:hover {
  border-color: #ccc;
  background-color: #f5f5f5;
}

.shopify-variant-select:focus {
  outline: none;
  border-color: #999;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* Overlay */
.shopify-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.shopify-cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Drawer */
.shopify-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 90vw;
  background-color: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.shopify-cart-drawer.open {
  transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.drawer-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #000;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  opacity: 0.7;
}

.drawer-close:hover {
  opacity: 1;
}

/* Drawer Content */
.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-height: 0;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  opacity: 0.6;
}

/* Cart Items */
.cart-item {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.cart-item:last-child {
  margin-bottom: 0;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background-color: #f5f5f5;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-details h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #000;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-variant {
  font-size: 12px;
  color: #666;
  opacity: 0.6;
  margin: 4px 0;
  line-height: 1.25;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: white;
  color: #000;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}

.qty-btn:hover {
  opacity: 0.8;
}

.qty-display {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #000;
}

.cart-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.remove-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  opacity: 0.6;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.remove-btn:hover {
  opacity: 1;
}

.cart-item-price .price {
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

/* Drawer Footer */
.drawer-footer {
  padding: 20px;
  border-top: 1px solid #e5e5e5;
  flex-shrink: 0;
  background-color: white;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cart-subtotal span:first-child {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #666;
  opacity: 0.7;
}

.cart-subtotal span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: #000;
}

.cart-notice {
  font-size: 12px;
  color: #666;
  opacity: 0.7;
  margin: 0 0 16px 0;
  text-align: center;
}

.checkout-button {
  width: 100%;
  padding: 14px;
  background-color: #5cb85c;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.checkout-button:active {
  transform: translateY(0);
}

.checkout-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Trust Badges */
.trust-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid #e5e5e5;
}

.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  cursor: default;
  transition: all 0.2s;
}

.trust-badge:hover {
  transform: scale(1.05);
}

.trust-badge-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(51, 51, 51, 0.20) 0%, rgba(51, 51, 51, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.trust-badge:hover .trust-badge-icon {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

.trust-badge-icon svg {
  width: 20px;
  height: 20px;
  color: rgb(51, 51, 51);
  opacity: 1;
}

.trust-badge-text {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  color: #000;
  opacity: 0.8;
  max-width: 80px;
  transition: all 0.2s;
}

.trust-badge:hover .trust-badge-text {
  opacity: 1;
}

/* Floating Cart Button */
.shopify-floating-cart {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #5cb85c;
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9997;
  transition: all 0.3s ease;
}

.shopify-floating-cart:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.shopify-floating-cart:active {
  transform: scale(0.95);
}

.shopify-floating-cart svg {
  position: relative;
  z-index: 1;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #ef4444;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid white;
  animation: badge-pop 0.3s ease;
}

/* Upsell Products */
.cart-upsell {
  padding: 12px 0;
  margin: 8px 0;
  border-top: 1px solid #e5e5e5;
}

.cart-upsell h4 {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  opacity: 0.6;
}

.upsell-product {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: transparent;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.upsell-product:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.upsell-product:last-child {
  margin-bottom: 0;
}

.upsell-product img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background-color: #f5f5f5;
}

.upsell-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.upsell-info {
  flex: 1;
  min-width: 0;
}

.upsell-info h5 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.25;
}

.upsell-info p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

.upsell-variant-select {
  width: auto;
  max-width: 100px;
  height: 24px;
  font-size: 11px;
  padding: 2px 20px 2px 6px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 8px;
  appearance: none;
  cursor: pointer;
  color: #000;
  flex-shrink: 0;
}

.upsell-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.upsell-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.upsell-btn:active {
  transform: scale(0.95);
}

/* Animations */
@keyframes badge-pop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .shopify-cart-drawer {
    width: 85vw;
    max-width: 400px;
    border-radius: 8px 0 0 8px;
  }

  .shopify-variant-select {
    padding: 14px 40px 14px 14px;
    font-size: 15px;
    min-height: 48px;
    border: 1px solid #e0e0e0;
  }

  .shopify-variant-select:focus {
    border-color: #999;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
  }

  .cart-item-image {
    width: 60px;
    height: 60px;
  }

  .cart-item-details h4 {
    font-size: 13px;
  }

  .drawer-header h3 {
    font-size: 16px;
  }

  .trust-badges {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 0;
  }

  .trust-badge-icon {
    width: 40px;
    height: 40px;
  }

  .trust-badge-text {
    font-size: 9px;
  }

  .shopify-floating-cart {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }

  .cart-badge {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .shopify-cart-drawer {
    width: 90vw;
  }
}
