/**
 * Gift Card Checkout Component Styles
 *
 * Architecture: CSS @layer system with TAC (Tags, Attributes, Classes) convention.
 * Modeled directly on single-wash-checkout.css.
 *
 * @package Raindrop
 */

@layer components {
  :root {
    --theme-gc-blue:   oklch(58.5% 0.172 235.4); /* #028ebf - Soapy Cyan */
    --theme-gc-yellow: oklch(89.2% 0.198 96.5);  /* #fddd16 - Soapy Yellow */
    --theme-gc-navy:   oklch(24.5% 0.082 255.0); /* #0a2240 - Soapy Navy */
    --theme-gc-dark:   oklch(22.0% 0.015 260.0); /* #1a1a24 */
    --theme-gc-light:  oklch(97.5% 0.005 260.0); /* #f8f9fa */
    --theme-gc-border: oklch(88.0% 0.010 260.0); /* #e2e8f0 */
    --theme-gc-radius: clamp(0.75rem, 1.5vw, 1.25rem);
  }

  pint-gift-card-checkout {
    display: block;
    width: 100%;
    font-family: inherit;
    color: var(--theme-gc-dark);
    background: #ffffff;
    border-radius: var(--theme-gc-radius);
    overflow: hidden;
  }

  /* -------------------------------------------------------------
     1. Modal Header
     ------------------------------------------------------------- */
  pint-gift-card-checkout .gc-modal-header {
    padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 3vw, 2.25rem) 0;
    text-align: center;
    background: transparent;
  }

  pint-gift-card-checkout .gc-modal-title,
  pint-gift-card-checkout .gc-modal-header h1,
  pint-gift-card-checkout .gc-modal-header h2,
  pint-gift-card-checkout .gc-modal-header h3 {
    font-family: 'HouseSlant Regular', sans-serif !important;
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0;
    color: #003E6B !important;
    line-height: 1.1;
    margin: 0;
    text-align: center;
  }

  /* -------------------------------------------------------------
     2. Amount Selector (Custom Select Dropdown)
     ------------------------------------------------------------- */
  pint-gift-card-checkout .gc-amount-field-group {
    margin-block-end: 1.25rem;
  }

  pint-gift-card-checkout .gc-select-wrapper {
    position: relative;
    width: 100%;
  }

  pint-gift-card-checkout .gc-native-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--theme-gc-border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    background: #ffffff;
    color: var(--theme-gc-dark);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-inline-end: 2.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  pint-gift-card-checkout .gc-native-select:focus-visible {
    outline: none;
    border-color: var(--theme-gc-blue);
    box-shadow: 0 0 0 3px rgba(2, 142, 191, 0.15);
  }

  pint-gift-card-checkout .gc-select-wrapper:has(.gc-custom-select) .gc-native-select,
  pint-gift-card-checkout.js-enhanced .gc-native-select {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
  }

  pint-gift-card-checkout .gc-custom-select {
    position: relative;
    width: 100%;
    user-select: none;
  }

  pint-gift-card-checkout .gc-select-trigger {
    width: 100% !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.75rem 1rem !important;
    background: #ffffff !important;
    border: 2px solid var(--theme-gc-border) !important;
    border-radius: 0.5rem !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    color: var(--theme-gc-dark) !important;
    cursor: pointer !important;
    text-align: start !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  }

  pint-gift-card-checkout .gc-select-trigger:hover {
    border-color: #003E6B !important;
  }

  pint-gift-card-checkout .gc-select-trigger:focus-visible,
  pint-gift-card-checkout .gc-custom-select[data-open="true"] .gc-select-trigger {
    outline: none !important;
    border-color: var(--theme-gc-blue) !important;
    box-shadow: 0 0 0 3px rgba(2, 142, 191, 0.2) !important;
  }

  pint-gift-card-checkout .gc-select-trigger-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
  }


  pint-gift-card-checkout .gc-select-label {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
  }

  pint-gift-card-checkout .gc-select-name {
    font-weight: 700;
    color: #1e293b;
  }

  pint-gift-card-checkout .gc-select-price {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9em;
  }

  pint-gift-card-checkout .gc-select-chevron {
    flex-shrink: 0;
    color: #64748b;
    transition: transform 0.2s ease, color 0.15s ease;
    margin-inline-start: 0.5rem;
  }

  pint-gift-card-checkout .gc-custom-select[data-open="true"] .gc-select-chevron {
    transform: rotate(180deg);
    color: #003E6B;
  }

  pint-gift-card-checkout .gc-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--theme-gc-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    z-index: 50;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: gc-select-fade-in 0.15s ease-out;
  }

  pint-gift-card-checkout .gc-select-menu[hidden] {
    display: none;
  }

  @keyframes gc-select-fade-in {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  pint-gift-card-checkout .gc-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #1e293b;
    transition: background-color 0.15s ease, color 0.15s ease;
    outline: none;
  }

  pint-gift-card-checkout .gc-select-option:hover,
  pint-gift-card-checkout .gc-select-option:focus-visible,
  pint-gift-card-checkout .gc-select-option.focused {
    background: rgba(0, 0, 0, 0.04);
  }

  pint-gift-card-checkout .gc-select-option.selected {
    background: rgba(2, 142, 191, 0.1);
    font-weight: 700;
  }

  pint-gift-card-checkout .gc-option-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
  }


  pint-gift-card-checkout .gc-option-name {
    font-weight: 600;
    color: #1e293b;
  }

  pint-gift-card-checkout .gc-select-option.selected .gc-option-name {
    font-weight: 800;
    color: #0f172a;
  }

  pint-gift-card-checkout .gc-option-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  pint-gift-card-checkout .gc-option-price {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9em;
  }

  pint-gift-card-checkout .gc-select-option.selected .gc-option-price {
    font-weight: 800;
    color: #0f172a;
  }

  pint-gift-card-checkout .gc-option-check {
    opacity: 0;
    color: #003E6B;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
  }

  pint-gift-card-checkout .gc-select-option.selected .gc-option-check {
    opacity: 1;
  }

  /* -------------------------------------------------------------
     2b. Custom Amount Input Field (Modal Form)
     ------------------------------------------------------------- */
  pint-gift-card-checkout .gc-custom-amount-field-group {
    margin-block-start: 0.85rem;
    animation: gc-select-fade-in 0.15s ease-out;
  }

  pint-gift-card-checkout .gc-custom-amount-field-group[hidden] {
    display: none;
  }

  pint-gift-card-checkout .gc-custom-amount-input-box {
    display: flex;
    align-items: center;
    border: 2px solid var(--theme-gc-border);
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  pint-gift-card-checkout .gc-custom-amount-input-box:focus-within {
    border-color: var(--theme-gc-blue);
    box-shadow: 0 0 0 3px rgba(2, 142, 191, 0.15);
  }

  pint-gift-card-checkout .gc-currency-symbol {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--theme-gc-dark);
    margin-inline-end: 0.4rem;
  }

  pint-gift-card-checkout .gc-custom-amount-input {
    border: none;
    outline: none;
    width: 100%;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--theme-gc-dark);
    background: transparent;
    padding: 0;
    -moz-appearance: textfield;
  }

  pint-gift-card-checkout .gc-custom-amount-input::-webkit-outer-spin-button,
  pint-gift-card-checkout .gc-custom-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  /* -------------------------------------------------------------
     3. Form Wrapper & Fields
     ------------------------------------------------------------- */
  pint-gift-card-checkout .gc-form-wrapper {
    padding: clamp(1.25rem, 3vw, 2.25rem);
    background: #ffffff;
  }

  pint-gift-card-checkout .gc-fieldset {
    border: none;
    margin: 0;
    padding: 0;
  }

  pint-gift-card-checkout .gc-fieldset + .gc-fieldset,
  pint-gift-card-checkout .gc-contact-fieldset,
  pint-gift-card-checkout .gc-recipient-fieldset,
  pint-gift-card-checkout .gc-payment-fieldset {
    margin-block-start: 1.75rem !important;
  }

  pint-gift-card-checkout .gc-legend {
    font-size: 1rem;
    font-weight: 800;
    color: var(--theme-gc-dark);
    margin-block-end: 0.75rem;
    padding: 0;
  }

  pint-gift-card-checkout .gc-field-group {
    margin-block-end: 1rem;
  }

  pint-gift-card-checkout .gc-field-group label {
    display: block;
    margin-block-end: 0.35rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: #334155;
  }

  pint-gift-card-checkout .gc-field-group label .required {
    color: #e11d48;
  }

  pint-gift-card-checkout .gc-field-group input[type="text"],
  pint-gift-card-checkout .gc-field-group input[type="email"],
  pint-gift-card-checkout .gc-field-group input[type="tel"],
  pint-gift-card-checkout .gc-field-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--theme-gc-border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: #ffffff;
    color: var(--theme-gc-dark);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  pint-gift-card-checkout .gc-field-group input:focus-visible,
  pint-gift-card-checkout .gc-field-group textarea:focus-visible {
    outline: none;
    border-color: var(--theme-gc-blue);
    box-shadow: 0 0 0 3px rgba(2, 142, 191, 0.15);
  }

  pint-gift-card-checkout .gc-field-group input[aria-invalid="true"] {
    border-color: #f87171;
    background: #fff5f5;
  }

  /* Location Selector */
  pint-gift-card-checkout .gc-location-field-group {
    margin-block-end: 1.25rem;
  }

  pint-gift-card-checkout .gc-location-select-wrapper {
    position: relative;
    width: 100%;
  }

  pint-gift-card-checkout .gc-geo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-block-start: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid #bfdbfe;
  }

  pint-gift-card-checkout .gc-geo-icon {
    flex-shrink: 0;
    color: #2563eb;
  }

  /* Recipient Details */
  pint-gift-card-checkout .gc-recipient-toggle-group {
    margin-block-end: 0.75rem;
  }

  pint-gift-card-checkout .gc-recipient-toggle-text {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
  }

  pint-gift-card-checkout .gc-recipient-fields {
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--theme-gc-border);
    border-radius: 0.625rem;
    margin-block-start: 0.5rem;
    margin-block-end: 0.5rem;
  }

  /* -------------------------------------------------------------
     4. Stripe Payment Element Styling
     ------------------------------------------------------------- */
  pint-gift-card-checkout .gc-stripe-container {
    padding: 1rem;
    border: 2px solid var(--theme-gc-border);
    border-radius: 0.625rem;
    background: #ffffff;
    min-height: 48px;
  }

  pint-gift-card-checkout .gc-stripe-placeholder {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #64748b;
    font-size: 0.9rem;
  }

  pint-gift-card-checkout .gc-stripe-error {
    margin-block-start: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 0.375rem;
    color: #991b1b;
    font-size: 0.85rem;
  }

  /* -------------------------------------------------------------
     5. Checkboxes & Agreements
     ------------------------------------------------------------- */
  pint-gift-card-checkout .gc-checkbox-group {
    margin-block: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
  }

  pint-gift-card-checkout .gc-consent-group {
    margin-block-end: 0;
  }

  pint-gift-card-checkout .gc-sms-consent-group {
    margin-block-start: 0.25rem;
  }

  pint-gift-card-checkout .gc-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-block-end: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #172121;
    cursor: pointer;
  }

  pint-gift-card-checkout .gc-checkbox-label input[type="checkbox"] {
    margin-block-start: 0.25rem;
    accent-color: var(--theme-gc-navy, #003E6B);
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    cursor: pointer;
  }

  pint-gift-card-checkout .gc-checkbox-label span {
    font-size: 1rem;
    line-height: 1.5;
    color: #172121;
  }

  pint-gift-card-checkout .gc-consent-text {
    font-size: 1rem;
    color: #172121;
    font-weight: 400;
    line-height: 1.5;
  }

  pint-gift-card-checkout .gc-checkbox-label a,
  pint-gift-card-checkout .gc-checkbox-label span a,
  pint-gift-card-checkout .gc-consent-text a {
    color: var(--theme-gc-navy, #003E6B);
    text-decoration: underline !important;
  }

  pint-gift-card-checkout .gc-checkbox-label a:hover,
  pint-gift-card-checkout .gc-checkbox-label span a:hover,
  pint-gift-card-checkout .gc-consent-text a:hover {
    text-decoration: underline !important;
    opacity: 0.85;
  }

  /* -------------------------------------------------------------
     5b. Turnstile Security
     ------------------------------------------------------------- */
  pint-gift-card-checkout .gc-turnstile-container,
  pint-gift-card-checkout .pint-turnstile-container {
    display: flex;
    justify-content: center;
    margin-block: 0.75rem 1rem;
    min-height: 65px;
  }

  /* -------------------------------------------------------------
     6. Submit Button
     ------------------------------------------------------------- */
  pint-gift-card-checkout .gc-btn-submit {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 52px !important;
    padding: 0.95rem 2rem !important;
    font-family: inherit !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    border: none !important;
    border-radius: 9999px !important;
    cursor: pointer !important;
    color: #ffffff !important;
    background: var(--theme-gc-blue, #028ebf) !important;
    box-shadow: 0 4px 14px rgba(2, 142, 191, 0.3) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background-color 0.15s ease !important;
  }

  pint-gift-card-checkout .gc-btn-submit:hover {
    background: #0277a0 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(2, 142, 191, 0.4) !important;
  }

  pint-gift-card-checkout .gc-btn-submit:active {
    transform: translateY(0) !important;
  }

  pint-gift-card-checkout .gc-btn-submit:focus-visible {
    outline: 3px solid var(--theme-gc-yellow) !important;
    outline-offset: 3px !important;
  }

  pint-gift-card-checkout .gc-btn-submit:disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    transform: none !important;
  }

  pint-gift-card-checkout .gc-btn-submit [data-jsref="btn-text"] {
    display: inline-block !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 1.1rem !important;
  }

  pint-gift-card-checkout .gc-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: gc-spin 0.8s linear infinite;
    margin-inline-start: 0.5rem;
  }

  pint-gift-card-checkout .gc-spinner-small {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    border-top-color: var(--theme-gc-dark);
    animation: gc-spin 0.8s linear infinite;
  }

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

  pint-gift-card-checkout .gc-alert {
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    margin-block-end: 1.25rem;
    font-size: 0.9rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
  }

  /* -------------------------------------------------------------
     7. Success State
     ------------------------------------------------------------- */
  pint-gift-card-checkout .gc-success-state {
    text-align: center;
    padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2.25rem);
    background: #ffffff;
  }

  pint-gift-card-checkout .gc-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    margin-block-end: 1rem;
  }

  pint-gift-card-checkout .gc-success-title {
    margin-block: 0 0.35rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
    color: var(--theme-gc-dark);
  }

  pint-gift-card-checkout .gc-success-subtitle {
    margin-block: 0 1.5rem;
    color: #64748b;
    font-size: 1rem;
  }

  pint-gift-card-checkout .gc-receipt-card {
    background: var(--theme-gc-light);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    max-width: 440px;
    margin-inline: auto;
    margin-block-end: 1.25rem;
    border: 1px solid var(--theme-gc-border);
  }

  pint-gift-card-checkout .gc-receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block: 0.375rem;
    font-size: 0.95rem;
    color: #475569;
  }

  pint-gift-card-checkout .gc-receipt-price {
    font-size: 1.15rem;
    font-weight: 900;
    color: #16a34a;
  }

  pint-gift-card-checkout .gc-receipt-notice {
    font-size: 0.9rem;
    color: #475569;
    max-width: 440px;
    margin-inline: auto;
    margin-block-end: 1.75rem;
    line-height: 1.5;
  }

  pint-gift-card-checkout .gc-success-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  pint-gift-card-checkout .gc-action-btn-location {
    padding: 0.875rem 1.75rem;
    border-radius: 9999px;
    font-weight: 800;
    background: var(--theme-gc-yellow);
    color: var(--theme-gc-dark);
    border: none;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(253, 221, 22, 0.35);
  }

  pint-gift-card-checkout .gc-action-btn-location:hover {
    transform: translateY(-2px);
    color: var(--theme-gc-dark);
  }

  pint-gift-card-checkout .gc-action-btn-close {
    padding: 0.875rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
  }
}
