/*
Theme Name: CreateCo
Author: Forcefield Web Development
Author URI: https://forcefieldnc.com
Version: 1.0
Description: Custom WooCommerce theme for Create & Co
*/

/* ── Fonts ── */
@font-face {
    font-family: 'Lato';
    src: url('fonts/Lato-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('fonts/Lato-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Playfair Display';
    src: url('fonts/PlayfairDisplay-VariableFont_wght.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; }

/* ── Tokens ── */
:root {
    --cc-primary: #b9914c;
    --cc-primary-dark: #9d7a3e;
    --cc-black: #000;
    --cc-bg-light: #f8f8f8;
    --cc-header-h: 140px;
    --cc-header-h-scrolled: 88px;
}

/* ── Base ── */
body {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

h1, h2 {
    font-family: 'Playfair Display', serif;
    line-height: 1.2;
    font-weight: 700;
    color: var(--cc-black);
}

h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--cc-black);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p + p { margin-top: 1em; }

/* Keep anchored sections clear of the sticky header */
[id] { scroll-margin-top: calc(var(--cc-header-h-scrolled) + 20px); }

/* ── Container ── */
.ff-container,
.woo-container {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
}

/* ── Buttons ── */
.ff-btn {
    display: inline-block;
    padding: 16px 34px;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ff-btn-primary {
    background: var(--cc-primary);
    color: #fff;
}

.ff-btn-primary:hover {
    background: var(--cc-primary-dark);
}

.ff-btn-outline {
    background: transparent;
    border: 2px solid var(--cc-black);
    color: var(--cc-black);
}

.ff-btn-outline:hover {
    background: var(--cc-black);
    color: #fff;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--cc-header-h);
    background: var(--cc-bg-light);
    box-shadow: 0 1px 40px -6px rgba(0, 0, 0, 0.3);
    transition: height 0.3s ease;
}

.site-header.is-scrolled {
    height: var(--cc-header-h-scrolled);
}

.header-container {
    width: 90%;
    max-width: 1600px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo-wrap { display: block; }

.logo-wrap img {
    width: 120px;
    height: auto;
    transition: width 0.3s ease;
}

.site-header.is-scrolled .logo-wrap img {
    width: 96px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav a {
    font-size: 16px;
    color: var(--cc-black);
    text-decoration: none;
    transition: color 0.2s;
}

.main-nav a:hover { color: var(--cc-primary); }

.main-nav > li { position: relative; }

/* Carat on items with a dropdown */
.main-nav > li.menu-item-has-children > a {
    position: relative;
    padding-right: 16px;
}

.main-nav > li.menu-item-has-children > a::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s;
}

.main-nav > li.menu-item-has-children:hover > a::after {
    transform: translateY(-30%) rotate(225deg);
}

.main-nav > li > ul {
    position: absolute;
    top: calc(100% + 14px);
    left: -22px;
    min-width: 240px;
    padding: 8px 0;
    background: #fff;
    border-top: 3px solid var(--cc-primary);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

/* Invisible bridge across the gap so hover doesn't drop mid-travel */
.main-nav > li > ul::before {
    content: '';
    position: absolute;
    top: -17px;
    left: 0;
    right: 0;
    height: 17px;
}

.main-nav > li:hover > ul,
.main-nav > li:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav > li > ul a {
    display: block;
    padding: 10px 22px;
    font-size: 15px;
    transition: background 0.15s, color 0.15s;
}

.main-nav > li > ul a:hover {
    background: var(--cc-bg-light);
    color: var(--cc-primary);
}

/* ── Header icons ── */
.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--cc-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.header-icon-btn:hover { color: var(--cc-primary-dark); }

.header-icon-btn svg { display: block; }

.header-cart { position: relative; }

.header-cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--cc-black);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 9px;
}

.header-cart-count.has-items { display: flex; }

/* ── Header search panel ── */
.header-search {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-width: 100%;
    padding: 16px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: none;
}

.header-search.is-open { display: block; }

.header-search form { display: flex; gap: 8px; }

.header-search input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
}

.header-search input[type="search"]:focus {
    outline: none;
    border-color: var(--cc-primary);
}

.header-search button {
    padding: 10px 16px;
    background: var(--cc-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}

.header-search button:hover { background: var(--cc-primary-dark); }

/* ── Hamburger ── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--cc-black);
    transition: transform 0.25s, opacity 0.25s;
}

.hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile drawer ── */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    padding: 70px 30px 30px;
    background: #fff;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1100;
    overflow-y: auto;
}

.mobile-drawer.is-open { transform: translateX(0); }

.drawer-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--cc-black);
}

.drawer-nav li { border-bottom: 1px solid #eee; }

.drawer-nav a {
    display: block;
    padding: 14px 0;
    font-size: 17px;
    color: var(--cc-black);
    text-decoration: none;
}

.drawer-nav li ul { padding-left: 18px; }

.drawer-nav li ul li { border-bottom: none; }

.drawer-nav li ul a {
    padding: 8px 0;
    font-size: 15px;
    color: #555;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 1050;
}

.drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ── Standard pages ── */
.page-content {
    padding: 48px 0 80px;
}

.page-content h1 {
    font-size: 40px;
    margin-bottom: 28px;
}

.entry-content h2,
.entry-content h3 {
    margin: 1.2em 0 0.5em;
}

.entry-content ul,
.entry-content ol {
    margin: 1em 0;
    padding-left: 1.4em;
}

.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

/* Woo Discount Rules strikes the raw DB price range next to the real
   price in every context (loops, PDP, cart, checkout) — never show it.
   The div.product/li.product selectors outweigh Woo core's
   display:inline-block re-enable on product pages. */
.woocommerce del,
.price del,
.woocommerce div.product p.price del,
.woocommerce div.product span.price del,
.woocommerce ul.products li.product .price del,
.woocommerce del + br,
.price del + br { display: none; }

/* ...and the real price rides in <ins>, which browsers underline */
.woocommerce ins,
.price ins,
.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins,
.woocommerce ul.products li.product .price ins { text-decoration: none; }

/* ── WooCommerce buttons — gold, not Woo purple/gray ── */
.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 #place_order,
.wc-block-components-button:not(.is-link) {
    background-color: var(--cc-primary);
    color: #fff;
    border-radius: 5px;
    font-weight: 700;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce #place_order:hover,
.wc-block-components-button:not(.is-link):hover {
    background-color: var(--cc-primary-dark);
    color: #fff;
}

.woocommerce a.button.disabled,
.woocommerce button.button.disabled,
.woocommerce button.button:disabled,
.woocommerce input.button.disabled,
.woocommerce input.button:disabled {
    background-color: var(--cc-primary);
    color: #fff;
    opacity: 0.5;
}

/* ── Product grid (homepage + archives) ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 24px;
}

.product-grid .product-card {
    border: 1px solid var(--cc-primary);
    border-radius: 8px;
    padding: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-grid .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.18);
}

@media (prefers-reduced-motion: reduce) {
    .product-grid .product-card,
    .product-grid .product-card:hover { transform: none; transition: none; }
}

.product-grid .product-card a {
    display: block;
    text-decoration: none;
}

.product-grid .product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
}

.product-grid .product-card h3 {
    margin-top: 14px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: var(--cc-black);
    transition: color 0.2s;
}

.product-grid .product-card a:hover h3 {
    color: var(--cc-primary);
}

/* ── Footer ── */
#footer {
    background: rgba(0, 0, 0, 0.61);
    padding: 40px 0;
}

.footer-inner {
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-inner p {
    color: #fff;
    font-size: 12px;
}

.footer-info address {
    font-style: normal;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
}

.footer-phone {
    margin: 8px 0 14px;
    font-size: 14px;
}

.footer-phone a { text-decoration: none; }
.footer-phone a:hover { text-decoration: underline; }

.footer-inner a {
    color: #fff;
    text-decoration: underline;
}

.footer-logo img { width: 150px; height: auto; }

/* ── Skip Link ── */
.ff-skip-link {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal;
}
.ff-skip-link:focus {
    clip: auto;
    display: block;
    height: auto;
    width: auto;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100000;
    padding: 15px 23px;
    background: #fff;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 0 2px 2px rgba(0,0,0,.6);
}

/* ── Accessibility ── */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .main-nav { gap: 20px; }
    .nav-right { gap: 20px; }
}

@media (max-width: 768px) {
    :root {
        --cc-header-h: 90px;
        --cc-header-h-scrolled: 90px;
    }

    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.6rem; }

    #site-navigation { display: none; }
    .hamburger { display: flex; }

    .logo-wrap img { width: 100px; }

    .header-search {
        position: fixed;
        top: var(--cc-header-h);
        left: 0;
        right: 0;
        width: 100%;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.45rem; }

    .product-grid { grid-template-columns: 1fr; }
}
