/* RallyAlly Save Design UI */

/* Save Design Button Section */
.ra-save-design-section {
  margin: 32px 0;
  padding: 24px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

.ra-btn-save-design {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ra-btn-save-design:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.ra-save-hint {
  margin-top: 12px;
  font-size: 14px;
  color: #6c757d;
}

/* Save Design Panel (Modal) */
.ra-save-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 480px;
  width: 90%;
  padding: 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 10000;
}

.ra-save-panel[hidden] {
  display: none;
}

.ra-save-panel h3 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
}

.ra-save-panel > p {
  margin: 0 0 24px;
  font-size: 15px;
  color: #6c757d;
  line-height: 1.6;
}

.ra-save-panel label {
  display: block;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 600;
  color: #495057;
}

.ra-save-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.ra-save-field label {
  margin-bottom: 0;
}

.ra-save-panel input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ra-save-panel input[type="email"]:focus {
  outline: none;
  border-color: #667eea;
}

.ra-save-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 24px;
  font-size: 13px;
  font-weight: 400;
  color: #6c757d;
  cursor: pointer;
}

.ra-save-consent-label input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
}

.ra-save-panel .ra-btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ef6b32 0%, #d94f1f 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ra-save-panel .ra-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 107, 50, 0.35);
}

.ra-save-panel .ra-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ra-save-status {
  margin-top: 16px;
  padding: 12px;
  font-size: 14px;
  text-align: center;
  border-radius: 6px;
  min-height: 20px;
}

.ra-save-status:empty {
  display: none;
}

.ra-save-status.success {
  color: #155724;
  background: #d4edda;
  border: 1px solid #c3e6cb;
}

.ra-save-status.error {
  color: #721c24;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
}

/* Overlay */
.ra-save-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
}

.ra-save-overlay[hidden] {
  display: none;
}

/* Success Toast */
.ra-save-success-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 400px;
  padding: 16px 20px;
  background: #155724;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10001;
  animation: slideIn 0.3s ease;
}

.ra-save-success-toast[hidden] {
  display: none;
}

@keyframes slideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.ra-save-success-toast .ra-icon {
  font-size: 24px;
  font-weight: bold;
}

.ra-save-success-toast a {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #155724;
  background: #fff;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
}

.ra-save-success-toast a:hover {
  background: #f0f0f0;
}

/* My Account Saved Designs */
.rallyally-saved-designs {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.rallyally-saved-designs li {
  margin-bottom: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: box-shadow 0.2s;
}

.rallyally-saved-designs li:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rallyally-saved-design-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rallyally-saved-design-item strong {
  font-size: 18px;
  color: #2c3e50;
}

.rallyally-saved-design-item small {
  font-size: 13px;
  color: #6c757d;
}

.design-summary {
  margin: 8px 0;
  padding: 8px 12px;
  font-size: 14px;
  color: #495057;
  background: #f8f9fa;
  border-radius: 4px;
}

.design-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.design-actions .button {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.design-actions .ra-reorder-btn {
  background: #667eea;
  color: #fff;
  border: none;
  cursor: pointer;
}

.design-actions .ra-reorder-btn:hover {
  background: #5568d3;
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
  .ra-save-panel {
    width: 95%;
    padding: 24px 20px;
  }

  .ra-save-success-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }

  .design-actions {
    flex-direction: column;
  }

  .design-actions .button {
    text-align: center;
  }
}

/* Keep actions in a compact rail on the right of each card. */
@media (min-width: 769px) {
  .rallyally-saved-design-item {
    grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) auto;
  }

  .rallyally-saved-design-item .design-actions {
    align-self: stretch;
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
    min-width: 132px;
    padding: 24px 22px;
    border-left: 1px solid #e3ddd4;
  }

  .rallyally-saved-design-item .design-actions .button {
    width: 132px;
  }
}

/* Saved Designs account cards */
.rallyally-saved-designs {
  display: grid;
  gap: 18px;
  margin: 28px 0;
}

.rallyally-saved-designs li {
  margin: 0;
  overflow: hidden;
  padding: 0;
  background: #f8f6f1;
  border: 1px solid rgba(239, 107, 50, 0.18);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(16, 12, 24, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rallyally-saved-designs li:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(16, 12, 24, 0.22);
}

.rallyally-saved-design-item {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) auto;
  min-height: 220px;
}

.rallyally-saved-design-item .design-thumbnail {
  min-height: 220px;
  background: #e9e5de;
}

.rallyally-saved-design-item .design-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.rallyally-saved-design-item .design-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px 28px 12px;
}

.rallyally-saved-design-item .design-title {
  margin: 0;
  color: #191522;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.1;
}

.rallyally-saved-design-item small {
  display: block;
  margin-top: 8px;
  color: #756f78;
  font-size: 13px;
}

.design-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 22px 0 0;
  padding: 0;
  background: transparent;
}

.design-summary .size-badge,
.design-summary .total-items {
  padding: 7px 10px;
  color: #403a43;
  background: #ebe6dd;
  border-radius: 999px;
}

.design-summary .total-items {
  color: #ef6b32;
  font-weight: 700;
}

.design-actions {
  align-self: stretch;
  align-items: stretch;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 28px 26px;
}

.design-actions .button {
  min-width: 118px;
  padding: 12px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.design-actions .button:hover {
  transform: translateY(-1px);
}

.design-actions .button:not(.ra-reorder-btn):not(.ra-delete-design-btn) {
  color: #191522;
  background: transparent;
  border: 1px solid #cfc7bd;
}

.design-actions .ra-reorder-btn {
  color: #fff;
  background: #ef6b32;
  border: 1px solid #ef6b32;
}

.design-actions .ra-delete-design-btn {
  color: #9b3f32;
  background: transparent;
  border: 1px solid #d9a59b;
  cursor: pointer;
}

.design-actions .ra-delete-design-btn:hover {
  color: #fff;
  background: #9b3f32;
}

/* Custom delete confirmation */
.ra-delete-modal[hidden] {
  display: none;
}

.ra-delete-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ra-delete-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 27, 0.74);
  backdrop-filter: blur(5px);
}

.ra-delete-modal__dialog {
  position: relative;
  width: min(100%, 440px);
  padding: 32px;
  color: #191522;
  background: #f8f6f1;
  border-top: 4px solid #ef6b32;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.ra-delete-modal__eyebrow {
  color: #ef6b32;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ra-delete-modal__dialog h3 {
  margin: 10px 0;
  font-size: 28px;
  line-height: 1.05;
}

.ra-delete-modal__dialog p {
  margin: 0;
  color: #625b64;
  line-height: 1.6;
}

.ra-delete-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.ra-delete-modal__actions button {
  padding: 11px 16px;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ra-delete-modal__cancel {
  color: #191522;
  background: transparent;
  border: 1px solid #cfc7bd;
}

.ra-delete-modal__confirm {
  color: #fff;
  background: #9b3f32;
  border: 1px solid #9b3f32;
}

@media (max-width: 768px) {
  .rallyally-saved-design-item {
    grid-template-columns: 1fr;
  }

  .rallyally-saved-design-item .design-thumbnail,
  .rallyally-saved-design-item .design-thumbnail img {
    min-height: 190px;
    max-height: 260px;
  }

  .rallyally-saved-design-item .design-info,
  .design-actions {
    padding-left: 20px;
    padding-right: 20px;
  }

  .design-actions {
    align-items: stretch;
    flex-direction: column;
    padding-bottom: 20px;
  }
}
