/* =========================================================
   Root & Global Defaults
   ========================================================= */

:root {
    --footer-color: #2f2a26;
    --footer-height: 2.2rem;

    --order-color: #3f4032;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
}

body {
    font-family: "IBM Plex Sans", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings: "wdth" 100;
}


/* =========================================================
   Layout
   ========================================================= */

main {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;

    margin: 4rem 7rem;
    margin-bottom: calc(var(--footer-height) + 4rem);
}

@media (max-width: 1100px) {
    main {
        margin: 4rem 3rem;
    }
}

@media (max-width: 950px) {
    main {
        grid-template-columns: 1fr;
        margin: 4rem 2rem;
    }
}


/* =========================================================
   Book Card
   ========================================================= */

.book {
    display: flex;
    gap: 1rem;
}

.image {
    flex: 0 0 40%;
    aspect-ratio: 15.5 / 23;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.info {
    flex: 1;
}

.title {
    margin: 1rem;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: right;
}

.subtitle {
    font-size: 1.08rem;
    font-weight: 500;
}

.description > * {
    display: block;
}


/* =========================================================
   Footer
   ========================================================= */

footer {
    position: fixed;
    inset: auto 0 0 0;

    height: var(--footer-height);
    padding: 0 0.8rem;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;

    background-color: var(--footer-color);
    color: #fff;
    font-size: 0.9rem;
}

footer > p {
    margin: 0.6rem;
}


/* =========================================================
   Footer Controls
   ========================================================= */

#order-button {
    height: 1.4rem;
    padding: 0.1rem 1rem;

    display: inline-flex;
    align-items: center;

    border: 1.5px solid currentColor;
    background: none;

    font: inherit;
    color: inherit;
    cursor: pointer;

    transition:
        background-color 160ms ease-out,
        color 160ms ease-out,
        border-color 160ms ease-out;
}

#order-button:hover {
    background-color: #fff;
    color: var(--footer-color);
    border-color: var(--footer-color);
}


/* =========================================================
   Country Select
   ========================================================= */

.country-select {
    position: relative;

    display: inline-flex;
    align-items: center;

    height: 1.4rem;
    padding: 0 1.6rem 0 0.6rem;

    border: 1.5px solid currentColor;
    color: #fff;

    cursor: pointer;
}

.country-select select {
    appearance: none;
    border: none;
    background: none;
    outline: none;

    font: inherit;
    color: inherit;
    cursor: inherit;
}

.country-select::after {
    content: "▾";
    position: absolute;
    right: 0.5rem;

    font-size: 0.75rem;
    opacity: 0.8;
    pointer-events: none;
}

.country-select:hover,
.country-select:focus-within {
    background-color: #fff;
    color: var(--footer-color);
}


/* =========================================================
   Book Order Control
   ========================================================= */

.book-order {
    display: inline-flex;
    align-items: center;

    height: 1.8rem;

    border: 1px solid var(--order-color);
    color: var(--order-color);

    font-size: 0.9rem;
    line-height: 1;
}

.qty-btn {
    width: 1.8rem;
    height: 100%;

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

    border: none;
    background: none;

    color: inherit;
    text-decoration: none;
    user-select: none;
    cursor: pointer;

    transition:
        background-color 140ms ease-out,
        color 140ms ease-out;
}

.qty-btn:hover {
    background-color: var(--order-color);
    color: #fff;
}

.qty-input {
    width: 2.4rem;
    height: 100%;

    border: none;
    border-left: 1px solid var(--order-color);
    border-right: 1px solid var(--order-color);
    background: none;

    font: inherit;
    color: inherit;
    text-align: center;

    appearance: textfield;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.book-order:focus-within {
    outline: 1px solid var(--order-color);
    outline-offset: 2px;
}
