/* --- Minimal “overlay modal” essentials (works even without Bootstrap CSS) --- */
#ppModal.modal {
    position: fixed;       /* overlay */
    top: 0; left: 0; right: 0; bottom: 0;
    display: none;         /* toggled by .show or inline style */
    overflow-x: hidden; 
    overflow-y: auto;
    z-index: 1055;         /* above site chrome */
    background: transparent;
  }

  #ppModal .modal-title {
    text-align: center;
  }
  
  #ppModal.show { display: block; } /* our controller adds .show */
  
  #ppModal .modal-dialog {
    position: relative;
    width: auto;
    max-width: 720px;
    margin: 1.75rem auto;  /* center */
    pointer-events: none;
  }
  
  #ppModal .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: .5rem;
    outline: 0;
    pointer-events: auto;
    padding: 0;
  }
  
  /* Backdrop the controller injects */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1050;
  }
  
  /* Make PayPal containers stretch nicely */
  #pp-buttons, #pp-applepay, #pp-googlepay { width: 100%; }
  
  /* Card Field shells behave like inputs; PayPal injects iframes */
  #pp-card-number, #pp-card-expiry, #pp-card-cvv {
    min-height: 42px; display: flex; align-items: center;
  }
  #pp-card-number iframe, #pp-card-expiry iframe, #pp-card-cvv iframe { width: 100%; }
  
  /* Ensure the modal behaves as an overlay even if theme CSS fights it */
#ppModal.modal {
    position: fixed; top:0; right:0; bottom:0; left:0;
    z-index: 1055; background: transparent;
  }
  #ppModal.show, #ppModal.in { display: block; } /* BS5 + BS3 */
  .modal-backdrop { z-index: 1050 !important; }
  
  /* Size/centering hints when Bootstrap 3 is missing/overridden */
  #ppModal .modal-dialog { margin: 30px auto; max-width: 720px; }
  
  /* Make PayPal containers stretch nicely */
  #pp-buttons, #pp-applepay, #pp-googlepay { width: 100%; }
  
  /* Card Fields shells look like inputs; PayPal injects iframes */
  #pp-card-number, #pp-card-expiry, #pp-card-cvv {
    min-height: 42px; display: flex; align-items: center;
  }
  #pp-card-number iframe, #pp-card-expiry iframe, #pp-card-cvv iframe { width: 100%; }


  #ppModal .paypal-button-container {
    border-radius: 5px;
    background-color: #FFFFFF;
    padding: 20px;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}
#ppModal .card_container {
    border-radius: 5px;
    background-color: #FFFFFF;
    padding: 20px;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}
#ppModal .card_field{
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 16px;
    resize: vertical;
    height:40px;
    background:white;
    font-size:17px;
    color:#3a3a3a;
    font-family:helvetica, tahoma, calibri, sans-serif;
}
#ppModal .card_field_50{
    width: 50%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 16px;
    resize: vertical;
    height:40px;
    background:white;
    font-size:17px;
    color:#3a3a3a;
    font-family:helvetica, tahoma, calibri, sans-serif;
}
#ppModal .card_field_75{
    width: 75%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 16px;
    resize: vertical;
    height:40px;
    background:white;
    font-size:17px;
    color:#3a3a3a;
    font-family:helvetica, tahoma, calibri, sans-serif;
}
#ppModal .row {
    display: -ms-flexbox; /* IE10 */
    display: flex;
    -ms-flex-wrap: wrap; /* IE10 */
    flex-wrap: wrap;
    margin: 0 -16px;
}
#ppModal .col-25 {
    -ms-flex: 25%; /* IE10 */
    flex: 25%;
}
#ppModal .col-50 {
    -ms-flex: 50%; /* IE10 */
    flex: 50%;
}
#ppModal input[type=text], select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 16px;
    resize: vertical;
    height:40px;
    background:white;
    font-size:17px;
    color:#3a3a3a;
    font-family:helvetica, tahoma, calibri, sans-serif;
}
#ppModal input[type=submit] {
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#ppModal .message_container {
    border-radius: 5px;
    background:#FFFFFF;
    font-size:13px;
    font-family:monospace;
    padding: 20px;
}
#ppModal #loading {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    position: fixed;
    display: block;
    opacity: 0.7;
    background-color: #fff;
    z-index: 99;
    text-align: center;
}
#ppModal #loading-image {
    position: absolute;
    z-index: 15;
    top: 50%;
    left: 50%;
    margin: -100px 0 0 -150px;
}
#ppModal .spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    margin-left: -50px; /* half width of the spinner gif */
    margin-top: -50px; /* half height of the spinner gif */
    text-align:center;
    z-index:1234;
    overflow: auto;
    width: 100px; /* width of the spinner gif */
    height: 102px; /* height of the spinner gif +2px to fix IE8 issue */
}
#ppModal .button_container {
    display: flex;
    justify-content: center;
}
#ppModal button:hover {
    background-color: powderblue;
}

