/* =========================================================
   GOLDBITES BUY PRECIOUS METALS PAGE
   ========================================================= */

:root {
    --buy-gold: #f5c542;
    --buy-gold-light: #ffe58a;
    --buy-green: #001d13;
    --buy-green-light: #003b27;
    --buy-text: #fff9e8;
}


/* Page */
.buy-page {
    min-height: 100vh;
    margin: 0;
    color: var(--buy-text);
    background:
        linear-gradient(
            rgba(0, 20, 13, 0.48),
            rgba(0, 20, 13, 0.58)
        ),
        url("/assets/homeback.jpg") center / cover fixed no-repeat;
    overflow-x: hidden;
}


/* Main wrapper */
.buy-main {
    width: 100%;
    min-height: calc(100vh - 75px);
    padding: 105px 20px 45px;
    box-sizing: border-box;
}


/* Heading */
.buy-heading-section {
    text-align: center;
    margin: 0 auto 30px;
}

.heading-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.heading-decoration span {
    display: block;
    width: 205px;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--buy-gold),
        transparent
    );
}

.heading-decoration img {
    width: 68px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(245, 197, 66, 0.6));
}

.buy-heading-section h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(36px, 4vw, 62px);
    font-weight: 700;
    color: #fff9df;
    line-height: 1.1;
}

.buy-heading-section p {
    margin: 12px 0 0;
    font-size: clamp(16px, 1.6vw, 23px);
    color: #fffbe9;
}


/* Main card */
.buy-card {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: 23px 30px 27px;
    box-sizing: border-box;

    background:
        linear-gradient(
            135deg,
            rgba(0, 34, 22, 0.93),
            rgba(0, 24, 16, 0.91)
        );

    border: 2px solid var(--buy-gold);
    border-radius: 17px;

    box-shadow:
        0 0 18px rgba(245, 197, 66, 0.16),
        inset 0 0 22px rgba(0, 0, 0, 0.3);
		}

/* Metal switch */
.metal-switch {
    width: min(720px, 100%);
    height: 59px;
    margin: 0 auto 21px;

    display: grid;
    grid-template-columns: repeat(2, 1fr);

    border: 2px solid #a88a2b;
    border-radius: 35px;
    overflow: hidden;
    background: rgba(0, 25, 17, 0.85);
}

.metal-option {
    border: none;
    background: transparent;
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;

    font-size: clamp(15px, 1.5vw, 21px);
    font-weight: 700;
    cursor: pointer;

    transition: 0.25s ease;
}

.metal-option img {
    width: 48px;
    height: 38px;
    object-fit: contain;
}

.metal-option.active {
    border: 2px solid var(--buy-gold);
    border-radius: 40px;
    color: #fff8d5;

    background:
        linear-gradient(
            90deg,
            rgba(104, 76, 5, 0.55),
            rgba(61, 49, 8, 0.45)
        );

    box-shadow:
        0 0 20px rgba(245, 197, 66, 0.5);
}


/* Rate information */
.rate-information {
    min-height: 86px;
    display: flex;
    align-items: center;
    gap: 18px;

    padding: 14px 21px;
    margin-bottom: 24px;

    border: 2px solid #a88a2b;
    border-radius: 22px;
    background: rgba(0, 39, 26, 0.68);
    box-sizing: border-box;
}

.rate-metal-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.rate-metal-image img {
    width: 68px;
    height: 68px;
    object-fit: contain;
}

.rate-details {
    flex: 1;
    min-width: 0;
}

.rate-details h2 {
    margin: 0 0 5px;
    font-size: clamp(16px, 1.5vw, 23px);
    font-weight: 600;
}

.rate-bottom-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 13px;
    font-size: clamp(14px, 1.3vw, 19px);
}

.rate-bottom-line strong {
    color: #ffd34f;
    font-size: clamp(20px, 2vw, 28px);
}

.rate-divider {
    width: 2px;
    height: 30px;
    background: var(--buy-gold);
}


/* Timer */
.rate-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-width: 145px;
    padding: 12px 18px;

    border: 2px solid #c79e28;
    border-radius: 30px;

    color: #fff6d2;
    font-size: 16px;
    font-weight: 700;
}

.timer-clock {
    color: var(--buy-gold);
    font-size: 25px;
}


/* Purchase mode */
.purchase-mode {
    display: flex;
    align-items: center;
    gap: 150px;
    margin: 0 0 25px 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}

.radio-option input {
    display: none;
}

.custom-radio {
    width: 25px;
    height: 25px;
    border: 3px solid #f5d34d;
    border-radius: 50%;
    position: relative;
    box-sizing: border-box;
}

