
/* ================================================================== */
/*  ElClono Cart System Styles                                        */
/* ================================================================== */

/* ---- Toast notifications ---- */
.elclono-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.elclono-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #1a1a2e;
  color: #fff;
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  pointer-events: auto;
}

.elclono-toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.elclono-toast-hiding {
  transform: translateX(120%);
  opacity: 0;
}

.elclono-toast-icon {
  flex-shrink: 0;
  color: #4ade80;
}

/* ---- Cart icon + badge ---- */
.elclono-cart-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.elclono-cart-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  transition: opacity 0.2s;
}

.elclono-cart-icon-btn:hover {
  opacity: 0.7;
}

.elclono-cart-icon-btn svg {
  width: 24px;
  height: 24px;
}

.elclono-cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.elclono-badge-pulse {
  animation: elclono-pulse 0.3s ease;
}

@keyframes elclono-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ---- Mini cart dropdown ---- */
.elclono-minicart {
  position: absolute;
  top: 100%;
  right: 0;
  width: 300px;
  background: #fff;
  color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 2147483640;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
}

.elclono-cart-icon-wrap:hover .elclono-minicart {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.elclono-minicart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.elclono-minicart-item:last-of-type {
  border-bottom: none;
}

.elclono-minicart-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.elclono-minicart-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.elclono-minicart-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.elclono-minicart-meta {
  color: #888;
  font-size: 12px;
}

.elclono-minicart-more {
  color: #888;
  font-size: 12px;
  text-align: center;
  margin: 8px 0 0;
}

.elclono-minicart-empty {
  color: #888;
  text-align: center;
  padding: 12px 0;
  margin: 0;
}

.elclono-minicart-total {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid #eee;
  font-size: 14px;
}

.elclono-minicart-view {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.elclono-minicart-view:hover {
  background: #2d2d4e;
}

/* ---- Drawer overlay ---- */
.elclono-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 2147483640;
  pointer-events: none;
  transition: background 0.35s ease;
}

.elclono-drawer-overlay--visible {
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

/* ---- Cart drawer ---- */
.elclono-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 92vw;
  height: 100%;
  background: #fff;
  color: #1a1a1a;
  z-index: 2147483645;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}

.elclono-cart-drawer--open {
  transform: translateX(0);
}

/* Drawer header */
.elclono-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.elclono-drawer-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.elclono-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #666;
  transition: background 0.15s, color 0.15s;
}

.elclono-drawer-close:hover {
  background: #f5f5f5;
  color: #000;
}

.elclono-drawer-close svg {
  width: 20px;
  height: 20px;
}

/* Drawer items list */
.elclono-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  -webkit-overflow-scrolling: touch;
}

.elclono-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: #999;
  text-align: center;
}

.elclono-drawer-empty p {
  margin: 0;
  font-size: 15px;
}

/* Individual cart item in drawer */
.elclono-drawer-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #f2f2f2;
  animation: elclono-fade-in 0.3s ease;
}

.elclono-drawer-item:last-child {
  border-bottom: none;
}

@keyframes elclono-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.elclono-drawer-item-img {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.elclono-drawer-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.elclono-drawer-item-placeholder {
  width: 100%;
  height: 100%;
  background: #eee;
}

.elclono-drawer-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.elclono-drawer-item-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.elclono-drawer-item-variant {
  font-size: 12px;
  color: #888;
}

.elclono-drawer-item-price {
  font-size: 13px;
  color: #555;
}

/* Quantity controls in drawer */
.elclono-drawer-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
  width: fit-content;
}

.elclono-qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: #fafafa;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: background 0.15s;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}

.elclono-qty-btn:hover {
  background: #eee;
}

.elclono-qty-value {
  min-width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}

/* Right side of drawer item (remove + line total) */
.elclono-drawer-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
}

.elclono-drawer-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #bbb;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}

.elclono-drawer-item-remove:hover {
  color: #ef4444;
}

.elclono-drawer-item-total {
  font-weight: 700;
  font-size: 14px;
}

/* Drawer footer */
.elclono-drawer-footer {
  border-top: 1px solid #eee;
  padding: 16px 20px 20px;
  flex-shrink: 0;
}

.elclono-drawer-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  color: #555;
}

.elclono-drawer-subtotal-value,
.elclono-drawer-tax-value,
.elclono-drawer-total-value {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #333 !important;
  font-size: 14px !important;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

.elclono-drawer-total-row .elclono-drawer-total-value {
  color: #1a1a1a !important;
  font-size: 16px !important;
  font-weight: 700;
}

.elclono-drawer-summary-row.elclono-drawer-total-row {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid #eee;
}

.elclono-drawer-checkout-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  margin-top: 16px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.elclono-drawer-checkout-btn:hover {
  background: #2d2d4e;
  transform: translateY(-1px);
}

.elclono-drawer-checkout-btn:active {
  transform: translateY(0);
}

.elclono-drawer-continue {
  display: block;
  text-align: center;
  margin-top: 10px;
  color: #888;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-family: inherit;
}

.elclono-drawer-continue:hover {
  color: #333;
}

/* ---- Quantity selector on product pages ---- */
.elclono-product-qty-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.elclono-product-qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: #fafafa;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: background 0.15s;
  font-family: inherit;
  padding: 0;
}

.elclono-product-qty-btn:hover {
  background: #eee;
}

.elclono-qty-input {
  width: 50px;
  height: 40px;
  text-align: center;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  -moz-appearance: textfield;
  appearance: textfield;
}

.elclono-qty-input::-webkit-inner-spin-button,
.elclono-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---- Add to Cart button ---- */
.elclono-add-to-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  min-width: 180px;
  min-height: 48px;
}

.elclono-add-to-cart:hover {
  background: #2d2d4e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.elclono-add-to-cart:active {
  transform: translateY(0);
  box-shadow: none;
}

.elclono-add-to-cart:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.elclono-btn-loading {
  color: transparent !important;
}

.elclono-btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: elclono-spin 0.6s linear infinite;
}

.elclono-btn-success {
  background: #16a34a !important;
}

.elclono-btn-success::after {
  content: none;
}

@keyframes elclono-spin {
  to { transform: rotate(360deg); }
}

/* ---- Variant selectors ---- */
.elclono-variant-group {
  margin-bottom: 16px;
}

.elclono-variant-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.elclono-variant-select {
  width: 100%;
  max-width: 280px;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.elclono-variant-select:focus {
  outline: none;
  border-color: #1a1a2e;
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .elclono-cart-drawer {
    width: 100%;
    max-width: 100vw;
  }

  .elclono-minicart {
    display: none !important;
  }

  .elclono-toast-container {
    top: auto;
    bottom: 20px;
    right: 12px;
    left: 12px;
  }

  .elclono-toast {
    width: 100%;
  }
}
