/**
 * Cart Page Styles
 */

body {
  padding-bottom: 180px;
}

/* Header */
.cart-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(250, 246, 241, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.cart-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-size: 1.25rem;
  border-radius: 50%;
  transition: background 0.2s;
  text-decoration: none;
}

.back-btn:active {
  background: var(--color-bg-darker);
}

.clear-btn {
  background: none;
  border: none;
  color: var(--color-danger);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 12px;
}

/* Main */
.cart-main {
  padding: 72px 16px 16px;
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
}

/* Cart List */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Cart Card (새로운 카드 스타일) */
.cart-card {
  background: var(--color-bg-card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cart-card-content {
  display: flex;
  gap: 12px;
}

.cart-card-image {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-bg-darker);
  flex-shrink: 0;
}

.cart-card-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

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

.cart-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-card-option {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.cart-card-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Cart Card Actions */
.cart-card-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-card-subtotal {
  flex: 1;
  text-align: right;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

/* Quantity Control */
.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-darker);
  border-radius: 8px;
  padding: 4px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-card);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--color-text);
  transition: background 0.2s;
}

.qty-btn:active {
  background: var(--color-bg-dark);
}

.qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.delete-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.delete-btn:hover {
  color: var(--color-danger);
}

/* Empty State */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.empty-state i {
  font-size: 4rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.empty-state p {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0 0 24px 0;
}

.empty-state .btn {
  padding: 12px 32px;
}

/* Footer */
.cart-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 100;
}

.cart-summary {
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.summary-row.total {
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--color-border);
  font-size: 1rem;
  color: var(--color-text);
}

.summary-row.total strong {
  font-size: 1.25rem;
  color: var(--color-primary);
}

.btn-checkout {
  width: 100%;
  height: 52px;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Responsive */
@media (min-width: 768px) {
  .cart-footer {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
}