.radio-option input:checked + .custom-radio::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--buy-gold);
}


/* Amount section */
.amount-section {
    margin: 0 20px;
}

.amount-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 700;
}

.amount-input-wrapper {
    height: 60px;
    display: flex;
    align-items: center;

    border: 2px solid var(--buy-gold);
    border-radius: 17px;
    background: rgba(0, 30, 20, 0.72);
    overflow: hidden;
}

.currency-symbol {
    padding-left: 20px;
    padding-right: 20px;
    color: var(--buy-gold);
    font-size: 23px;
    font-weight: 700;
}

.amount-input-wrapper input {
    flex: 1;
    min-width: 0;
    height: 100%;

    border: none;
    outline: none;
    background: transparent;
    color: white;

    font-size: 23px;
    font-weight: 500;
}

.amount-input-wrapper input::placeholder {
    color: #e8e8e8;
}

.input-arrows {
    padding-right: 20px;
    color: var(--buy-gold);
    font-size: 25px;
}


/* GST note */
.gst-note {
    margin: 10px 0 0;
    color: #dedbcf;
    font-size: 15px;
}


/* Minimum message */
.minimum-message {
    margin: 25px 20px;
    font-size: 17px;
    font-weight: 600;
}


/* Proceed button */
.proceed-buy-button {
    width: calc(100% - 40px);
    margin: 0 20px;

    height: 58px;
    border: none;
    border-radius: 35px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;

    background: linear-gradient(
        90deg,
        #e6b932,
        #ffe083,
        #e9b936
    );

    color: #080d08;
    font-size: clamp(17px, 1.6vw, 24px);
    font-weight: 800;

    cursor: pointer;
    transition: 0.25s ease;
}

.proceed-buy-button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 25px rgba(245, 197, 66, 0.55);
}

.button-arrow {
    font-size: 32px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 850px) {

    .buy-main {
        padding-top: 95px;
    }

    .buy-card {
        padding: 24px 22px 28px;
    }

    .purchase-mode {
        gap: 50px;
    }

    .rate-information {
        gap: 13px;
        padding: 15px;
    }

    .rate-timer {
        min-width: 125px;
        padding: 10px;
        font-size: 13px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .buy-main {
        padding: 90px 10px 30px;
    }

    .buy-heading-section {
		text-align: center;
		   margin: 0 auto 24px;
    }

    .heading-decoration {
        gap: 8px;
    }

    .heading-decoration span {
        width: 70px;
    }

    .heading-decoration img {
        width: 48px;
        height: 35px;
    }

    .buy-heading-section h1 {
        font-size: clamp(30px, 8vw, 42px);
    }

    .buy-heading-section p {
        font-size: 14px;
    }

    .buy-card {
        padding: 18px 12px 22px;
        border-radius: 15px;
    }

    .metal-switch {
        height: 53px;
        margin-bottom: 18px;
    }

    .metal-option {
        gap: 5px;
        font-size: 12px;
    }

    .metal-option img {
        width: 32px;
        height: 26px;
    }

    .rate-information {
        display: grid;
        grid-template-columns: 48px 1fr;
        gap: 8px;
        padding: 12px;
        border-radius: 17px;
    }

    .rate-metal-image {
        width: 48px;
        height: 48px;
        grid-row: span 2;
    }

    .rate-metal-image img {
        width: 48px;
        height: 48px;
    }

    .rate-details h2 {
        font-size: 14px;
    }

    .rate-bottom-line {
        gap: 7px;
        font-size: 12px;
    }

    .rate-bottom-line strong {
        font-size: 17px;
    }

    .rate-divider {
        height: 20px;
    }

    .rate-timer {
        grid-column: 2;
        justify-self: start;
        min-width: auto;
        padding: 6px 10px;
        font-size: 11px;
    }

    .timer-clock {
        font-size: 18px;
    }

    .purchase-mode {
        justify-content: space-between;
        gap: 8px;
        margin: 0 4px 20px;
    }

    .radio-option {
        gap: 6px;
        font-size: 12px;
    }

    .custom-radio {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }

    .radio-option input:checked + .custom-radio::after {
        inset: 4px;
    }

    .amount-section {
        margin: 0 4px;
    }

    .amount-section label {
        font-size: 14px;
    }

    .amount-input-wrapper {
        height: 52px;
        border-radius: 13px;
    }

    .currency-symbol {
        padding-left: 14px;
        padding-right: 12px;
        font-size: 19px;
    }

    .amount-input-wrapper input {
        font-size: 18px;
    }

    .input-arrows {
        padding-right: 12px;
        font-size: 20px;
    }

    .gst-note {
        font-size: 12px;
    }

    .minimum-message {
        margin: 20px 4px;
        font-size: 13px;
    }

    .proceed-buy-button {
        width: calc(100% - 8px);
        margin: 0 4px;
        height: 52px;
        font-size: 17px;
    }

    .button-arrow {
        font-size: 25px;
    }


}

/* =========================================================
   GRAM PURCHASE UI
   ========================================================= */

.popular-options {
    display: none;
    margin: 22px 20px 25px;
}

.popular-options.visible {
    display: block;
}

.popular-options h3 {
    margin: 0 0 14px;
    color: #fff8dd;
    font-size: 18px;
    font-weight: 700;
}

.popular-options-list {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.popular-options-list button {
    min-width: 72px;
    padding: 11px 18px;

    border: 1px solid var(--buy-gold);
    border-radius: 8px;

    background: rgba(0, 35, 23, 0.85);
    color: #fff9df;

    font-size: 15px;
    font-weight: 600;
    cursor: pointer;

    transition: all 0.25s ease;
}

.popular-options-list button:hover,
.popular-options-list button.active {
    background: linear-gradient(
        135deg,
        #dcae32,
        #ffe184
    );

    color: #07150d;
    box-shadow: 0 0 14px rgba(245, 197, 66, 0.45);
}


/* Gram mode styling */
.buy-card.gram-mode .amount-section label::after {
    content: "";
}

.buy-card.gram-mode #amountLabel {
    font-size: 0;
}

.buy-card.gram-mode #amountLabel::before {
    content: "Gram";
    font-size: 18px;
}

