:root {
  --uxe-cart-width: 540px;
  --uxe-primary-blue: #4285f4;
  --uxe-light-blue-bg: #c9e6ed;
  --uxe-blue-text: #1976d2;
  --uxe-discount-bg: #ffebee;
  --uxe-discount-text: #d32f2f;
  --uxe-text-primary: #212121;
  --uxe-text-secondary: #757575;
  --uxe-text-light: #9e9e9e;
  --uxe-border-color: #e0e0e0;
  --uxe-background: #ffffff;
  --uxe-green-text: #1e8604;
  --uxe-green-pix: #1e8604;
}

/* Wrapper and Overlay */
#uxe-side-cart-wrapper {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: var(--uxe-cart-width);
  z-index: 100001;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  max-width: 100vw;
}

.uxe-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}

body.uxe-cart-is-open #uxe-side-cart-wrapper {
  transform: translateX(0);
}

body.uxe-cart-is-open .uxe-cart-overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

/* Main Cart Structure */
.uxe-side-cart {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--uxe-background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Header */
.uxe-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--uxe-border-color);
  background-color: var(--uxe-background);
  flex-shrink: 0;
}

.uxe-close-cart {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--uxe-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.uxe-cart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--uxe-text-primary);
  margin: 0;
  letter-spacing: 0.5px;
}

.uxe-cart-icon {
  position: relative;
  color: var(--uxe-text-primary);
}

.uxe-cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: var(--uxe-primary-blue);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Content Area */
.uxe-cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Delivery Notice */
.uxe-delivery-notice {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.uxe-delivery-notice-text {
  background-color: var(--uxe-light-blue-bg);
  color: black;
  padding: 20px;
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  text-align: center;
  width: 100%;
  margin: 0 auto;
  border-radius: 6px;
  font-weight: 400;
}

.uxe-delivery-notice a {
  color: var(--uxe-blue-text);
  font-weight: 600;
}

/* Empty Cart */
.uxe-cart-empty {
  padding: 80px 20px 40px;
  text-align: center;
}

.uxe-empty-text {
  margin-bottom: 40px;
}

.uxe-empty-text p {
  font-size: 16px;
  color: var(--uxe-text-secondary);
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.uxe-category-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 280px;
  margin: 0 auto;
}

.uxe-category-button {
  background-color: transparent;
  border: 1px solid var(--uxe-border-color);
  color: var(--uxe-primary-blue);
  padding: 14px 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-align: center;
}

.uxe-category-button:hover {
  border-color: var(--uxe-primary-blue);
  background-color: rgba(66, 133, 244, 0.04);
}

/* Cart Items */
.uxe-cart-items {
  padding: 16px;
}

.uxe-cart-item {
  display: flex;
  flex-direction: row; /* MUDANÇA: de column para row */
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--uxe-border-color);
}

.uxe-cart-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.uxe-item-image {
  align-self: flex-start;
}

.uxe-item-image img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
}

.uxe-item-details {
  justify-content: space-between;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.uxe-item-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.uxe-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--uxe-text-primary);
  margin: 0;
  line-height: 1.3;
  flex: 1;
  margin-right: 12px;
  position: relative;
}

.uxe-discount-tag {
  background-color: var(--uxe-discount-bg);
  color: var(--uxe-discount-text);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 3px;
  margin-left: 8px;
  white-space: nowrap;
}

.uxe-remove-item {
  background: none;
  border: none;
  color: var(--uxe-text-light);
  font-size: 10px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  white-space: nowrap;
}

.uxe-remove-item:hover {
  color: var(--uxe-discount-text);
}

.uxe-item-variation {
  font-size: 10px; /* MUDANÇA: de 12px para 10px */
  color: var(--uxe-text-secondary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.uxe-item-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.uxe-quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--uxe-border-color);
  border-radius: 4px;
  background-color: var(--uxe-light-blue-bg);
}

