/* =======================================================
   1) TOP GRAPHIC ADJUSTMENT (MOBILE ONLY)
   ======================================================= */
@media screen and (max-width: 800px) {

    .shoptopgraphic img {
        margin-top:-210px;
    }

    #page .cart-title{
        margin-bottom: 4px;
    }
}

/* =======================================================
   2) BACK BUTTON (MOBILE ONLY)
   ======================================================= */
#back2cart {
    display: none;
}

@media screen and (max-width: 800px) {
    #back2cart {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 7px;
        right: 8px;
        width: 32px;
        height: 32px;
        background-color: var(--Background_Dark);
        color: var(--Background_Light);
        border: none;
        border-radius: 4px;
        font-family: var(--nav_font_fam);
        font-size: 0.8em;
        font-weight: bold;
        text-decoration: none;
        z-index: 1000;
        box-sizing: border-box;
    }

   a#back2cart {
        background-image: none;
        padding-bottom: 0;
    }
    #back2cart:hover {
        background-color: var(--Button_Hover);
        color: var(--Background_Dark);
    }
}

/* =======================================================
   3) FORM, FIELDSET & CRISP CONTRAST FIELD LABELS
   ======================================================= */
.shoppagecontent {
    min-width: 685px;
}

   #checkout-form {
    margin-left: 0;
    width: 100%;
    min-width: 640px;
}

.checkout-step-box {
    border: 2px solid var(--Background_Dark);
    padding: 15px;
    margin-bottom: 20px;
    background-color: transparent;
    box-sizing: border-box;
}

#cart-container{
    min-width: 640px;
}

#checkout-form legend,
.checkout-step-box legend {
    font-size: 1.1em;
    color: var(--Background_Dark);
    font-family: var(--text_font_fam);
    font-weight: bold;
    padding: 0 8px;
}

#checkout-form label {
    color: var(--Background_Dark);
    font-family: var(--text_font_fam);
    font-size: 0.95em;
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
}

#checkout-form input[type="text"],
#checkout-form input[type="email"],
#checkout-form input[type="tel"],
#checkout-form select {
    background-color: color-mix(in srgb, var(--Background_Light), white 60%);
    border: 2px solid var(--Background_Dark);
    border-radius: 8px;
    color: var(--Background_Dark);
    width: 100%;
    padding: 6px;
    font-family: var(--text_font_fam);
    font-size: 0.95em;
    box-sizing: border-box;
    -webkit-appearance: none; 
    -moz-appearance: none;
}

#checkout-form input:-webkit-autofill,
#checkout-form input:-webkit-autofill:hover,
#checkout-form input:-webkit-autofill:focus,
#checkout-form select:-webkit-autofill {
  /* Fills the background with your dark background variable */
  -webkit-box-shadow: 0 0 0 1000px var(--Background_Light) inset !important;
  box-shadow: 0 0 0 1000px var(--Background_Light), white 60% inset !important;
  
  /* Overrides the autofill text color */
  -webkit-text-fill-color: var(--Background_Dark) !important;
  
  /* Prevents the background color from flashing back */
  transition: background-color 5000s ease-in-out 0s;
}

#billing-section {
    display: none;
    border: 2px solid var(--Background_Dark);
    padding: 15px;
    margin-top: 0.3em;
    margin-bottom: 20px;
    background-color: transparent;
    box-sizing: border-box;
    background-color: #f2ebd8;
}

.bill-the-legend {
    font-size: 1.1em;
    color: var(--Background_Dark);
    font-family: var(--text_font_fam);
    font-weight: bold;
    padding: 0 8px;
}

.billing-radio-group input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--Background_Dark);
    border-radius: 50%;
    outline: none;
    background-color: color-mix(in srgb, var(--Background_Light), white 60%);
    cursor: url(/11-resources/02-images/Cursor_Cl.png), auto;
    position: relative;
    top: 1px;
    margin: 0;
    flex-shrink: 0;
}

