/* =========================================================
   GOLDBITES METAL RATES PAGE
   ========================================================= */

:root {
    --rates-green-dark: #001c11;
    --rates-green: #002d19;
    --rates-green-light: #063b25;

    --gold: #f4c542;
    --gold-light: #ffe47a;
    --gold-deep: #c99a20;

    --cream: #f7efd9;
    --green-positive: #62e58b;
}


/* =========================================================
   PAGE
   ========================================================= */

html {
    margin: 0;
    padding: 0;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;

    background: #001c11;
    color: var(--cream);

    font-family: "Inter", Arial, sans-serif;
}


/* =========================================================
   MAIN RATES AREA
   ========================================================= */

.rates-page {
    width: 100%;
    min-height: 100vh;
}


/* =========================================================
   HERO / BACKGROUND
   ========================================================= */

.rates-hero {
    position: relative;

    width: 100%;
    min-height: 100vh;

    padding-top: 72px;

    box-sizing: border-box;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    overflow: hidden;

    background-image:
        url("/images/metal-rates-bg.jpg");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    background-color: #001c11;
}


/* =========================================================
   DARK GREEN OVERLAY
   ========================================================= */

.rates-overlay {
    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(0, 80, 45, 0.20),
            rgba(0, 25, 15, 0.72) 60%,
            rgba(0, 18, 10, 0.88)
        );

    pointer-events: none;
}


/* =========================================================
   CONTENT
   ========================================================= */

.rates-content {
    position: relative;

    z-index: 2;

    /*
       Smaller than before.
       It will smoothly scale between 92%
       and 760px.
    */
    width: min(760px, 92vw);

    margin-top: clamp(28px, 4vw, 42px);

    padding-bottom: clamp(35px, 5vw, 60px);

    box-sizing: border-box;
}


/* =========================================================
   DECORATION
   ========================================================= */

.rates-decoration {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: clamp(10px, 2vw, 22px);

    margin-bottom: clamp(8px, 1.5vw, 14px);
}


.decoration-line {
    width: clamp(45px, 8vw, 105px);

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--gold),
            transparent
        );

    box-shadow:
        0 0 8px rgba(244, 197, 66, 0.8);
}


/* =========================================================
   GOLD STACK ICON
   ========================================================= */

.gold-stack-icon {
    position: relative;

    width: clamp(42px, 5vw, 54px);
    height: clamp(30px, 4vw, 38px);

    flex-shrink: 0;
}


.gold-stack-icon span {
    position: absolute;

    width: clamp(19px, 2.5vw, 24px);
    height: clamp(10px, 1.4vw, 12px);

    border-radius: 4px;

    background:
        linear-gradient(
            145deg,
            #ffe98a,
            #f4c542 45%,
            #b67c0b
        );

    border: 1px solid #ffe47a;

    box-shadow:
        0 0 7px rgba(244, 197, 66, 0.65);
}


.gold-stack-icon span:nth-child(1) {
    left: 5px;
    bottom: 2px;

    transform: skewY(-18deg);
}


.gold-stack-icon span:nth-child(2) {
    left: 22px;
    bottom: 2px;

    transform: skewY(18deg);
}


.gold-stack-icon span:nth-child(3) {
    left: 14px;
    top: 1px;
}


/* =========================================================
   HEADING
   ========================================================= */

.rates-heading {
    text-align: center;

    margin-bottom: clamp(18px, 3vw, 28px);
}


.rates-heading h1 {
    margin: 0;

    font-family:
        "Playfair Display",
        Georgia,
        serif;

    /*
       Responsive:
       mobile 34px
       desktop up to 52px
    */
    font-size: clamp(34px, 5vw, 52px);

    font-weight: 700;

    line-height: 1.1;

    color: var(--cream);

    text-shadow:
        0 2px 15px rgba(0, 0, 0, 0.55);
}


.rates-heading p {
    margin:
        clamp(6px, 1vw, 11px)
        0
        0;

    font-size: clamp(13px, 1.7vw, 17px);

    font-weight: 400;

    color:
        rgba(247, 239, 217, 0.88);

    letter-spacing: 0.2px;
}


/* =========================================================
   MAIN RATES CARD
   ========================================================= */

.rates-card {
    position: relative;

    width: 100%;

    box-sizing: border-box;

    /*
       Much smaller padding than previous version.
    */
    padding:
        clamp(5px, 1vw, 10px)
        clamp(14px, 2.5vw, 24px)
        clamp(15px, 2vw, 20px);

    background:
        linear-gradient(
            145deg,
            rgba(0, 46, 28, 0.94),
            rgba(0, 28, 17, 0.94)
        );

    border: 1px solid var(--gold);

    border-radius:
        clamp(16px, 2.5vw, 22px);

    box-shadow:
        0 0 18px rgba(244, 197, 66, 0.18),
        0 0 38px rgba(244, 197, 66, 0.09),
        inset 0 0 28px rgba(0, 0, 0, 0.22);

    backdrop-filter: blur(8px);

    overflow: hidden;
}


