/*
Theme Name: Madeincosta8
Theme URI: https://madeincosta8.com/
Author: Rich
Description: WordPress theme for https://madeincosta8.com/
Version: 1.0
*/

:root {
    /* Color palette - central reference point, not yet applied globally */
    --color-background: #ffffff;
    --color-text: #212121;
    --color-text-i: #DEDEDE;
    --color-accent: #8a7a5c;

    /* Semantic tokens - reference the palette above rather than raw colors */
    --special-text: var(--color-accent);
    --button-background: var(--color-accent);
    --button-text: var(--color-text);

    /* Typography */
    --font-family-base: Verdana, Geneva, Tahoma, sans-serif ;
    --font-size-base: 16px;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.2rem;
    --line-height-base: 1.5;
}

/* Prevent iOS Safari auto-zooming the page when a form field is focused
   (it does this for any input/textarea/select under 16px font-size) */
input,
textarea,
select {
    font-size: 16px;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100dvh;
    overflow-x: hidden;
}

/* WordPress pushes <html> down with margin-top (via an inline style it
   injects itself) to make room for the admin bar, and marks this state
   with an "admin-bar" class on <body>. Since our html/body are pinned to
   a fixed 100dvh each - and dvh is always relative to the viewport, never
   to a parent's box - both elements need their height reduced by the same
   amount, or whichever one still has the un-reduced height overflows the
   other by that amount regardless of what its parent is set to. */
html:has(body.admin-bar),
body.admin-bar {
    height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
    html:has(body.admin-bar),
    body.admin-bar {
        height: calc(100dvh - 46px);
    }
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    background-color: var(--color-background);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
}

.site-header, .site-content, .site-footer {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Header / navbar */
.site-header {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100px;
    box-sizing: border-box;
    border-bottom: 2px solid #f1f3f67d;
    padding: 0 30px;
}

.site-branding {
    flex: 1;
}

.site-branding img {
    display: block;
    max-height: 180px;
    max-width: 100%;
    width: auto;
}

.main-navigation {
    flex: 1;
    justify-items: end;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    height: 102px;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    display: inline-block;
}

.nav-menu li a {
    display: inline-block;
    padding: 52px 25px 22px;
    text-decoration: none;
    color: inherit;
    border-bottom: 4px solid transparent;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a {
    border-bottom-color: var(--color-accent);
}

.site-content {
    flex: 1;
    box-sizing: border-box;
    padding: 0 30px;
}

body.home .site-content {
    padding: 0;
}

body.single-product .site-content {
    padding-top: 30px;
}

.price-and-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    justify-content: end;
}

.price-and-cart .cart {
    margin-bottom: 1em !important;
    margin-top: 1em;
}

.home-hero {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.home-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.home-hero-logo {
    position: relative;
    z-index: 1;
    width: 60%;
    max-width: 400px;
    height: auto;
    color: var(--color-text-i);
}

/* Styled to match WooCommerce's own default button appearance, since the
   WooCommerce Blocks stylesheet those classes normally rely on isn't loaded
   on this page (it's only enqueued where WC actually detects a Cart/Checkout
   block) - this reproduces the same look with plain, always-available CSS. */
.home-cta-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.wp-element-button {
    display: inline-block;
    box-sizing: border-box;
    background-color: var(--color-accent) !important;
    color: #ffffff !important;
    text-decoration: none;
    font-family: var(--font-family-base) !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    padding: 11px 22px 12px !important;
    border: none !important;
    border-radius: 3px !important;
    -webkit-font-smoothing: antialiased !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.wp-element-button:hover {
    background-color: var(--color-accent);
    color: #ffffff;
}

/* Collections grid */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.collection-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-decoration: none;
    overflow: hidden;
}

.collection-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    transition: background 0.2s ease;
}

.collection-card:hover .collection-card-overlay {
    background: rgba(0, 0, 0, 0.55);
}

.collection-card-title {
    position: relative;
    z-index: 1;
    color: var(--color-text);
    font-size: var(--font-size-lg);
    text-align: center;
    padding: 0 10px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 32px;
    height: 24px;
    margin: 18px 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    color: inherit;
}

.menu-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Mobile navigation */
@media (max-width: 768px) {
    .site-header {
        justify-content: space-between;
    }

    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        flex: none;
        position: fixed;
        top: 0;
        right: 0;
        width: min(280px, 80%);
        height: 100%;
        box-sizing: border-box;
        background: var(--color-background);
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
        padding-top: 80px;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .main-navigation.is-open {
        transform: translateX(0);
    }

    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .nav-menu li {
        display: block;
        width: 100%;
    }

    .nav-menu li a {
        display: block;
        padding: 20px 30px;
    }
}

/* WooCommerce price */
.woocommerce .price {
    color: var(--special-text);
}

/* Buttons intentionally left at WooCommerce's default purple - see
   --button-background/--button-text in :root if that ever needs to change. */

/* Home, cart, account and Instagram icons in the nav menu */
.home-icon,
.cart-icon,
.account-icon,
.instagram-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.cart-contents-count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
}

/* Footer */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 30px;
    font-size: 14px;
    box-sizing: border-box;
}

.site-footer-right a {
    color: inherit;
    text-decoration: none;
}

.site-footer-right a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .site-footer {
        flex-direction: column;
        text-align: center;
    }
}

/* Contact page: two columns (Gutenberg's Columns block already stacks
   these on mobile natively - no extra media query needed for that part) */
.wp-block-columns {
    gap: 40px;
}

/* Stack the contact form's fields vertically instead of side by side */
.wp-block-jetpack-contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wp-block-jetpack-contact-form > * {
    width: 100%;
}