/*
Theme Name: Crazy Wear
Description: Storefront for the clothing catalogue. Sample patterns stand in for product photographs.
Version: 0.2.12
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.2
Text Domain: crazy-wear
*/

/* Outfit and Syne are used under the SIL Open Font License. */

@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("assets/fonts/outfit-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("assets/fonts/outfit-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Syne";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("assets/fonts/syne-latin-700.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --indigo: #17355c;
    --deep: #0e2240;
    --cloth: #f3f6f8;
    --madder: #c2452d;
    --ink: #1a1814;
    --muted: #5c6b78;
    --line: #d5dde3;
    --paper: #ffffff;
    --gutter: clamp(20px, 2vw, 32px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cloth);
    color: var(--ink);
    font-family: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
    font-size: 1.0625rem;
    line-height: 1.5;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--madder);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -40px;
    background: var(--paper);
    padding: 8px 12px;
    z-index: 5;
}

.skip-link:focus {
    top: 12px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    min-height: 68px;
    padding: 0 var(--gutter);
    background: rgba(243, 246, 248, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.wordmark {
    font-family: "Syne", "Outfit", sans-serif;
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.site-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-weight: 500;
}

.sample-bar {
    margin: 0;
    padding: 10px var(--gutter);
    background: var(--deep);
    color: var(--cloth);
    font-size: 0.92rem;
}

.intro {
    display: grid;
    grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
    min-height: calc(100svh - 68px);
    background: var(--indigo);
    color: var(--cloth);
}

.sample-bar + #content .intro {
    min-height: calc(100svh - 68px - 42px);
}

.intro-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 48px var(--gutter) 56px;
}

.intro-kicker {
    margin: 0 0 18px;
    color: #c5d0da;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.intro h1 {
    margin: 0 0 16px;
    max-width: 11ch;
    font-family: "Syne", "Outfit", sans-serif;
    font-size: clamp(2.4rem, 4vw, 4.4rem);
    line-height: 0.92;
    letter-spacing: -0.045em;
}

.intro-lead {
    max-width: 32ch;
    margin: 0 0 28px;
    color: #d5dee6;
    font-size: 1.05rem;
}

.intro-action {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding: 0 22px;
    background: var(--cloth);
    color: var(--indigo);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.intro-action:hover {
    background: var(--madder);
    color: #fff;
}

.intro-photo {
    position: relative;
    min-height: 420px;
    overflow: hidden;
    background: var(--deep);
}

.intro-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center 18%;
    animation: intro-settle 1.1s ease both;
}

.intro-copy > * {
    animation: intro-rise 0.7s ease both;
}

.intro-copy h1 {
    animation-delay: 0.08s;
}

.intro-copy .intro-lead {
    animation-delay: 0.16s;
}

.intro-copy .intro-action {
    animation-delay: 0.24s;
}

.catalogue,
.shop-main,
.plain-page {
    width: calc(100% - 2 * var(--gutter));
    margin: 0 auto;
    padding: 48px 0 80px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 8px;
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 32px;
    margin: 0 0 28px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.category-group,
.category-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 18px;
}

.category-nav .category-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
}

.category-nav > .category-link,
.category-group > .category-link {
    color: var(--ink);
    font-weight: 600;
}

.category-group > .category-link {
    font-family: "Syne", "Outfit", sans-serif;
    letter-spacing: -0.03em;
}

.category-nav .category-link.is-current {
    color: var(--madder);
    box-shadow: inset 0 -2px 0 var(--madder);
}

.section-head h2,
.plain-page h1,
.shop-main h1.page-title,
.shop-main .woocommerce-products-header__title,
.product_title {
    font-family: "Syne", "Outfit", sans-serif;
    letter-spacing: -0.04em;
    line-height: 0.95;
}

.section-head h2 {
    margin: 0 0 16px;
    font-size: 2.4rem;
}

.section-head nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-bottom: 16px;
}

.section-head a {
    text-decoration: none;
    font-weight: 500;
}

.product-grid,
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 36px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

ul.products::before,
ul.products::after {
    display: none !important;
}

ul.products li.product {
    width: auto !important;
    margin: 0 !important;
    float: none !important;
}

.product-tile {
    position: relative;
    display: grid;
    gap: 8px;
    text-decoration: none;
}

.sale-flag,
ul.products li.product span.onsale {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    margin: 0;
    min-height: 0;
    border-radius: 0;
    background: var(--madder);
    color: var(--cloth);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    padding: 7px 8px;
}

ul.products li.product {
    position: relative;
}

.product-tile img,
ul.products li.product img,
.woocommerce-product-gallery img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: var(--indigo);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.product-tile .name,
ul.products li.product .woocommerce-loop-product__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 0;
    min-height: 2.6em;
    padding: 0;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
}

.product-tile .price,
.product-tile .price .amount,
ul.products li.product .price,
ul.products li.product .price .amount,
.woocommerce div.product p.price,
.woocommerce div.product p.price .amount,
.summary > .price,
.order-total .amount {
    color: var(--madder);
    font-weight: 600;
}