/* =========================================================
   TOP GOLD GLOW
   ========================================================= */

.rates-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 15%;

    width: 70%;
    height: 2px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--gold-light),
            var(--gold),
            transparent
        );

    box-shadow:
        0 0 15px rgba(244, 197, 66, 0.95);

    pointer-events: none;
}


/* =========================================================
   RATE LIST
   ========================================================= */

.rates-list {
    width: 100%;
}


/* =========================================================
   RATE ROW
   ========================================================= */

.rate-row {
    /*
       Compact row.
       Scales smoothly instead of fixed 100px.
    */
    min-height: clamp(68px, 7vw, 82px);

    display: grid;

    grid-template-columns:
        clamp(58px, 7vw, 72px)
        minmax(0, 1fr)
        clamp(135px, 18vw, 175px);

    align-items: center;

    gap: clamp(8px, 1.5vw, 16px);

    border-bottom:
        1px solid rgba(244, 197, 66, 0.18);

    box-sizing: border-box;
}


/* Last row */

.rate-row:last-child {
    border-bottom: none;
}


/* =========================================================
   METAL IMAGE
   ========================================================= */

.rate-image-wrapper {
    width: clamp(50px, 6vw, 65px);
    height: clamp(50px, 6vw, 65px);

    display: flex;

    align-items: center;
    justify-content: center;
}


.rate-image {
    width: clamp(45px, 5.5vw, 60px);
    height: clamp(45px, 5.5vw, 60px);

    object-fit: contain;

    filter:
        drop-shadow(
            0 5px 7px rgba(0, 0, 0, 0.55)
        );
}


/* =========================================================
   METAL INFORMATION
   ========================================================= */

.rate-info {
    min-width: 0;
}


.rate-name {
    margin: 0;

    font-family:
        "Playfair Display",
        Georgia,
        serif;

    font-size:
        clamp(17px, 2.1vw, 21px);

    font-weight: 700;

    color: var(--cream);

    line-height: 1.2;

    /*
       Prevent long names from destroying layout.
    */
    overflow-wrap: break-word;
}


.rate-category {
    margin-top:
        clamp(4px, 0.8vw, 7px);

    font-size:
        clamp(9px, 1.2vw, 12px);

    font-weight: 600;

    letter-spacing:
        clamp(0.5px, 0.15vw, 1px);

    color: var(--gold);
}


/* =========================================================
   RATE VALUE
   ========================================================= */

.rate-value {
    min-width: 0;

    text-align: right;
}


.rate-price {
    font-family:
        "Playfair Display",
        Georgia,
        serif;

    font-size:
        clamp(16px, 2vw, 20px);

    font-weight: 700;

    color: var(--cream);

    white-space: nowrap;
}


.rate-change {
    display: flex;

    justify-content: flex-end;
    align-items: center;

    gap:
        clamp(4px, 0.7vw, 7px);

    margin-top:
        clamp(4px, 0.8vw, 7px);

    font-size:
        clamp(11px, 1.4vw, 14px);

    font-weight: 500;

    color: var(--green-positive);
}


.rate-arrow {
    font-size:
        clamp(11px, 1.5vw, 16px);

    line-height: 1;
}


/* =========================================================
   LOADING
   ========================================================= */

.rates-loading {
    min-height: 220px;

    display: flex;

    align-items: center;
    justify-content: center;

    text-align: center;

    color:
        rgba(247, 239, 217, 0.75);

    font-size:
        clamp(13px, 1.5vw, 16px);
}


/* =========================================================
   ERROR
   ========================================================= */

.rates-error {
    min-height: 180px;

    display: flex;

    align-items: center;
    justify-content: center;

    text-align: center;

    color: #ffb0a8;

    font-size:
        clamp(13px, 1.5vw, 16px);
}


/* =========================================================
   OK BUTTON AREA
   ========================================================= */

.rates-action {
    display: flex;

    justify-content: center;

    padding-top:
        clamp(13px, 2vw, 18px);
}


/* =========================================================
   OK BUTTON
   ========================================================= */

