/**
 * The Swag World - Slide-Over Cart Drawer Styles
 * Brand Palette: Rich Berry (#C83258 / #D85A7F), Soft Pink (#FDF8F9), Charcoal (#1A1A1A), Champagne Gold
 */

/* Backdrop */
.tsw-cart-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 20, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.tsw-cart-drawer-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* Drawer Container */
.tsw-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  z-index: 99999;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.tsw-cart-drawer.is-active {
  transform: translateX(0);
}

.tsw-cart-drawer-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Header */
.tsw-cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border, #f0e6eb);
  background: #ffffff;
}

.tsw-drawer-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--color-dark, #1a1a1a);
}

.tsw-drawer-title {
  margin: 0;
  font-family: var(--font-heading, "Playfair Display", serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-dark, #1a1a1a);
  letter-spacing: -0.01em;
}

.tsw-drawer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--color-primary, #e34592);
  border-radius: 999px;
}

.tsw-drawer-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border, #f0e6eb);
  background: transparent;
  border-radius: 50%;
  color: var(--color-dark, #1a1a1a);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tsw-drawer-close-btn:hover {
  background: var(--color-bg-page, #fdf8f9);
  border-color: var(--color-primary, #e34592);
  color: var(--color-primary, #e34592);
  transform: rotate(90deg);
}

/* Notice Strip */
.tsw-drawer-notice-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: #fdf5f8;
  border-bottom: 1px solid #fae6ee;
  font-size: 0.8125rem;
  color: #832042;
}

.tsw-drawer-notice-icon {
  font-size: 0.95rem;
}

/* Content Area */
.tsw-cart-drawer-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.tsw-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  -webkit-overflow-scrolling: touch;
}

/* Empty State */
.tsw-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1rem;
}

.tsw-drawer-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fdf5f8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c83258;
  margin-bottom: 1.25rem;
}

.tsw-drawer-empty-title {
  font-family: var(--font-heading, "Playfair Display", serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-dark, #1a1a1a);
}

.tsw-drawer-empty-desc {
  font-size: 0.88rem;
  color: #666666;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 0 1.75rem;
}

.tsw-drawer-empty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  background: var(--color-primary, #e34592);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(227, 69, 146, 0.3);
  transition: all 0.25s ease;
}

.tsw-drawer-empty-btn:hover {
  background: var(--color-primary-hover, #c72977);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(227, 69, 146, 0.4);
}

/* Items List */
.tsw-drawer-items-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tsw-drawer-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border, #f0e6eb);
  position: relative;
}

.tsw-drawer-item-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
  background: #fdf5f8;
  flex-shrink: 0;
  border: 1px solid #f0e6eb;
}

.tsw-drawer-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tsw-drawer-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tsw-drawer-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-dark, #1a1a1a);
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tsw-drawer-item-title:hover {
  color: var(--color-primary, #e34592);
}

.tsw-drawer-item-variation {
  font-size: 0.78rem;
  color: #777777;
  margin-bottom: 0.4rem;
}

.tsw-drawer-item-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-dark, #1a1a1a);
  margin-bottom: 0.65rem;
}

.tsw-drawer-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* Quantity Stepper */
.tsw-drawer-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e0d0d8;
  border-radius: 999px;
  background: #faf6f8;
  overflow: hidden;
}

.tsw-drawer-stepper-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #1a1a1a;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tsw-drawer-stepper-btn:hover {
  background: #eed8e2;
  color: var(--color-primary, #e34592);
}

.tsw-drawer-stepper-qty {
  min-width: 26px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a1a1a;
}

.tsw-drawer-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: none;
  color: #999999;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.tsw-drawer-remove-btn:hover {
  color: #d32f2f;
}

/* Footer */
.tsw-drawer-footer {
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid var(--color-border, #f0e6eb);
  background: #ffffff;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
}

.tsw-drawer-subtotal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.tsw-drawer-subtotal-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #555555;
}

.tsw-drawer-subtotal-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-dark, #1a1a1a);
  font-family: var(--font-heading, "Playfair Display", serif);
}

.tsw-drawer-shipping-note {
  font-size: 0.78rem;
  color: #777777;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tsw-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tsw-drawer-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  background: var(--color-primary, #e34592);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(227, 69, 146, 0.35);
  transition: all 0.25s ease;
}

.tsw-drawer-checkout-btn:hover {
  background: var(--color-primary-hover, #c72977);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(227, 69, 146, 0.45);
}

.tsw-drawer-continue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid #e0d0d8;
  color: #555555;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tsw-drawer-continue-btn:hover {
  background: #fdf5f8;
  border-color: var(--color-primary, #e34592);
  color: var(--color-primary, #e34592);
}

.tsw-drawer-view-cart-link {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  color: #888888;
  text-decoration: underline;
  margin-top: 0.25rem;
}

.tsw-drawer-view-cart-link:hover {
  color: var(--color-primary, #e34592);
}

/* Loading Overlay inside Drawer */
.tsw-drawer-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tsw-drawer-loading-overlay.is-loading {
  opacity: 1;
  pointer-events: auto;
}

.tsw-drawer-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #fae6ee;
  border-top-color: var(--color-primary, #e34592);
  border-radius: 50%;
  animation: tswDrawerSpin 0.7s linear infinite;
}

@keyframes tswDrawerSpin {
  to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .tsw-cart-drawer {
    max-width: 100%;
  }
  .tsw-drawer-header {
    padding: 1rem 1.25rem;
  }
  .tsw-drawer-body {
    padding: 1rem 1.25rem;
  }
  .tsw-drawer-footer {
    padding: 1rem 1.25rem 1.25rem;
  }
}
