/* =========================
   Gold Calculator
========================= */

.gold-calculator {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;

    background: #ffffff;

    border: 1px solid #e6e9ef;
    border-radius: 16px;

    box-shadow: 0 8px 30px rgba(11, 31, 58, 0.08);

    direction: rtl;
    font-family: inherit;
}


/* عنوان */

.gold-calculator-title {
    margin-bottom: 20px;

    color: #0B1F3A;

    font-size: 22px;
    font-weight: 700;

    text-align: center;
}


/* =========================
   Buy / Sell
========================= */

.gold-calculator-mode {
    display: flex;

    width: 100%;
    margin-bottom: 22px;

    padding: 4px;

    background: #f4f6f9;

    border-radius: 10px;
}

.gold-mode-btn {
    flex: 1;

    border: 0;
    border-radius: 8px;

    padding: 10px;

    background: transparent;

    color: #666666;

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition: all 0.2s ease;
}

.gold-mode-btn.active {
    background: #0B1F3A;

    color: #ffffff;

    box-shadow: 0 3px 8px rgba(11, 31, 58, 0.18);
}


/* =========================
   Fields
========================= */

.gold-calculator-field {
    margin-bottom: 18px;
}

.gold-calculator-field label {
    display: block;

    margin-bottom: 7px;

    color: #0B1F3A;

    font-size: 13px;
    font-weight: 600;
}


/* ورودی‌ها */

.gold-calculator-field input,
.gold-calculator-field select {

    width: 100%;
    height: 44px;

    box-sizing: border-box;

    border: 1px solid #dfe3e8;
    border-radius: 8px;

    background: #ffffff;

    color: #0B1F3A;

    font-family: inherit;
    font-size: 14px;

    outline: none;

    transition: border-color 0.2s ease,
                box-shadow 0.2s ease;
}

.gold-calculator-field input {
    padding: 0 12px;
}

.gold-calculator-field select {
    padding: 0 10px;
}

.gold-calculator-field input:focus,
.gold-calculator-field select:focus {

    border-color: #D4AF37;

    box-shadow:
        0 0 0 3px rgba(212, 175, 55, 0.12);
}

/* =========================
   Price Input
========================= */

.gold-price-input {
    display: flex;
    align-items: center;

    width: 100%;
    height: 44px;

    box-sizing: border-box;

    border: 1px solid #dfe3e8;
    border-radius: 8px;

    background: #ffffff;

    overflow: hidden;
}

.gold-price-input input#gold-price {
    flex: 1;

    width: auto !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 12px !important;

    border: none !important;
    border-radius: 0 !important;

    background: transparent !important;

    color: #0B1F3A;

    outline: none !important;
    box-shadow: none !important;

    box-sizing: border-box;
}

.gold-price-unit {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 100%;
    width: 115px;

    color: #666666;
    font-size: 13px;
    font-weight: 400;

    white-space: nowrap;

    border-right: 1px solid #dfe3e8;

    box-sizing: border-box;
}

/* =========================
   Weight
========================= */

.gold-weight-input {
    display: flex;

    gap: 8px;
}

.gold-weight-input input {
    flex: 1;
}

.gold-weight-input select {
    width: 115px;
}

/* =========================
   Equivalent Units
========================= */

.gold-equivalent {
    margin-top: -6px;
    margin-bottom: 18px;
}

.gold-equivalent-toggle {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;

    padding: 10px 4px;

    border: none;
    background: transparent;

    color: #0B1F3A;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.gold-equivalent-arrow {
    font-size: 10px;

    transition: transform 0.2s ease;
}

.gold-equivalent-content {
    display: none;

    padding: 4px 8px 8px;

    background: #f8f9fb;

    border-radius: 8px;
}

.gold-equivalent-content.open {
    display: block;
}

.gold-equivalent-row {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 7px 4px;

    color: #666666;

    font-size: 12px;

    border-bottom: 1px solid #edf0f3;
}

.gold-equivalent-row:last-child {
    border-bottom: none;
}

.gold-equivalent-row strong {
    color: #0B1F3A;

    font-size: 12px;
    font-weight: 600;
}

.gold-equivalent-empty {
    padding: 8px 4px;

    color: #888888;

    font-size: 12px;

    text-align: center;
}


/* =========================
   Reference Price
========================= */

.gold-reference-price {

    margin-top: 8px;
    margin-bottom: 18px;

    padding: 14px;

    background: #f8f9fb;

    border-radius: 10px;

    text-align: center;
}

.gold-reference-price span {

    display: block;

    margin-bottom: 5px;

    color: #666666;

    font-size: 12px;
}

.gold-reference-price strong {

    display: block;

    color: #0B1F3A;

    font-size: 17px;
    font-weight: 700;
}


/* =========================
   Results
========================= */

/* =========================
   نحوه محاسبه
========================= */

.gold-calculation-details {
    margin-top: 18px;
    border-top: 1px solid #edf0f3;
    padding-top: 8px;
}


/* دکمه نحوه محاسبه */

.gold-calculation-toggle {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 4px;

    border: none;
    background: transparent;

    color: #0B1F3A;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}


/* فلش */

.gold-calculation-arrow {
    font-size: 10px;

    transition: transform 0.25s ease;
}


/* وقتی باز است */

.gold-calculation-toggle.active
.gold-calculation-arrow {
    transform: rotate(180deg);
}


/* محتوای محاسبه */

.gold-calculation-content {
    display: none;

    padding: 4px 4px 8px;
}


/* وقتی باز است */

.gold-calculation-content.active {
    display: block;
}


/* ردیف‌ها */

.gold-calculation-content p {
    margin: 0;
    padding: 8px 4px 12px;

    color: #666666;

    font-size: 12px;
    font-weight: 400;

    line-height: 1.8;

    text-align: right;
}


/* =========================
   دکمه خرید طلا
========================= */

.gold-buy-button {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 20px auto 0;
    
    height: 48px;

    border: none;
    border-radius: 10px;

    background: #0B1F3A;
    color: #ffffff;

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;

    box-shadow:
        0 4px 12px rgba(11, 31, 58, 0.15);
}


.gold-buy-button:hover {

    background: #142d4f;

    box-shadow:
        0 6px 16px rgba(11, 31, 58, 0.20);
}


.gold-buy-button:active {

    transform: translateY(1px);
}


/* =========================
   Mobile
========================= */

@media (max-width: 480px) {

    .gold-calculator {
        padding: 18px;
        border-radius: 12px;
    }

    .gold-weight-input {
        flex-direction: column;
    }

    .gold-weight-input select {
        width: 100%;
    }

}