.rates-ok-btn {
    width:
        clamp(165px, 28vw, 220px);

    height:
        clamp(40px, 5vw, 46px);

    padding:
        0 clamp(18px, 3vw, 28px);

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap:
        clamp(7px, 1vw, 11px);

    border:
        1.5px solid var(--gold);

    border-radius: 28px;

    background:
        rgba(0, 45, 25, 0.55);

    color: var(--gold-light);

    font-family:
        "Inter",
        Arial,
        sans-serif;

    font-size:
        clamp(13px, 1.6vw, 15px);

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.25s ease,
        box-shadow 0.25s ease,
        color 0.25s ease,
        transform 0.15s ease;
}


.rates-ok-btn:hover {
    background:
        linear-gradient(
            135deg,
            rgba(244, 197, 66, 0.16),
            rgba(0, 45, 25, 0.75)
        );

    color: #fff1b1;

    box-shadow:
        0 0 12px rgba(244, 197, 66, 0.35),
        0 0 25px rgba(244, 197, 66, 0.15);
}


.rates-ok-btn:active {
    transform: scale(0.98);
}


/* =========================================================
   OK ICON
   ========================================================= */

.ok-icon {
    width:
        clamp(18px, 2.5vw, 21px);

    height:
        clamp(18px, 2.5vw, 21px);

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        1.5px solid var(--gold);

    border-radius: 50%;

    font-size:
        clamp(10px, 1.4vw, 13px);

    line-height: 1;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 800px) {

    .rates-content {
        width: min(720px, 92vw);
    }

    .rate-row {
        grid-template-columns:
            clamp(55px, 9vw, 68px)
            minmax(0, 1fr)
            clamp(125px, 22vw, 160px);
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 560px) {

    .rates-hero {
        padding-top: 68px;

        background-position: center;
    }


    .rates-content {
        width: calc(100% - 20px);

        margin-top: 25px;

        padding-bottom: 30px;
    }


    .rates-decoration {
        gap: 7px;
    }


    .rates-heading {
        margin-bottom: 18px;
    }


    /*
       Keep heading responsive with clamp.
    */
    .rates-heading h1 {
        font-size: clamp(32px, 10vw, 39px);
    }


    .rates-heading p {
        font-size: clamp(12px, 3.5vw, 15px);
    }


    .rates-card {
        padding:
            5px
            12px
            16px;

        border-radius: 18px;
    }


    /*
       Two-column mobile layout.
       Image + details on first area,
       price aligned to the right.
    */
    .rate-row {
        min-height: clamp(70px, 20vw, 86px);

        grid-template-columns:
            clamp(48px, 15vw, 58px)
            minmax(0, 1fr);

        gap: 7px;
    }


    .rate-image-wrapper {
        width: clamp(45px, 14vw, 54px);
        height: clamp(45px, 14vw, 54px);
    }


    .rate-image {
        width: clamp(42px, 13vw, 50px);
        height: clamp(42px, 13vw, 50px);
    }


    .rate-name {
        font-size: clamp(15px, 4.5vw, 18px);
    }


    .rate-category {
        margin-top: 4px;

        font-size: clamp(8px, 2.5vw, 10px);

        letter-spacing: 0.6px;
    }


    /*
       Price stays beside the information
       instead of creating a third column.
    */
    .rate-value {
        grid-column: 2;

        display: flex;

        align-items: center;

        justify-content: space-between;

        width: 100%;

        margin-top: -18px;
    }


    .rate-price {
        font-size: clamp(14px, 4vw, 17px);
    }


    .rate-change {
        margin-top: 0;

        font-size: clamp(10px, 3vw, 12px);

        gap: 4px;
    }


    .rate-arrow {
        font-size: clamp(10px, 3vw, 13px);
    }


    .rates-action {
        padding-top: 15px;
    }


    .rates-ok-btn {
        width: clamp(155px, 55vw, 195px);

        height: clamp(39px, 11vw, 45px);

        font-size: clamp(12px, 3.5vw, 14px);
    }


    .ok-icon {
        width: 18px;
        height: 18px;

        font-size: 10px;
    }
}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {

    .rates-content {
        width: calc(100% - 14px);

        margin-top: 20px;
    }


    .rates-card {
        padding-left: 9px;
        padding-right: 9px;
    }


    .rate-row {
        min-height: 68px;

        grid-template-columns:
            43px
            minmax(0, 1fr);

        gap: 5px;
    }


    .rate-image-wrapper {
        width: 42px;
        height: 42px;
    }


    .rate-image {
        width: 39px;
        height: 39px;
    }


    .rate-name {
        font-size: 14px;
    }


    .rate-category {
        font-size: 8px;
    }


    .rate-price {
        font-size: 13px;
    }


    .rate-change {
        font-size: 9px;
    }


    .rates-ok-btn {
        width: 150px;
        height: 38px;

        font-size: 12px;
    }
}