.product-tile .price,
ul.products li.product .price {
    font-size: 1rem;
}

.product-tile .price del,
.product-tile .price del .amount,
ul.products li.product .price del,
ul.products li.product .price del .amount,
.woocommerce div.product p.price del,
.woocommerce div.product p.price del .amount,
.summary > .price del,
.summary > .price del .amount {
    color: var(--muted);
    font-weight: 500;
    text-decoration: line-through;
}

.price ins {
    text-decoration: none;
}

.stock,
.stock.out-of-stock {
    color: var(--muted);
    font-size: 0.92rem;
}

.plain-page h1 {
    margin-top: 0;
    font-size: clamp(2.4rem, 5vw, 4rem);
}

.plain-page article {
    max-width: none;
}

.plain-page h2,
.plain-page h3 {
    font-family: "Syne", "Outfit", sans-serif;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.plain-page h2 {
    margin: 1.6em 0 0.4em;
    font-size: 1.45rem;
}

.plain-page h3 {
    margin: 1.3em 0 0.35em;
    font-size: 1.15rem;
}

.plain-page p,
.plain-page li {
    color: var(--ink);
}

.plain-page ul {
    margin: 0.4em 0 1em;
    padding-left: 1.2em;
}

.shop-main h1.page-title,
.shop-main .woocommerce-products-header__title,
.product_title {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: clamp(1.7rem, 2.4vw, 2.6rem);
    line-height: 1.12;
}

.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 0 28px;
}

.woocommerce-result-count,
.woocommerce-ordering {
    float: none;
    margin: 0;
}

.woocommerce-ordering select {
    width: auto;
    min-width: 12rem;
}

.single-product div.product .woocommerce-product-gallery {
    position: sticky;
    top: 84px;
}

form.cart {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

form.cart .single_add_to_cart_button {
    flex: 1 1 12rem;
}

.related > h2,
.upsells > h2 {
    margin: 48px 0 20px;
    font-family: "Syne", "Outfit", sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.04em;
}

.woocommerce-pagination {
    margin-top: 40px;
}

.woocommerce nav.woocommerce-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    border: 0;
}

.woocommerce nav.woocommerce-pagination ul.page-numbers li {
    float: none;
    border: 0;
    overflow: visible;
}

.woocommerce nav.woocommerce-pagination ul.page-numbers a,
.woocommerce nav.woocommerce-pagination ul.page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
}

.woocommerce nav.woocommerce-pagination ul.page-numbers span.current {
    background: var(--indigo);
    color: var(--cloth);
}

#payment,
.woocommerce-checkout #payment {
    background: var(--paper);
    border-radius: 0;
}

#payment div.payment_box,
.woocommerce-checkout #payment div.payment_box {
    background: var(--cloth);
    color: var(--ink);
}

#payment div.payment_box::before,
.woocommerce-checkout #payment div.payment_box::before {
    border-bottom-color: var(--cloth);
}

.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation),
#customer_login {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 32px 40px;
    align-items: start;
}

#customer_login {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content,
#customer_login .u-column1,
#customer_login .u-column2 {
    float: none;
    width: auto;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-MyAccount-navigation a {
    display: flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.woocommerce-MyAccount-navigation .is-active a {
    color: var(--madder);
}

.shop_table img {
    width: 72px;
    height: 96px;
    object-fit: cover;
}

.woocommerce-breadcrumb {
    color: var(--muted);
    margin-bottom: 18px;
}

.woocommerce-breadcrumb a {
    color: var(--ink);
}

div.product {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 40px;
    align-items: start;
}

div.product .summary,
div.product div.summary {
    float: none;
    width: auto;
}

.single-product div.product .woocommerce-product-gallery {
    width: auto !important;
    float: none !important;
}

.summary .price {
    font-size: 1.6rem;
}

.variations select,
.quantity .qty,
.input-text,
select,
textarea {
    min-height: 48px;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}

.variations td,
.variations th {
    display: block;
    text-align: left;
    padding: 0 0 8px;
}

.variations tr {
    display: block;
    margin-bottom: 14px;
}

.quantity .qty {
    width: 5.5rem;
}

.button,
button,
input[type="submit"],
a.button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce button.button.alt.disabled,
.woocommerce #payment #place_order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 0;
    background: var(--indigo);
    color: var(--cloth);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
a.button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce #payment #place_order:hover {
    background: var(--deep);
    color: var(--cloth);
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    background: var(--paper);
    color: var(--ink);
    border-top: 0;
    border-left: 3px solid var(--indigo);
    padding: 14px 16px;
}

.woocommerce-error {
    border-left-color: var(--madder);
}

.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
    color: var(--indigo);
}

.upi-instructions {
    margin: 20px 0 28px;
    padding: 18px 18px 6px;
    background: var(--paper);
    border-left: 3px solid var(--madder);
}

