/* Cart page styles matching product page aesthetic */
.cart-header {
  text-align: center;
  margin-bottom: 32px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(2,6,23,0.06);
  position: relative;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(2,6,23,0.06);
  box-shadow: 0 2px 8px rgba(2,6,23,0.04);
}

.cart-title {
  font-size: 2rem;
  font-weight: 800;
  color: #071325;
  margin: 0 0 8px;
}

.cart-subtitle {
  color: var(--muted);
  font-size: 1rem;
  margin: 0;
}

.cart-container {
  max-width: 800px;
  margin: 0 auto;
}

.cart-item {
  background: #fff;
  border: 1px solid rgba(2,6,23,0.06);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(2,6,23,0.04);
  transition: all 0.2s ease;
}

.cart-item:hover {
  box-shadow: 0 4px 16px rgba(2,6,23,0.08);
  border-color: rgba(2,6,23,0.12);
}

.cart-item-main {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
}

/* Complementary product cards styling */
.product-card-complementary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px;
  border: 1px solid rgba(2,6,23,0.08);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  position: relative;
  text-align: left;
  font-family: inherit;
  text-decoration: none;
  color: inherit;
  width: 100%;
  min-height: 120px;
  transition: all 0.3s ease !important;
}

.product-card-complementary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2,6,23,0.12) !important;
  border-color: var(--brand) !important;
}

.product-card-complementary:active {
  transform: translateY(0);
}

.product-card-complementary.selected {
  border-color: var(--brand) !important;
  background: rgba(var(--brand-rgb), 0.05) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(var(--brand-rgb), 0.15) !important;
}

.product-card-complementary .check {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-card-complementary.selected .check {
  opacity: 1;
}

.product-card-complementary .check .badge {
  background: var(--brand);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.3);
}

/* Cart complements styling */
.cart-complements {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(2,6,23,0.08);
  background: rgba(2,6,23,0.01);
  border-radius: 8px;
  padding: 16px;
}

.cart-complements-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-complements-title::before {
  content: '🎁';
  font-size: 0.9rem;
}

.cart-complements-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
}

.cart-complements-grid::-webkit-scrollbar {
  height: 6px;
}

.cart-complements-grid::-webkit-scrollbar-track {
  background: rgba(2,6,23,0.05);
  border-radius: 3px;
}

.cart-complements-grid::-webkit-scrollbar-thumb {
  background: rgba(2,6,23,0.2);
  border-radius: 3px;
}

.cart-complements-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(2,6,23,0.3);
}

.cart-complement-card {
  background: rgba(2,6,23,0.02);
  border: 1px solid rgba(2,6,23,0.06);
  border-radius: 8px;
  padding: 10px;
  position: relative;
  transition: all 0.2s ease;
  flex: 0 0 120px;
  width: 120px;
}

.cart-complement-card:hover {
  background: rgba(2,6,23,0.04);
  border-color: rgba(2,6,23,0.12);
}

.cart-complement-image {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.cart-complement-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #071325;
  margin: 0 0 3px;
  line-height: 1.1;
  text-align: center;
}

.cart-complement-price {
  font-size: 0.75rem;
  color: var(--brand);
  font-weight: 600;
  text-align: center;
}

.cart-complement-dedication {
  font-style: italic;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.cart-complement-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: 0;
  background: rgba(220,53,69,0.1);
  color: #dc3545;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cart-complement-remove:hover {
  background: rgba(220,53,69,0.2);
  transform: scale(1.1);
}

.cart-item-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(2,6,23,0.1);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 800;
  font-size: 1.2rem;
  color: #071325;
  margin: 0 0 4px;
}

.cart-item-variant {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 8px;
}

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

.cart-item-price {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--brand);
  margin-left: auto;
}

.cart-qty-input {
  width: 80px;
  padding: 8px 12px;
  border: 1px solid rgba(2,6,23,0.12);
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  background: #fff;
  transition: all 0.2s ease;
}

.cart-qty-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb),0.1);
}