.buy-card.gram-mode .currency-symbol {
    font-size: 0;
    color: var(--buy-gold);
}

.buy-card.gram-mode .currency-symbol::after {
    content: "gm";
    font-size: 18px;
    font-weight: 700;
}

.buy-card.gram-mode .amount-input-wrapper input {
    font-size: 23px;
}

.buy-card.gram-mode .amount-input-wrapper input::placeholder {
    color: #fff;
}


/* Smaller card spacing */
.amount-section {
    margin: 0 20px;
}

.minimum-message {
    margin: 20px 20px;
}


@media (max-width: 600px) {

    .buy-card {
        width: calc(100% - 8px);
        padding: 17px 11px 21px;
        border-radius: 15px;
    }

    .popular-options {
        margin: 20px 4px 22px;
    }

    .popular-options h3 {
        font-size: 14px;
        margin-bottom: 11px;
    }

    .popular-options-list {
        gap: 7px;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .popular-options-list button {
        min-width: 0;
        flex: 1;
        padding: 9px 5px;
        font-size: 12px;
    }

    .buy-card.gram-mode #amountLabel::before {
        font-size: 14px;
    }

    .buy-card.gram-mode .currency-symbol::after {
        font-size: 15px;
    }
	.total-amount-row {
	        width: calc(100% - 8px);
	        margin: 15px 4px 18px;
	        padding: 11px 13px;
	        border-radius: 10px;
	    }

	    .total-amount-row span {
	        font-size: 13px;
	    }

	    .total-amount-row strong {
	        font-size: 17px;
	    }


}

/* =========================================================
   TOTAL AMOUNT
   ========================================================= */

.total-amount-row {
    width: calc(100% - 40px);
    margin: 18px 20px 22px;
    padding: 14px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border: 1px solid #b99732;
    border-radius: 12px;

    background: rgba(0, 43, 28, 0.72);
    box-sizing: border-box;
}

.total-amount-row span {
    color: #fff7d7;
    font-size: 17px;
    font-weight: 600;
}

.total-amount-row strong {
    color: var(--buy-gold);
    font-size: 22px;
    font-weight: 800;
}

/* =========================================================
   BUY PAGE FIXES
   Does not change .buy-card size
   ========================================================= */


/* Prevent page from moving horizontally */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.buy-page {
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}


/* Keep images inside their containers */
.buy-page img {
    max-width: 100%;
}


/* =========================================================
   AMOUNT INPUT AREA
   ========================================================= */

.amount-section {
    position: relative;
    width: 100%;
}

.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}


/* Main input */
.amount-input-wrapper input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
}


/* Currency symbol */
.currency-symbol {
    flex-shrink: 0;
}


/* Converted grams / rupees value */
.converted-value {
    display: block;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 10px;
    white-space: nowrap;
    text-align: right;
}


/* Remove browser number arrows */
.amount-input-wrapper input::-webkit-outer-spin-button,
.amount-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.amount-input-wrapper input[type="number"] {
    -moz-appearance: textfield;
}