.uxe-qty-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--uxe-primary-blue);
  font-weight: 600;
}

.uxe-qty-number {
  min-width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--uxe-text-primary);
}

.uxe-item-price {
  text-align: right;
}

.uxe-price-original {
  font-size: 12px;
  color: var(--uxe-text-light);
  text-decoration: line-through;
  margin-bottom: 2px;
}

.uxe-price-current {
  font-size: 16px;
  font-weight: 600;
  color: var(--uxe-green-text);
  margin-bottom: 2px;
}

.uxe-pix-text {
  font-size: 13px;
  color: var(--uxe-green-pix);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.uxe-pix-icon {
  color: var(--uxe-green-pix);
  font-size: 16px;
}

.uxe-cart-items-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: space-between;
  height: 100%;
}

/* Recommendations */
.uxe-recommendations-section {
  padding: 16px;
  margin-top: 0;
  flex-direction: column;
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.uxe-recommendations-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--uxe-text-primary);
  margin: 0 0 16px 0;
  text-align: center;
  letter-spacing: 0.5px;
  background-color: var(--uxe-light-blue-bg);
  padding: 10px;
  border-radius: 6px;
  width: 100%;
}

.uxe-related-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
  width: 100%;
}

.uxe-tag {
  background-color: var(--uxe-background);
  border: 1px solid var(--uxe-border-color);
  color: black;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Products Grid - FIXED LAYOUT */
.uxe-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.uxe-product-card {
  background-color: var(--uxe-background);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  min-width: 0; /* Allow flex items to shrink */
  width: 100%;
}

.uxe-product-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  width: 100%;
}

.uxe-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.uxe-product-discount {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: var(--uxe-discount-bg);
  color: var(--uxe-discount-text);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.uxe-add-product-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--uxe-light-blue-bg);
  color: var(--uxe-primary-blue);
  border: none;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(66, 133, 244, 0.3);
  transition: transform 0.2s ease;
  line-height: 1;
}

.uxe-add-product-btn:hover {
  transform: scale(1.1);
}

.uxe-product-info {
  padding: 8px;
  width: 100%;
}

.uxe-product-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--uxe-text-primary);
  margin: 0 0 4px 0;
  line-height: 1.3;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 28px;
}

.uxe-product-price {
  font-size: 12px;
  color: var(--uxe-green-text);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.uxe-product-price del {
  color: var(--uxe-text-light);
  font-size: 12x;
  margin-bottom: 2px;
  display: block;
}

.uxe-product-price .uxe-pix-text {
  font-size: 13px;
  color: var(--uxe-green-pix);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
  line-height: 1.2;
}

.uxe-product-price .uxe-pix-text svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Footer */
.uxe-cart-footer {
  background-color: var(--uxe-background);
  border-top: 1px solid var(--uxe-border-color);
  padding: 20px;
  flex-shrink: 0;
}

.uxe-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}

.uxe-subtotal-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--uxe-text-primary);
}

.uxe-subtotal-price {
  text-align: right;
}

.uxe-total-amount {
  font-size: 18px;
  font-weight: 600;
  color: var(--uxe-green-text);
  margin-bottom: 2px;
}

.uxe-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uxe-checkout-button {
  background-color: var(--uxe-primary-blue);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.uxe-checkout-button:hover {
  background-color: #3367d6;
}

.uxe-continue-button {
  background: none;
  border: none;
  color: var(--uxe-text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px;
}

.uxe-continue-button:hover {
  color: var(--uxe-primary-blue);
}

/* Loading State */
.uxe-cart-content.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  :root {
    --uxe-cart-width: 100vw;
  }

  .uxe-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .uxe-product-title {
    min-height: 24px;
  }
}

@media (max-width: 480px) {
  .uxe-products-grid {
    gap: 8px;
  }

  .uxe-delivery-notice-text {
    font-size: 11px;
  }

  .uxe-product-info {
    padding: 6px;
  }
}
