:root {
    --fg-color: #34201a;
    --fg-alt-color: #663a2d;
    --bg-color: #fffbf8;
    --bg-alt-color: #b07952;
    --gray-color: #9d9d9d;
    --yellow-color: #f8a911;
    --yellow-alt-color: #ffce6f;
    --yellow-dark-color: #b27606;
    --red-color: #d43131;
    --green-color: #3ea165;

    --default-border: 2px solid var(--gray-color);
}

html {
    font-size: 100%;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    padding: 0;
    margin: 0 auto;
    line-height: 1.75;
    color: var(--fg-color);
}


/* ==========================================================================
   Typography
   ========================================================================== */

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--fg-color);
}

h1, h2, h3, h4, h5 {
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    margin-top: 0;
    font-family: 'Vollkorn', serif;
    font-size: 2.488rem;
}

h2 {
    font-size: 2.074rem;
}

h3 {
    font-size: 1.728rem;
}

h4 {
    font-size: 1.44rem;
}

h5 {
    font-size: 1.2rem;
}

small, .text-small {
    font-size: 0.833rem;
}

blockquote {
    margin: 0 0 1rem;
    padding: 0;
}

blockquote q {
    /*font-weight: bold;*/
    font-size: 1.5rem;
}
blockquote cite {
    display: block;
}

.text-center {
    text-align: center;
}


/* ==========================================================================
   Tables
   ========================================================================== */
table {
    border-collapse: collapse;
    border-spacing: 0;
    font: inherit;
    width: 100%;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-color);
}

td,
th {
    font: inherit;
    text-align: left;
    font-size: 0.85em;
    padding: 2px 10px;
    border-bottom: 1px solid;
    border-color: var(--gray-color);
}

th {
    font-weight: bold;
}

table a {
    white-space: normal;
}


/* ==========================================================================
   Forms
   ========================================================================== */
input[type=text],
input[type=email],
input[type=number],
input[type=date],
input[type=password],
select,
textarea {
    color: var(--fg-color);
    border: var(--default-border);
    padding: 0.5rem;
    outline: 0;
    box-sizing: border-box;
}

input:focus,
textarea:focus {
    border-color: var(--yellow-color);
}

select[multiple=multiple] {
    height: 8rem;
}


input[type=radio],
input[type=checkbox] {
    width: 2rem;
    height: 2rem;
    vertical-align: middle;
}

input[type=radio] + label,
input[type=checkbox] + label {
    display: inline-block;
    margin: 1rem 0;
}

textarea {
    width: 100%;
    height: 6.25rem;
}

::-webkit-input-placeholder {
    font-style: oblique;
}
::-moz-input-placeholder {
    font-style: oblique;
}
::-ms-input-placeholder {
    font-style: oblique;
}


button,
input[type=submit],
.action-button {
    font-family: inherit;
    font-weight: bold;
    font-size: 1.5rem;
    text-decoration: none;
    text-transform: lowercase;
    font-variant: small-caps;
    white-space: nowrap;

    color: var(--fg-color);
    background-color: var(--yellow-color);

    padding: 0.4rem 1rem;
    border-radius: 0.2rem;
    border: none;

    cursor: pointer;
}

button:hover,
input[type=submit]:hover,
.action-button:hover {
    background-color: var(--yellow-alt-color);
}

.errorlist {
    background-color: var(--red-color);
    color: white;
    list-style: none;
    padding: 0 1rem;
    box-sizing: border-box;
    font-weight: bold;
}

figure {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
img {
    box-sizing: border-box;
    max-width: 100%;
}


/* ==========================================================================
   Base Layout
   ========================================================================== */
main {
    min-height: calc(100vh - 500px);
}

.site__header > nav,
main > article,
footer > section {
    max-width: 1024px;
    padding: 1rem;
    margin: 0 auto;
}

section:not(:last-child) {
    margin-bottom: 1rem;
}


/* ==========================================================================
   Modal
   ========================================================================== */
.modal-menu {
    display: none;
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}


/* Modal Content/Box */
.modal-menu__content {
    background-color: var(--bg-color);
    margin: 25vh auto;
    padding: 20px;
    border: 2rem solid var(--bg-alt-color);
    max-width: 40rem;
}

@media screen and (max-width: 700px) {
    .modal-menu__content {
        margin: 4rem auto;
        border: 1rem solid var(--bg-alt-color);
    }
}

.modal-menu__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

/* The Close Button */
.close-modal {
    color: #aaa;
    font-size: 2rem;
    line-height: 0;
    font-weight: bold;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--fg-color);
    text-decoration: none;
    cursor: pointer;
}


/* ==========================================================================
   Site
   ========================================================================== */
.site__ft-stamp {
    max-width: 6rem;
}