.cart-btn {
  padding: 8px 16px;
  border: 1px solid rgba(2,6,23,0.15);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-btn:hover {
  background: rgba(2,6,23,0.05);
  border-color: rgba(2,6,23,0.2);
  color: #071325;
}

.cart-btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.cart-btn-primary:hover {
  background: #a01922;
  border-color: #a01922;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--brand-rgb),0.3);
}

.cart-btn-danger {
  color: #dc3545;
  border-color: rgba(220,53,69,0.3);
}

.cart-btn-danger:hover {
  background: rgba(220,53,69,0.1);
  border-color: rgba(220,53,69,0.5);
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(2,6,23,0.06);
}

.cart-empty-icon {
  font-size: 100px;
  margin: 0 auto 20px;
  opacity: 0.3;
  color: var(--brand);
}

.cart-empty-text {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 20px;
}

.cart-footer {
  background: #fff;
  border: 1px solid rgba(2,6,23,0.06);
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
  position: sticky;
  bottom: 20px;
  z-index: 10;
  box-shadow: 0 -4px 20px rgba(2,6,23,0.1);
}

.cart-total-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(2,6,23,0.06);
}

.cart-total-label {
  font-size: 1.3rem;
  font-weight: 800;
  color: #071325;
}

.cart-total-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand);
}

.cart-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Modal styles */
.complements-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.complements-modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 1100px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(2,6,23,0.15);
}

.complements-modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.complements-modal-close:hover {
  background: rgba(2,6,23,0.1);
  color: #071325;
}

.complements-modal-title {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 1.3rem;
  text-align: center;
}

.complements-modal-info {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  padding: 8px 12px;
  background: rgba(2,6,23,0.02);
  border-radius: 8px;
}

.complements-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.complements-modal-grid .product-card-complementary {
  min-height: 140px;
}

.complements-modal-grid .no-complements {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 40px 20px;
}

.complements-modal-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(2,6,23,0.08);
}

.complements-modal-finish {
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.complements-modal-finish:hover:not(:disabled) {
  background: #a01922;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--brand-rgb),0.3);
}

.complements-modal-finish:disabled {
  background: #ccc;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.comp-img {
  width: 100%;
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  margin-bottom: 12px;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.product-card-complementary:hover .comp-img {
  transform: scale(1.02);
}

.comp-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.comp-name {
  font-weight: 700;
  color: var(--brand);
  font-size: 0.95rem;
  margin-bottom: 8px;
  text-align: center;
  line-height: 1.3;
}

.comp-price {
  color: var(--brand);
  font-size: 0.85rem;
  text-align: center;
  font-weight: 600;
}

/* Animations */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Mobile responsive */
@media (max-width: 760px) {
  .cart-header {
    padding: 16px;
    margin: 0 16px 24px;
  }
  
  #clear-cart-header {
    position: static;
    margin-top: 16px;
    width: 100%;
    justify-content: center;
  }
  
  .cart-item-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .cart-item-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
  }
  
  .cart-item-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .cart-item-price {
    margin-left: 0;
    order: -1;
  }
  
  .cart-complements-grid {
    gap: 8px;
  }
  
  .cart-complement-card {
    padding: 8px;
    flex: 0 0 110px;
    width: 110px;
  }
  
  .cart-actions {
    flex-direction: column;
  }
  
  .cart-empty {
    padding: 50px 20px;
  }
  
  .cart-empty-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 18px;
  }
  
  .cart-empty-text {
    font-size: 1.1rem;
    margin: 0 0 18px;
  }
}

@media (max-width: 480px) {
  .cart-header {
    padding: 12px;
    margin: 0 12px 20px;
  }
  
  #clear-cart-header {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
  
  .cart-item {
    padding: 16px;
  }
  
  .cart-footer {
    padding: 16px;
    margin: 20px 12px 12px;
  }
  
  .cart-title {
    font-size: 1.6rem;
  }
  
  .cart-empty {
    padding: 40px 16px;
    margin: 0 16px;
  }
  
  .cart-empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
  }
  
  .cart-empty-text {
    font-size: 1rem;
    margin: 0 0 16px;
  }
  
  .cart-complement-card {
    flex: 0 0 100px;
    width: 100px;
    padding: 6px;
  }
  
  .cart-complements-grid {
    gap: 6px;
  }
}
