#shipping-carousel-wrapper,
#shipping-carousel-wrapper * {
  box-sizing: border-box;
}

/* Hidden by default until cart login UI confirms the user is logged in. */
#shipping-carousel-wrapper.pcs-shipping-carousel--hidden {
  display: none !important;
  visibility: hidden !important;
}

#shipping-carousel-wrapper.carousel-active {
  font-family: var(--pcs-font-family, sans-serif);
  overflow: visible;
  padding: 0 20px;
}

.user-message {
  padding: 10px 15px;
  margin-bottom: 20px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: .25rem;
  text-align: center;
  max-width: 500px; /* Limit width of message box */
  word-wrap: break-word; /* Wrap long messages */
  margin-left: auto; /* Center if it's a block element */
  margin-right: auto; /* Center if it's a block element */
}

.user-message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

.user-message.empty {
    display: none; /* Hide if message is empty */
}

.deliver-box {
  width: 100%;
  max-width: 260px;
  height: 190px; /* Fixed height required by absolutely-positioned .address panels */
  border: 2px solid var(--pcs-border-color, #d3d6db);
  border-radius: 16px;
  position: relative;
  /* No overflow:hidden here - the "Deliver To:" label sits half outside the
     top edge on purpose. Slide clipping is handled by .carousel-content below. */
  background: white;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  margin: 12px auto 4px;
  box-sizing: border-box;
}

.deliver-label {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  padding: 6px 20px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  border: 2px solid var(--pcs-border-color, #d3d6db);
}

.deliver-label span {
  font-size: 14px;
  color: #a0a4ab;
  white-space: nowrap;
}

.carousel-content {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  color: #333;
  padding: 30px 20px 20px; /* Adjusted padding: top 30px, sides 20px, bottom 20px */
  text-align: center;
  overflow: hidden; /* Clip content that slides out */
  border-radius: 14px; /* Match .deliver-box corners now that it owns the clipping */
}

.address {
  position: absolute;
  opacity: 0;
  transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center; /* Re-added to center content horizontally */
  justify-content: space-between; /* Distribute space between items, pushing button to bottom */
  /* gap: 2px; */ /* Removed as space-between handles vertical spacing */
  width: calc(100% - 40px); /* Ensure content fits within padding */
  height: calc(100% - 50px); /* Adjusted height considering new padding */
  text-align: center; /* Align text to the center */
}

.address.active {
  opacity: 1;
  transform: translateX(0);
}

.address.out-left {
  transform: translateX(-100%);
  opacity: 0;
}

.address.out-right {
  transform: translateX(100%);
  opacity: 0;
}

.address .name {
  font-weight: bold;
  font-size: 16px;
  color: #2c3e50;
  margin-bottom: 2px;
}

.address div:not(.name) {
  font-size: 13px;
  color: #555;
  line-height: 1.3;
  flex-grow: 1; /* Allow address lines to take up available space */
}

.address .address-line,
.address .address-csz,
.address .address-country,
.address .address-phone, /* Added phone number class */
.address .address-message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.address-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  width: 100%;
}

.edit-button,
.add-button,
.delete-button {
  align-self: center;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  color: #dc2626;
  border-color: #fecaca;
  box-shadow: 0 6px 12px rgba(239, 68, 68, 0.15);
}

.delete-button svg {
  display: block;
}

.edit-button {
  background: linear-gradient(135deg, #e0f2fe 0%, #bfdbfe 100%);
  color: #1d4ed8;
  border-color: #c7d2fe;
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.15);
}

.add-button {
  background: linear-gradient(135deg, #ecfdf3 0%, #a7f3d0 100%);
  color: #047857;
  border-color: #a7f3d0;
  box-shadow: 0 6px 12px rgba(16, 185, 129, 0.18);
}

.edit-button:hover,
.add-button:hover,
.delete-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(15, 23, 42, 0.12);
}

.edit-button:active,
.add-button:active,
.delete-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.1);
}

.nav-button {
  position: absolute;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--pcs-border-color, #d3d6db);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  color: #555;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  z-index: 4;
}

.nav-left {
  left: 0;
  transform: translate(-50%, -50%);
}

.nav-right {
  right: 0;
  transform: translate(50%, -50%);
}

.nav-left:hover:not(:disabled):not(.is-disabled) {
  background: #f8fafc;
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.nav-right:hover:not(:disabled):not(.is-disabled) {
  background: #f8fafc;
  transform: translate(50%, -50%) scale(1.08);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.nav-left:active:not(:disabled):not(.is-disabled) {
  transform: translate(-50%, -50%) scale(0.96);
  background: #f1f5f9;
}

.nav-right:active:not(:disabled):not(.is-disabled) {
  transform: translate(50%, -50%) scale(0.96);
  background: #f1f5f9;
}

.nav-left:disabled,
.nav-left.is-disabled,
.nav-right:disabled,
.nav-right.is-disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  background: #ffffff;
  color: #9ca3af;
}

.nav-left:disabled,
.nav-left.is-disabled {
  transform: translate(-50%, -50%);
}

.nav-right:disabled,
.nav-right.is-disabled {
  transform: translate(50%, -50%);
}