/* Site Header
   ========================================================================== */
.site__header {
    background-color: var(--bg-alt-color);
}

.site__logo > img {
    height: 4rem;
}

/* Site Nav
   ========================================================================== */

.site__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site__logo,
.nav__main,
.nav__account {
    margin-right: 1rem;
}

@media screen and (max-width: 900px) {
    .site__logo,
    .nav__main,
    .nav__account {
        margin-right: 0;
    }
    .site__nav {
        display: grid;
        grid-template-columns: 2fr 0.5fr 0.5fr;
        gap: 1rem;
    }
    .site__logo {
        grid-column: 1;
    }
    .nav__main {
        grid-column: 1/4;
        grid-row: 2;
        justify-content: space-between;
    }
    .nav__account {
        grid-column: 2;
        grid-row: 1;
    }
    .site__cart {
        grid-column: 3;
        grid-row: 1;
    }
}

@media screen and (max-width: 400px) {
    .site__nav {
        grid-template-columns: repeat(2, 1fr);
    }
    .site__logo {
        grid-column: span 2;
        justify-self: center;
    }
    .nav__main {
        grid-column: 1/3;
        grid-row: 3;
    }
    .nav__account {
        grid-column: 1;
        grid-row: 2;
    }
    .site__cart {
        grid-column: 2;
        grid-row: 2;
    }
}

.nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.nav__menu {
    position: relative;
}

.nav__link {
    text-transform: lowercase;
    font-variant: small-caps;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.nav__list li:not(:last-child) {
    margin-right: 1rem;
}

.nav__list.menu {
    flex-direction: column;
}

.nav__dropdown {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    border: var(--default-border);
    padding: 0.5rem;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    display: none;
}

@media screen and (max-width: 400px) {
    .nav__dropdown {
        left: 0;
        right: unset;
    }
}

.nav__menu:hover .nav__dropdown {
    display: flex;
    flex-direction: column;
}

/* Site Banner
   ========================================================================== */
.site__banner {
    background-color: rgba(0, 0, 0, 0.44);
    background-blend-mode: multiply;
    background-size: cover;
    background-position: center;
    color: #f1e8e2;
    text-align: center;
    padding: 2rem 1rem;
    font-family: 'Vollkorn', serif;
}

.site__banner p {
    font-size: 2rem;
}

.site__banner--site {
    background-image: url("/static/images/site_banner.jpg");
}
.site__banner--fairtrade {
    padding: 6rem 1rem;
    background-image: url("/static/images/fairtrade_banner.jpg");
}
.site__banner--reviews {
    padding: 6rem 1rem;
    background-image: url("/static/images/reviews_banner.jpg");
}
.site__banner--about {
    padding: 6rem 1rem;
    background-image: url("/static/images/coffee_banner.jpg");
}

/* Messages
   ========================================================================== */
.messages {
    text-align: center;
    font-weight: bold;
    margin-bottom: 0 !important;
}

.messages p {
    margin-bottom: 0;
}

.messages .success {
    background-color: var(--green-color);
}

.messages .warning {
    background-color: var(--yellow-color);
}

.messages .error {
    background-color: var(--red-color);
}

/* Site Cart
   ========================================================================== */
.site__cart {
    display: flex;
    justify-content: center;
    align-items: center;

    justify-self: end;

    font-family: inherit;
    font-weight: bold;
    text-decoration: none;
    text-transform: lowercase;
    font-variant: small-caps;

    color: var(--fg-color);
    background-color: var(--yellow-color);
    padding: 0.25rem 1rem;
    border-radius: 0.2rem;
    cursor: pointer;
}

.cart__count {
    font-size: 1rem;
}

.cart__icon {
    height: 2rem;
}


/* ==========================================================================
   Articles
   ========================================================================== */
article > header {
    margin-bottom: 1rem;
}

.article__header--with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article__header--with-action h1 {
    margin-bottom: 0;
}

@media screen and (max-width: 600px) {
    .article__header--with-action {
        flex-direction: column;
        align-items: flex-start;
    }

}

article + article {
    margin-top: 8rem;
}

.error-view {
    text-align: center;
    margin: auto 0;
}

/* Product reviews
   ========================================================================== */
.review__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
}

.review__list-short {
    margin: inherit auto;
    max-width: 64ch;
    text-align: center;
}

.review__item {
    text-align: center;
}

@media screen and (max-width: 600px) {
    .review__list {
        grid-template-columns: 1fr;
    }
}

/* Products
   ========================================================================== */
.product__list {
    margin-top: 4rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8rem;
}