/* Radio button hover */
.billing-radio-group input[type="radio"]:hover {
    border-color: var(--Shop_Accent);
}

/* Radio button checked state (custom dot & accent border) */
.billing-radio-group input[type="radio"]:checked {
    border-color: #D16AF3;
    background-color: var(--Shop_Butt_Back_Hover);
}

.billing-radio-group input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 6px;
    height: 6px;
    background-color: var(--Shop_Accent); /* Uses your bright shop accent green */
    border-radius: 50%;
}

.form-group {
    margin-bottom: 12px;
}


.shipping-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;
    gap: 0 20px;
    
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23393939' stroke-width='3' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
    padding-right: 36px !important;
    cursor: url(/11-resources/02-images/Cursor_Cl.png), auto;
    border-radius: 8px;
}

#shipping-summary-text,
#shipping-summary-text strong,
#shipping-summary-text em,
#shipping-summary-text span {
    text-transform: none !important;
}

#shipping-summary-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; 
    width: 100%;
    gap: 0.8empx;
}

#shipping-summary-text {
    flex-grow: 1;
}

#btn-edit-shipping {
    margin-left: auto;
    flex-shrink: 0;
}

/* Mobile: Single Column natural top-to-bottom DOM flow */
@media screen and (max-width: 800px) {
    .shipping-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-auto-flow: row;
        gap: 0;
    }

    select {
        background-position: right 10px center;
        background-size: 16px 16px;
    }

    #cart-container{
        min-width: 200px;
    }

    #checkout-form {
        margin-left: 0;
        width: 100%;
        min-width: 200px;
    }

    .shoppagecontent {
        min-width: 200px;
    }
}

/* =======================================================
   4) COST BREAKDOWN TABLE & BUTTON STYLING
   ======================================================= */
.expenditure-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.expenditure-wrapper .comments-group {
    width: 90%; /* Or 100% if you want it to match the 420px edge perfectly */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.expenditure-wrapper #order-comments {
    width: 100%;
    box-sizing: border-box;
}

.HeathLedger {
    width: 100%;
    margin-bottom: 15px;
    font-family: var(--text_font_fam);
    color: var(--Background_Dark);
}

.HeathLedger .ledger-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 4px 0;
    width: 100%;
}

.HeathLedger .ledger-label-wrap {
    display: flex;
    flex-grow: 1;
    align-items: flex-end;
    margin-right: 8px;
    overflow: hidden;
}

.HeathLedger .ledger-dots {
    flex-grow: 1;
    border-bottom: 2px dotted #633a63;
    margin-left: 6px;
    margin-bottom: 3px;
}

.HeathLedger .ledger-val {
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}

.HeathLedger .ledger-row.total-row {
    border-top: 2px solid var(--Background_Dark);
    padding-top: 8px;
    margin-top: 4px;
    font-size: 1.1em;
}

.shipping-rates-header {
    font-family: var(--text_font_fam);
    font-weight: bold;
    color: var(--Background_Dark);
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Payment Section Inputs (Card Box, Comments & Button) */
.payment-box-wrapper {
    margin-top: 0;
    margin-bottom: 15px;
    margin-right: 5%;
    text-align: left;
    width: 90%;
    box-sizing: border-box;
}

.payment-title {
    font-family: var(--text_font_fam);
    font-weight: bold;
    color: var(--Background_Dark);
    margin-bottom: 6px;
    display: block;
}

#stripe-card-box {
    border: 2px solid var(--Background_Dark, #2b261f);
    padding: 6px;
    background-color: color-mix(in srgb, var(--Background_Light), white 60%);
    border-radius: 8px;
    box-sizing: border-box;
}

#stripe-payment-container {
    margin-top: 20px;
    padding: 15px;
    border: 2px dashed var(--Background_Dark);
    border-radius: 6px;
}

