/**
 * GiftRocketSure - Frontend Public Stylesheet
 * Premium, Beautiful & Modern Aesthetic
 */

:root {
  --gr-primary: #7549c6;
  --gr-primary-hover: #6136b0;
  --gr-primary-light: #f4efff;
  --gr-border-color: #e2e8f0;
  --gr-text-main: #1e293b;
  --gr-text-muted: #64748b;
  --gr-bg-card: #ffffff;
  --gr-bg-subtle: #f8fafc;
  
  /* Modern soft radiuses */
  --gr-radius-sm: 8px;
  --gr-radius-md: 12px;
  --gr-radius-lg: 16px;
  
  /* Refined, elegant shadows */
  --gr-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.04);
  --gr-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.03);
  --gr-shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.08), 0 6px 15px rgba(0, 0, 0, 0.04);
  --gr-shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.giftrocketsure-wrapper {
  max-width: 1050px;
  margin: 40px auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--gr-text-main);
  box-sizing: border-box;
}

.giftrocketsure-wrapper *,
.giftrocketsure-wrapper *::before,
.giftrocketsure-wrapper *::after {
  box-sizing: border-box;
}

/* Accordion Container */
.gr-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.gr-accordion-item {
  border: 1px solid var(--gr-border-color);
  border-radius: var(--gr-radius-md);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--gr-bg-card);
  box-shadow: var(--gr-shadow-sm);
}

/* Collapsed Header */
.gr-accordion-header {
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--gr-bg-card);
  color: #334155;
  user-select: none;
  transition: all 0.2s ease;
}

.gr-accordion-header:hover {
  background-color: #fcfcfd;
}

.gr-accordion-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  flex-shrink: 0;
  vertical-align: middle;
}

.gr-accordion-icon svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.gr-accordion-item.is-active .gr-accordion-icon svg {
  transform: rotate(90deg);
}

/* Expanded State */
.gr-accordion-item.is-active {
  border: 1px solid var(--gr-primary);
  box-shadow: var(--gr-shadow-md);
  transform: translateY(-2px);
}

.gr-accordion-item.is-active > .gr-accordion-header {
  background-color: var(--gr-primary);
  color: #ffffff;
}

.gr-accordion-item.is-active > .gr-accordion-header:hover {
  background-color: var(--gr-primary-hover);
}

/* Content Container (2-Column Grid) */
.gr-accordion-content {
  display: none;
  background: var(--gr-bg-card);
  padding: 30px;
}

.gr-accordion-item.is-active > .gr-accordion-content {
  display: block;
}

.gr-single-page-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 40px;
  align-items: start;
}

/* ==========================================================================
   Left Column: Live Card Preview
   ========================================================================== */
.gr-card-preview-container {
  background: #ffffff;
  border: 1px solid var(--gr-border-color);
  border-radius: var(--gr-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--gr-shadow-md);
  transition: box-shadow 0.3s ease;
}

.gr-card-preview-container:hover {
  box-shadow: var(--gr-shadow-hover);
}

.gr-card-preview-inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.gr-card-artwork-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--gr-bg-subtle);
  border-radius: var(--gr-radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: var(--gr-shadow-inner);
}

.gr-card-artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.gr-card-info-section {
  padding: 24px 16px 16px;
  text-align: center;
  border-top: 1px solid #f1f5f9;
  margin-top: 20px;
}

.gr-card-product-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px 0;
  letter-spacing: -0.01em;
}

.gr-card-dynamic-amount {
  font-size: 36px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 auto 8px;
  display: inline-block;
  position: relative;
  letter-spacing: -0.02em;
}

.gr-card-amount-underline {
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, var(--gr-primary) 0%, #a855f7 100%);
  margin: 0 auto 20px;
  border-radius: 4px;
}