.product__item {
    text-decoration: none;

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

.product__item h3,
.product__info h1 {
    /*text-decoration: underline;*/
    font-family: "Vollkorn", serif;
    font-weight: 900;
}

.product__item:hover h3 {
    color: var(--fg-alt-color);
}

.product__first-img--hidden,
.product__second-img--hidden {
    display: none;
}

@media screen and (max-width: 900px) {
    .product__list {
        grid-template-columns: 1fr;
        gap: 6rem;
    }
    .product__figure {
        grid-row: span 2;
    }
}

@media screen and (max-width: 600px) {
    .product__item {
        grid-template-columns: 1fr;
    }

    .product__figure {
        grid-row: 1;
        justify-self: center;
    }
}


.create-subscription-form {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.product__subscription-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
    gap: 8rem;
    overflow-y: scroll;
    max-height: 50rem;
    border-bottom: var(--default-border);
    padding: 0 4rem 4rem;
}

.product__subscription-list div {
    /*max-width: 10rem;*/
}


/* Product Detail
   ========================================================================== */
.product__detail {
    margin-top: 4rem;
    display: grid;
    grid-template-columns: 0.25fr 2fr 1fr;
    gap: 1rem;
}

.gallery__thumbnail {
    border: var(--default-border);
    border-color: var(--bg-color);
    cursor: pointer;
    object-fit: cover;
    aspect-ratio: 1/1;
}

.gallery__image-wrapper {
    text-align: center;
}

.gallery__image {
    max-height: 600px;
}

.gallery__thumbnail--focus {
    border-color: var(--yellow-color);
}

.product__form input,
.product__form select {
    width: 100%;
}



@media screen and (max-width: 700px) {
    .product__detail {
        grid-template-columns: 1fr;
        grid-template-rows: 4rem 1fr auto;
    }
    .product__gallery {
        display: flex;
    }
    .gallery__thumbnail {
        max-height: 4rem;
    }
    .gallery__thumbnail:not(:last-child) {
        margin-right: 0.5rem;
    }
    .product__image {
        max-height: 16rem;
    }
    .product__info {
        grid-column: 1;
    }
}


/* Shopping Cart
   ========================================================================== */
.cart__list {
    margin-bottom: 2rem;
}
.cart__item {
    padding: 1rem 0;
    border-bottom: var(--default-border);
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    gap: 1rem;
}

.cart__table-wrapper {
    display: flex;
    justify-content: flex-end;
}

.cart__summary {
    text-align: right;
}
.cart__totals {
    width: unset;
    font-size: 1.5rem;
}

.cart__totals th,
.cart__totals td {
    border: none;
}
.cart__totals th:first-child,
.cart__totals td:first-child {
    text-align: right;

}

.cart__proceed {
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.cart__proceed > .action-button {
    font-size: 1.75rem;
}

.item__image {
    max-height: 12rem;
}

.item__price {
    justify-self: end;
}

.item__form,
.coupon__form p {
    display: flex;
    align-items: center;
}

.coupon__form p {
    justify-content: flex-end;
}

.item__form input[type=number] {
    max-width: 6rem;
}

.coupon__form input[type=text] {
    max-width: 8rem;
}

:is(.item__form, .coupon__form) label,
:is(.item__form, .coupon__form) input:not(:last-child) {
    margin-right: 0.5rem;
}

@media screen and (max-width: 500px) {
    .cart__item {
        grid-template-columns: 2fr 1fr;
    }

    .cart__proceed {
        flex-direction: column;
    }

    .item__info {
        grid-column: span 2;
        grid-row: 2;
    }

    .item__price {
        grid-column: 2;
        grid-row: 1;
    }

    .item__form {
        flex-direction: column;
    }

    .item__form *:not(:last-child) {
        margin-bottom: 1rem;
        width: 100%;
    }
}



/* Checkout / Shipping Address
   ========================================================================== */
.checkout__address-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 2rem;
}


.checkout__address-form .errorlist {
    grid-column: span 2;
}

@media screen and (max-width: 600px) {
    .checkout__address-form {
        grid-template-columns: 1fr;
    }
    .checkout__address-form .errorlist {
    grid-column: 1;
}
}
.checkout__address-form p:last-child {
    align-self: end;
}

.checkout__address-form input,
.checkout__address-form select {
    display: block;
    width: 100%;
}

.checkout__address {
    margin-bottom: 2rem;
}

#paypal-button-container {
    max-width: 24rem;
    margin-left: auto;
}

/* ==========================================================================
   Orders & OrderLines
   ========================================================================== */
.line__image {
    max-width: 8rem;
}


/* ==========================================================================
   Customer/User
   ========================================================================== */
.customer__detail-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
}

@media screen and (max-width: 600px) {
    .customer__detail-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}




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

footer {
    margin: 4rem 0 0;
    box-sizing: border-box;
    padding: 1rem 0;
    background-color: var(--bg-alt-color);
}

footer > section {
    text-align: center;

}