#ppModal .btn_small{
    width:130px;
    height:39px;
    background:lightblue;
    border:1px dotted black;
    font-size:14px;
    color:#3a3a3a;
}
#ppModal .btn_small:hover {
    background-color: powderblue;
}

/* ================================
   PayPal modal – button styling
   Everything scoped to #ppModal
   ================================ */

   #ppModal {
    --pp-radius: 12px;
    --pp-shadow: 0 10px 24px rgba(0, 0, 0, .10);
    --pp-border: 1px solid #e5e7eb;          /* light gray */
    --pp-gap: 12px;
    --pp-muted: #6b7280;                      /* gray-500 */
    --pp-bg: #ffffff;
  }
  
  /* Container holding the PayPal Buttons iframe */
  #ppModal .paypal-button-container,
  #ppModal #pp-buttons {
    position: relative;
    margin: 12px 0 16px;
  }
  
  /* The SDK wraps the iframe in a <div data-pp-id="...">. Style that shell. */
  #ppModal #pp-buttons > div {
    border-radius: var(--pp-radius);
    box-shadow: var(--pp-shadow);
    border: var(--pp-border);
    background: var(--pp-bg);
    overflow: hidden;                         /* rounds the iframe corners */
    transition: box-shadow .2s ease, transform .2s ease;
  }
  
  #ppModal #pp-buttons > div:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0,0,0,.14);
  }
  
  /* The actual PayPal iframe (cannot style inside, but we can size the frame) */
  #ppModal #pp-buttons iframe {
    display: block;
    width: 100% !important;
    height: 56px !important;                  /* visual height, SDK caps to ~55px */
    border: 0;
    border-radius: var(--pp-radius);
  }
  
  /* Optional loading veil for when you toggle states */
  #ppModal .paypal-button-container.is-loading::after {
    content: "";
    position: absolute; inset: 0;
    background: rgba(255,255,255,.55);
    pointer-events: none;
  }
  
  /* --------------------------------
     “OR” Divider (between wallet & card)
     -------------------------------- */
  #ppModal #pp-or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 16px;
    user-select: none;
  }
  
  #ppModal #pp-or-divider::before,
  #ppModal #pp-or-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
  }
  
  #ppModal #pp-or-divider,
  #ppModal #pp-or-divider span,
  #ppModal #pp-or-divider div:nth-child(2) {
    font: 600 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: .02em;
    color: var(--pp-muted);
  }
  
  /* Subtle spacing harmonization for card section under the divider */
  #ppModal #pp-card-name,
  #ppModal #pp-card-number,
  #ppModal #pp-card-expiry,
  #ppModal #pp-card-cvv {
    margin-top: 12px;
  }
  
  #ppModal #card-field-submit-button,
  #ppModal #pp-card-pay {
    margin-top: 12px;
    height: 60px;
    color: #fff;
    background-color: #0551b5;
    border: #0551b5;
    border-radius: 1000px;
    cursor: pointer;
    display: block;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    width: 100%;
  }
  
  /* Keep the modal above theme UI */
  #ppModal.modal { z-index: 1055; }
  #ppModal + .modal-backdrop { z-index: 1050; }

  @media screen and (max-width: 767px) {
    .table-responsive>.table.price-summary>tbody tr td {
        white-space: normal;
    }

    .table-responsive>.table.price-summary>tbody tr td.price-total, .table-responsive>.table.price-summary>tbody tr td.price {
      white-space: nowrap;
  }
}
  