.upi-instructions h2 {
    margin: 0 0 8px;
    font-family: "Syne", "Outfit", sans-serif;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
}

table.shop_table {
    border-collapse: collapse;
    width: 100%;
    background: var(--paper);
}

table.shop_table th,
table.shop_table td {
    border-bottom: 1px solid var(--line);
    padding: 14px 10px;
}

.cart_totals,
.woocommerce-checkout-review-order {
    background: var(--paper);
    padding: 8px 16px 16px;
}

.col2-set {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

#customer_details .col-1,
#customer_details .col-2 {
    float: none;
    width: auto;
    min-width: 0;
}

.woocommerce form .form-row-first,
.woocommerce form .form-row-last {
    float: left;
    width: calc(50% - 8px);
}

.woocommerce form .form-row-last {
    float: right;
}

.woocommerce form .form-row-wide {
    clear: both;
    width: 100%;
}

.woocommerce-cart td.actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.woocommerce-cart td.actions .coupon {
    display: flex;
    gap: 8px;
    float: none;
}

.woocommerce-cart td.actions .coupon .input-text {
    width: 11rem;
    flex: 0 0 11rem;
    float: none;
}

.woocommerce-cart td.actions > .button {
    float: none;
    margin-left: auto;
}

.woocommerce form .form-row {
    margin-bottom: 14px;
}

.site-footer {
    padding: 56px 0 36px;
    background: var(--deep);
    color: var(--cloth);
}

.footer-inner {
    width: calc(100% - 2 * var(--gutter));
    margin: 0 auto;
}

.footer-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
    gap: 36px 48px;
    align-items: start;
}

.footer-brand .wordmark {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--cloth);
}

.footer-label {
    margin: 0 0 12px;
    color: #9aabba;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-footer a {
    color: var(--cloth);
}

.site-footer nav {
    display: grid;
    gap: 8px;
}

.site-footer nav a {
    text-decoration: none;
}

.site-footer nav a:hover,
.footer-contact a:hover {
    text-decoration: underline;
}

.footer-brand p,
.footer-contact p {
    margin: 0 0 6px;
    color: #c5d0da;
}

.footer-base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px 32px;
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid rgba(243, 246, 248, 0.16);
}

.site-footer .copyright {
    margin: 0;
    color: #c5d0da;
}

.pay-methods {
    margin-left: auto;
    max-width: 100%;
}

.pay-methods .footer-label {
    margin-bottom: 8px;
    text-align: right;
}

.pay-methods ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pay-methods li {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    height: 36px;
    padding: 0 8px;
    background: #fff;
}

.pay-methods img {
    height: 20px;
    width: auto;
    max-width: none;
    display: block;
}

@media (min-width: 960px) {
    form.checkout {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
        column-gap: 48px;
        align-items: start;
    }

    form.checkout #customer_details {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    form.checkout #order_review_heading {
        grid-column: 2;
        grid-row: 1;
    }

    form.checkout #order_review {
        grid-column: 2;
        grid-row: 2;
        position: sticky;
        top: 84px;
    }
}

@media (max-width: 800px) {
    .site-header {
        align-items: center;
        gap: 12px;
        min-height: 60px;
    }

    .wordmark {
        font-size: 1.25rem;
    }

    .site-nav {
        gap: 2px 14px;
    }

    .sample-bar {
        font-size: 0.88rem;
        line-height: 1.4;
    }

    .category-nav {
        gap: 4px 20px;
    }

    .category-group + .category-group {
        flex-basis: 100%;
    }

    .shop-toolbar,
    .woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation),
    #customer_login {
        display: grid;
        grid-template-columns: 1fr;
    }

    .woocommerce-ordering select {
        width: 100%;
    }

    .woocommerce-cart td.actions {
        flex-wrap: wrap;
    }

    .woocommerce-cart td.actions > .button,
    .woocommerce-cart td.actions .coupon,
    .woocommerce-cart td.actions .coupon .input-text {
        width: 100%;
        flex: 1 1 100%;
        margin-left: 0;
    }

    .single-product div.product .woocommerce-product-gallery {
        position: static;
    }

    .footer-columns {
        grid-template-columns: 1fr 1fr;
        gap: 28px 24px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .intro,
    .sample-bar + #content .intro {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .intro-photo {
        order: -1;
        height: min(68vw, 460px);
        min-height: 240px;
    }

    .intro-copy {
        padding: 28px var(--gutter) 36px;
    }

    .intro h1 {
        font-size: clamp(2.2rem, 10vw, 3.2rem);
    }

    .product-grid,
    ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 12px;
    }

    .section-head {
        display: block;
    }

    div.product {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .single_add_to_cart_button,
    #place_order {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .footer-columns {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .intro-photo img,
    .intro-copy > * {
        animation: none;
    }
}

@keyframes intro-settle {
    from { transform: scale(1.06); }
    to { transform: scale(1); }
}

@keyframes intro-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}