.gr-card-barcode-wrapper {
  margin: 12px auto;
  max-width: 180px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.gr-card-barcode-wrapper.is-qr {
  max-width: 60px;
  height: 60px;
}

.gr-card-barcode-wrapper img,
.gr-card-barcode-wrapper svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gr-card-footer-note {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 20px 0 0;
  text-align: center;
  border-top: 1px dashed #e2e8f0;
  padding-top: 16px;
}

/* ==========================================================================
   Right Column: Options & Customizer
   ========================================================================== */
.gr-customizer-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.gr-product-description {
  font-size: 15px;
  line-height: 1.6;
  color: #475569;
  margin: 0;
}

.gr-section-heading {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 14px 0;
  letter-spacing: -0.01em;
}

/* Amount Selector */
.gr-amount-selector-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gr-preset-amounts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gr-amount-btn {
  background: #ffffff;
  border: 1px solid var(--gr-border-color);
  color: #475569;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: var(--gr-radius-lg);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 80px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

.gr-amount-btn:hover {
  border-color: var(--gr-primary);
  color: var(--gr-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(117, 73, 198, 0.1);
}

.gr-amount-btn.is-selected {
  background: linear-gradient(135deg, var(--gr-primary) 0%, #6136b0 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(117, 73, 198, 0.25);
}

.gr-custom-amount-wrapper {
  margin-top: 6px;
}

.gr-custom-amount-input {
  width: 100%;
  max-width: 400px;
  padding: 14px 18px;
  font-size: 15px;
  border: 1px solid #cbd5e1;
  border-radius: var(--gr-radius-md);
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--gr-shadow-inner);
}

.gr-custom-amount-input:hover {
  border-color: #94a3b8;
}

.gr-custom-amount-input:focus {
  border-color: var(--gr-primary);
  box-shadow: 0 0 0 4px rgba(117, 73, 198, 0.15);
}

.gr-custom-amount-input::placeholder {
  color: #94a3b8;
}

/* Design Selector Gallery */
.gr-design-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.gr-design-thumbnail-card {
  aspect-ratio: 4 / 3;
  border: 2px solid transparent;
  border-radius: var(--gr-radius-md);
  overflow: hidden;
  cursor: pointer;
  background: #f8fafc;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.gr-design-thumbnail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
  border-color: var(--gr-primary-light);
}

.gr-design-thumbnail-card.is-selected {
  border-color: var(--gr-primary);
  box-shadow: 0 8px 20px rgba(117, 73, 198, 0.2);
  transform: scale(1.02);
}

.gr-design-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Recipient Checkbox & Optional Fields */
.gr-recipient-toggle-wrap {
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
  margin-top: 10px;
}

.gr-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.gr-checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: var(--gr-primary);
  cursor: pointer;
  border-radius: 4px;
}

.gr-recipient-custom-fields {
  margin-top: 18px;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--gr-bg-subtle);
  padding: 20px;
  border-radius: var(--gr-radius-lg);
  border: 1px solid #e2e8f0;
}

.gr-recipient-field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.gr-field-wrap {
  margin-bottom: 12px;
}

.gr-field-full {
  grid-column: span 2;
}

.gr-field-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--gr-radius-sm);
  outline: none;
  background: #ffffff;
  transition: all 0.2s ease;
  box-shadow: var(--gr-shadow-inner);
}

.gr-field-input:hover {
  border-color: #94a3b8;
}

.gr-field-input:focus {
  border-color: var(--gr-primary);
  box-shadow: 0 0 0 4px rgba(117, 73, 198, 0.15);
}