/* =========================================================
   TOTAL AMOUNT ROW
   ========================================================= */

.total-amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.total-amount-row span {
    flex-shrink: 0;
}

.total-amount-row strong {
    margin-left: auto;
    white-space: nowrap;
    text-align: right;
}


/* =========================================================
   POPULAR OPTIONS
   ========================================================= */

.popular-options-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.popular-options-list button {
    flex-shrink: 0;
}


/* =========================================================
   PROCEED BUTTON
   ========================================================= */

.proceed-buy-button {
    max-width: 100%;
    box-sizing: border-box;
}


/* =========================================================
   TIMER
   ========================================================= */

.rate-timer {
    flex-shrink: 0;
    white-space: nowrap;
}


/* =========================================================
   MOBILE FIX
   ========================================================= */

@media (max-width: 600px) {

    .amount-input-wrapper {
        width: 100%;
    }

    .currency-symbol {
        flex-shrink: 0;
    }

    .amount-input-wrapper input {
        min-width: 0;
        font-size: 15px;
    }

    .converted-value {
        font-size: 11px;
        padding-left: 5px;
        padding-right: 7px;
    }

    .total-amount-row {
        gap: 8px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .total-amount-row span {
        font-size: 13px;
    }

    .total-amount-row strong {
        font-size: 17px;
    }

    .popular-options-list {
        flex-wrap: nowrap;
        width: 100%;
        gap: 5px;
    }

    .popular-options-list button {
        flex: 1;
        min-width: 0;
        padding-left: 4px;
        padding-right: 4px;
    }

}


/* =========================================================
   EXTRA SAFETY AGAINST HORIZONTAL OVERFLOW
   ========================================================= */

.buy-main,
.buy-heading-section,
.buy-card,
.rate-information,
.amount-section,
.total-amount-row,
.popular-options,
.purchase-mode {
    max-width: 100%;
}

/* =====================================================
   CUSTOM VALIDATION POPUP
   ===================================================== */

.validation-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

.validation-overlay.show {
    display: flex;
}

.validation-popup {
    width: min(390px, 100%);
    padding: 30px 25px 24px;

    text-align: center;

    border: 1px solid #f4c542;
    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            #063b25,
            #001c12
        );

    box-shadow:
        0 0 30px rgba(244, 197, 66, 0.22),
        inset 0 0 20px rgba(0, 0, 0, 0.25);

    animation: validationPopupIn 0.22s ease-out;
}

.validation-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 15px;

    border: 2px solid #f4c542;
    border-radius: 50%;

    color: #f4c542;
    font-size: 29px;
    font-weight: 800;
}

.validation-popup h3 {
    margin: 0 0 10px;

    color: #f4c542;
    font-size: 20px;
    font-weight: 700;
}

.validation-popup p {
    margin: 0 0 22px;

    color: #f4f0dc;
    font-size: 15px;
    line-height: 1.6;
}

.validation-popup button {
    width: 100%;
    height: 44px;

    border: 1px solid #f4c542;
    border-radius: 24px;

    background: #f4c542;
    color: #062d1d;

    font-size: 15px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.validation-popup button:hover {
    background: #ffe47a;
    transform: translateY(-1px);
}

@keyframes validationPopupIn {

    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }

}

@media (max-width: 600px) {

    .validation-popup {
        width: min(340px, 100%);
        padding: 25px 20px 20px;
    }

    .validation-popup h3 {
        font-size: 18px;
    }

    .validation-popup p {
        font-size: 14px;
    }

}

.buy-validation-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    visibility: hidden;
    z-index: 99999;
    transition: 0.25s ease;
}

.buy-validation-overlay.show {
    opacity: 1;
    visibility: visible;
}

.buy-validation-popup {
    width: min(90%, 380px);
    padding: 28px 24px;
    text-align: center;
    border: 1px solid #f4c542;
    border-radius: 14px;
    background: #062d20;
    box-shadow: 0 0 35px rgba(244, 197, 66, 0.25);
}

.buy-popup-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f4c542;
    color: #062d20;
    font-size: 25px;
    font-weight: 800;
}

.buy-validation-popup h3 {
    margin: 0 0 10px;
    color: #f4c542;
    font-size: 20px;
}

.buy-validation-popup p {
    margin: 0 0 22px;
    color: #ffffff;
    line-height: 1.6;
    font-size: 14px;
}

.buy-validation-popup button {
    min-width: 90px;
    padding: 10px 24px;
    border: 1px solid #f4c542;
    border-radius: 7px;
    background: #f4c542;
    color: #062d20;
    font-weight: 700;
    cursor: pointer;
}