#payment-element {
    min-height: 0;   /* Removes forced height constraint */
    background-color: var(--Shop_Accent);
    border: none;    /* Removes duplicate inner border */
    border-radius: 4px;
    padding: 4%;
    margin-top: 0;
    
    width: 100%;
    box-sizing: border-box;
    font-family: var(--text_font_fam);
    background-image: url('/11-resources/04-Nonsense/hyperspaceos.gif');
    background-size: cover;
}

/* Force inner iframe form elements to compact monospace style */
.StripeElement {
  background-color: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
}

.comments-group {
    margin-top: 0px;
    margin-bottom: 15px;
    text-align: left;
}

.comments-group label {
    font-family: var(--text_font_fam);
    font-weight: bold;
    color: var(--Background_Dark);
    display: block;
    margin-bottom: 6px;
}

#order-comments {
    width: 100%;
    background-color: color-mix(in srgb, var(--Background_Light), white 60%);
    border: 2px solid var(--Background_Dark);
    border-radius: 8px;
    color: var(--Background_Dark);
    padding: 8px;
    font-family: var(--text_font_fam);
    font-size: 0.95em;
    box-sizing: border-box;
    resize: vertical;
}

.submit-btn-wrapper,
#checkout-area {
    text-align: right;
    margin-top: 15px;
}

.submit-btn-wrapper
{
    margin-right: 5%;;
}

#submit-payment-btn,
#calc-shipping-btn,
#checkout-submit-btn,
#btn-edit-shipping,
#pay-now-btn {
    display: inline-block;
    background: var(--Background_Dark, #333);
    color: var(--Background_Light, #fff);
    padding: 8px 24px;
    border-radius: 8px;
    border: none;
    cursor: url(/11-resources/02-images/Cursor_Cl.png), auto;
    font-family: var(--nav_font_fam);
    font-size: 1.1em;
}



#calc-shipping-btn .calculating-dots {
    display: inline-block;
    width: 2ch; /* Reserves exact horizontal space for up to 3 dots */
    text-align: left;
    font-family: monospace; /* Monospace keeps character widths identical */
    font-style: italic;
}

#btn-edit-shipping{
height: 80%;
}

#submit-payment-btn:hover,
#calc-shipping-btn:hover,
#checkout-submit-btn:hover,
#btn-edit-shipping:hover,
#pay-now-btn:hover {
    background-color: var(--Button_Hover);
    color: var(--Background_Dark);
}

#submit-payment-btn:active,
#btn-edit-shipping:active,
#calc-shipping-btn:active {
    font-style: italic;
}

/*disabled AND calculating sate*/
#calc-shipping-btn:disabled {
    background-color: var(--Background_Dark);
    color: var(--Background_Light);
    cursor: wait;
    opacity: 0.7;
    border: 2px solid #999022;
}


/* Desktop Width Alignment for Payment Stack */
@media screen and (min-width: 801px) {
    .order-summary-box,
    .expenditure-wrapper {
        max-width: 420px;
        margin-left: auto;
        width: 100%;
    }
}

/*<--------------- Mobile resizer payment --------------------->*/

@media screen and (max-width: 800px) {
    .payment-box-wrapper {
        margin-left: auto;
        margin-right: auto;
        text-align: left;
        width: 90%;
        box-sizing: border-box;
    }
}

/* =======================================================
   5) DESKTOP WIDTH ADJUSTMENTS (ORDER SUMMARY & SUBTOTAL)
   ======================================================= */
@media screen and (min-width: 801px) {
    .order-summary-box {
        max-width: 420px;
        margin-left: auto;
    }

    .expenditure-wrapper {
        max-width: 420px;
        margin-left: auto;
    }
}

/* =======================================================
   6) STATE ERROR MODAL STYLES (MOBILE & DESKTOP)
   ======================================================= */
.err-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 15px;
    box-sizing: border-box;
}