.gr-msg-char-counter-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.gr-char-counter {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

/* Card Logo Header */
.gr-card-logo-header {
  text-align: center;
  padding: 10px 10px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.gr-card-site-logo {
  max-height: 42px;
  max-width: 180px;
  object-fit: contain;
  display: inline-block;
}

.gr-card-site-name {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Card Current Date */
.gr-card-current-date {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
}

/* Page Container Wrapper */
.giftrocketsure-page-container {
  padding: 60px 20px;
  background: #f8fafc;
  min-height: 80vh;
}

.giftrocketsure-page-inner {
  max-width: 1100px;
  margin: 0 auto;
}

/* ==========================================================================
   Bottom Action Bar
   ========================================================================== */
.gr-bottom-action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.gr-quantity-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: var(--gr-radius-sm);
  overflow: hidden;
  background: #ffffff;
  height: 44px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  transition: border-color 0.2s ease;
}

.gr-quantity-stepper:focus-within {
  border-color: var(--gr-primary);
  box-shadow: 0 0 0 3px rgba(117, 73, 198, 0.15);
}

.gr-qty-btn {
  background: transparent;
  border: none;
  width: 40px;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0;
  font-size: 18px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.gr-qty-btn:hover {
  background-color: #f1f5f9;
  color: var(--gr-primary);
}

.gr-qty-input {
  width: 48px;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-left: 1px solid #e2e8f0 !important;
  border-right: 1px solid #e2e8f0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  outline: none;
  -moz-appearance: textfield;
}

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

.gr-add-to-cart-btn {
  background: linear-gradient(135deg, var(--gr-primary) 0%, #6136b0 100%);
  border: none;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 0 32px;
  border-radius: var(--gr-radius-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  box-shadow: 0 6px 16px rgba(117, 73, 198, 0.3);
}

.gr-add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(117, 73, 198, 0.4);
}

.gr-add-to-cart-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(117, 73, 198, 0.3);
}

.gr-add-to-cart-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Feedback message */
.gr-feedback-notice {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--gr-radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: none;
  animation: fadeIn 0.3s ease;
}

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

.gr-feedback-notice.is-success {
  display: block;
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.gr-feedback-notice.is-error {
  display: block;
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Spinner */
.gr-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: grSpin 0.7s linear infinite;
}

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

/* Custom Image Uploader Card */
.gr-custom-image-uploader-card {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--gr-bg-subtle);
  border: 2px dashed #cbd5e1;
  border-radius: var(--gr-radius-md);
  transition: all 0.25s ease;
}

.gr-custom-image-uploader-card:hover,
.gr-custom-image-uploader-card.is-dragover {
  border-color: var(--gr-primary);
  background: var(--gr-primary-light);
}

.gr-uploader-idle-state {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gr-uploader-icon {
  font-size: 28px;
  line-height: 1;
  opacity: 0.8;
}

.gr-uploader-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gr-uploader-text strong {
  font-size: 14px;
  color: #1e293b;
}

.gr-uploader-text span {
  font-size: 12px;
  color: #64748b;
}

.gr-btn-upload-trigger {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--gr-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.gr-btn-upload-trigger:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.gr-uploader-active-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gr-custom-image-thumb-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gr-custom-image-thumb-preview {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.gr-custom-image-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gr-custom-image-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gr-custom-image-badge {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  letter-spacing: 0.02em;
}

.gr-btn-remove-custom-image {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--gr-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gr-btn-remove-custom-image:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* Scheduled Delivery Wrap */
.gr-schedule-delivery-wrap {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
}

.gr-schedule-fields {
  margin-top: 12px;
  padding: 16px 20px;
  background: var(--gr-bg-subtle);
  border: 1px solid #e2e8f0;
  border-radius: var(--gr-radius-lg);
}

.gr-schedule-date-input {
  max-width: 280px;
}

.gr-field-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
}

/* Edit in Cart Link */
.gr-edit-cart-item-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gr-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.2s ease;
}

.gr-edit-cart-item-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 860px) {
  .gr-single-page-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .gr-card-preview-container {
    max-width: 460px;
    margin: 0 auto;
  }

  .gr-design-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .gr-design-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gr-recipient-custom-fields {
    grid-template-columns: 1fr;
  }

  .gr-field-full {
    grid-column: span 1;
  }

  .gr-bottom-action-bar {
    flex-wrap: wrap;
  }
}