.err-modal-box {
    position: relative;
    background-color: var(--Background_Light, #fbf7da);
    border: 3px solid var(--Background_Dark, #333);
    padding: 20px;
    max-width: 400px;
    width: 100%;
    box-shadow: 6px 6px 0px var(--Background_Dark, #333);
    font-family: var(--text_font_fam);
    color: var(--Background_Dark, #333);
    box-sizing: border-box;
    text-align: center;
}

.modal-close-btn {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em;
    font-weight: bold;
    cursor: url(/11-resources/02-images/Cursor_Cl.png), auto;
    color: var(--Background_Dark);
}

.modal-title {
    margin-top: 10;
    font-family: var(--nav_font_fam);
    font-size: 1.2em;
    color: #8b0000;
}

.modal-body {
    margin: 15px 0;
    font-size: 0.95em;
    line-height: 1.4;
}

.modal-ok-btn {
    background: var(--Background_Dark, #333);
    color: var(--Background_Light, #fff);
    border: none;
    padding: 6px 18px;
    font-family: var(--nav_font_fam);
    font-size: 0.9em;
    cursor: url(/11-resources/02-images/Cursor_Cl.png), auto;
    border-radius: 4px;
}

.modal-ok-btn:hover {
    background-color: var(--Button_Hover);
    color: var(--Background_Dark);
}

/* =======================================================
   CUSTOM SHIPPING OPTIONS STYLING
   ======================================================= */
.shipping-ledger-row {
    margin-bottom: 6px;
    font-family: var(--text_font_fam);
    transition: color 0.2s ease, font-weight 0.2s ease;
}

/* Unselected state: Normal weight, gray text, gray dots */
.shipping-ledger-row.is-unselected {
    color: #7a7569; /* Muted vintage gray */
}

.shipping-ledger-row.is-unselected .ledger-dots {
    border-bottom: 2px dotted #a8a293 !important;
}

.shipping-ledger-row.is-unselected label {
    font-weight: normal !important;
}

/* Selected state: Dark/Bold text, standard dark dots */
.shipping-ledger-row.is-selected {
    color: var(--Background_Dark);
    font-weight: bold;
}

.shipping-ledger-row.is-selected label {
    font-weight: bold !important;
}

.shipping-ledger-row.is-selected .ledger-dots {
    border-bottom: 2px dotted #633a63 !important;
}

/* Custom Radio Button Styling */
.shipping-ledger-row input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--Background_Dark);
    border-radius: 50%;
    outline: none;
    background-color: color-mix(in srgb, var(--Background_Light), white 40%);
    cursor: url(/11-resources/02-images/Cursor_Cl.png), auto;
    position: relative;
    top: 1px;
    margin: 0;
    flex-shrink: 0;
}

/* Radio button hover */
.shipping-ledger-row input[type="radio"]:hover {
    border-color: var(--Shop_Accent);
}

/* Radio button checked state (custom dot & accent border) */
.shipping-ledger-row input[type="radio"]:checked {
     border-color: #D16AF3;
    background-color: var(--Shop_Butt_Back_Hover);
}

.shipping-ledger-row input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 6px;
    height: 6px;
    background-color: var(--Shop_Accent);
    border-radius: 50%;
}

p.backsies{
    font-style: italic;
    font-color: var(--Background_Dark);
    opacity: 80%;
    text-justify: right;
    margin-right: 0;
}

/* =======================================================
   MISC STUFF
   ======================================================= */

      .cart-widget {
        top: 46px;        /* Adjust vertical alignment relative to upper edge of #page */
        left: 250px;       /* Clears previous left offset */
       
    }

    /* Renable clicking on the checkout page */
    .cart-widget .cart-click-overlay,
    .cart-widget .hitbox-beam-stationary,
    .cart-widget .hitbox-ship-moving::before,
    .cart-widget .hitbox-ship-moving::after {
    pointer-events: auto !important;
    cursor: url(/11-resources/02-images/Cursor_Cl.png), auto !important;
    }

    @media screen and (max-width: 800px) {
    /* Hide cart widget on mobile checkout */
    #cart-widget {
        display: none !important;
    }

    .shoptopgraphic img {
        margin-top: -210px;
    }

    #page .cart-title {
        margin-bottom: 4px;
    }

 
}