/*
 Theme Name:   FrameFiesta Blocksy Child
 Theme URI:    https://framefiesta.com
 Description:  Blocksy child theme for FrameFiesta — clean eyewear e-commerce
 Author:       Frank Butler
 Author URI:   https://frankdatainsights.com
 Template:     blocksy
 Version:      1.5.0
 Text Domain:  framefiesta-blocksy-child
*/

/* =========================================================
   CSS Custom Properties — FrameFiesta Brand
   ========================================================= */
:root {
    /* Brand Colors — matches framefiesta.com logo blue */
    --ff-primary: #1a1a2e;        /* Dark navy — headers, text */
    --ff-secondary: #16213e;      /* Slightly lighter navy */
    --ff-accent: #3B6BE5;         /* Blue — brand accent from logo, CTAs */
    --ff-accent-hover: #2D56C8;   /* Darker blue hover */
    --ff-accent-light: #f0f5ff;   /* Light blue tint — card backgrounds */
    --ff-accent-border: #d4e0f0;  /* Light blue border */
    --ff-warm: #f0f5ff;           /* Light blue — section backgrounds */
    --ff-white: #ffffff;
    --ff-light-gray: #fafafa;
    --ff-mid-gray: #e2e8f0;
    --ff-text: #515151;
    --ff-text-light: #767676;
    --ff-text-muted: #999999;

    /* Typography */
    --ff-font: 'Poppins', sans-serif;
    --ff-font-weight-normal: 400;
    --ff-font-weight-semibold: 600;

    /* Spacing */
    --ff-section-gap: 80px;
    --ff-card-gap: 24px;
    --ff-container-max: 1200px;

    /* Transitions */
    --ff-transition: 0.2s ease;
}

/* =========================================================
   Blocksy Layout Fixes
   ========================================================= */

/* Prevent horizontal overflow from full-width sections */
body.home {
    overflow-x: hidden;
}

.home .site-main,
.home .entry-content {
    overflow-x: hidden;
}

/* Hide page title on front page */
.home .page-title,
.home .entry-header,
body.page-template-default.home .entry-header {
    display: none !important;
}

/* Let full-width sections break out of Blocksy's constrained container */
.home .entry-content > .ff-hero,
.home .entry-content > .wp-block-cover.ff-hero,
.home .entry-content > .ff-trust-bar,
.home .entry-content > .wp-block-group.ff-trust-bar {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
}

/* Prevent Blocksy constrained layout from overriding our widths */
.home .entry-content.is-layout-constrained > .ff-hero,
.home .entry-content.is-layout-constrained > .wp-block-group.ff-trust-bar {
    max-width: none !important;
}

/* Fix SVGs inside WordPress block groups / flex layouts */
.entry-content svg {
    max-width: 24px;
    max-height: 24px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* Fix WordPress block group flex items stretching */
.wp-block-group.ff-trust-item {
    flex-shrink: 0;
}

/* Remove extra padding Blocksy adds to page content */
.home .site-main > article {
    padding-top: 0;
}

.home .site-main > article > .entry-content {
    margin-top: 0;
}

/* =========================================================
   Global Resets & Typography
   ========================================================= */
body {
    font-family: var(--ff-font);
    font-weight: var(--ff-font-weight-normal);
    color: var(--ff-text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--ff-font);
    font-weight: var(--ff-font-weight-semibold);
    color: var(--ff-primary);
}

/* =========================================================
   Header — Warby Parker Style
   ========================================================= */
[data-id="header"] {
    border-bottom: 1px solid var(--ff-mid-gray);
}

.ct-header .site-title {
    font-weight: var(--ff-font-weight-semibold);
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

/* Clean navigation links */
[data-id="header"] .ct-menu > li > a {
    font-size: 0.9rem;
    font-weight: var(--ff-font-weight-normal);
    text-transform: none;
    letter-spacing: 0;
    padding: 0.5rem 1rem;
    color: var(--ff-text);
    transition: color var(--ff-transition);
}

[data-id="header"] .ct-menu > li > a:hover {
    color: var(--ff-accent);
}

/* Cart icon badge */
.ct-cart-icon .ct-count {
    background: var(--ff-accent);
    color: var(--ff-white);
}

/* =========================================================
   Hero Banner
   ========================================================= */
.ff-hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--ff-warm);
}

.ff-hero .wp-block-cover__image-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide broken image when no src is set */
.ff-hero img[src=""],
.ff-hero img:not([src]) {
    display: none;
}

/* When no hero image, use a gradient background */
.ff-hero:not(:has(img[src]:not(img[src=""]))) {
    background: linear-gradient(135deg, var(--ff-warm) 0%, #e8e0d8 100%);
}

.ff-hero-content {
    position: relative;
    z-index: 2;
    max-width: 560px;
    padding: 60px 40px;
}

.ff-hero-content h1 {
    font-size: 3rem;
    line-height: 1.1;
    color: var(--ff-primary);
    margin-bottom: 16px;
}

.ff-hero-content p {
    font-size: 1.125rem;
    color: var(--ff-text-light);
    margin-bottom: 32px;
    line-height: 1.6;
}

.ff-hero-ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ff-btn-primary {
    display: inline-block;
    background: var(--ff-accent);
    color: var(--ff-white);
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: var(--ff-font-weight-semibold);
    font-size: 0.95rem;
    text-decoration: none;
    transition: background var(--ff-transition), transform var(--ff-transition);
    border: none;
    cursor: pointer;
}

.ff-btn-primary:hover {
    background: var(--ff-accent-hover);
    transform: translateY(-1px);
    color: var(--ff-white);
}

.ff-btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--ff-primary);
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: var(--ff-font-weight-semibold);
    font-size: 0.95rem;
    text-decoration: none;
    border: 2px solid var(--ff-primary);
    transition: all var(--ff-transition);
    cursor: pointer;
}

.ff-btn-secondary:hover {
    background: var(--ff-primary);
    color: var(--ff-white);
}

/* =========================================================
   Trust Bar
   ========================================================= */
.ff-trust-bar {
    background: var(--ff-warm);
    padding: 20px 0;
    border-top: 1px solid var(--ff-mid-gray);
    border-bottom: 1px solid var(--ff-mid-gray);
}

.ff-trust-items {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    max-width: var(--ff-container-max);
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
}

.ff-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--ff-text);
    white-space: nowrap;
}

.ff-trust-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--ff-accent);
}

.ff-trust-item span {
    font-weight: var(--ff-font-weight-semibold);
}

/* =========================================================
   Section Headings
   ========================================================= */
.ff-section {
    padding: var(--ff-section-gap) 20px;
    max-width: var(--ff-container-max);
    margin: 0 auto;
}

.ff-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 40px;
}

.ff-section-header h2 {
    font-size: 1.75rem;
    margin: 0;
}

.ff-section-header a {
    font-size: 0.9rem;
    color: var(--ff-accent);
    text-decoration: none;
    font-weight: var(--ff-font-weight-semibold);
    border: 1px solid var(--ff-accent);
    padding: 8px 20px;
    border-radius: 50px;
    transition: all var(--ff-transition);
}

.ff-section-header a:hover {
    background: var(--ff-accent);
    color: var(--ff-white);
}

/* =========================================================
   Filter Bar — Color/Size/Shape
   ========================================================= */
.ff-filter-bar {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 20px 0;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.ff-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ff-filter-group label {
    font-size: 0.8rem;
    font-weight: var(--ff-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ff-text-muted);
    margin-right: 4px;
}

/* Color swatches */
.ff-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--ff-transition);
    position: relative;
}

.ff-color-swatch:hover,
.ff-color-swatch.active {
    border-color: var(--ff-primary);
    transform: scale(1.15);
}

.ff-color-swatch.active::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid var(--ff-primary);
}

/* Color values */
.ff-color-swatch[data-color="black"] { background: #1a1a1a; }
.ff-color-swatch[data-color="tortoise"] { background: linear-gradient(135deg, #8B4513 25%, #D2691E 50%, #A0522D 75%); }
.ff-color-swatch[data-color="clear"] { background: #f0f0f0; border-color: #ddd; }
.ff-color-swatch[data-color="blue"] { background: #4169E1; }
.ff-color-swatch[data-color="gold"] { background: #DAA520; }
.ff-color-swatch[data-color="silver"] { background: #C0C0C0; }
.ff-color-swatch[data-color="brown"] { background: #8B4513; }
.ff-color-swatch[data-color="red"] { background: #B22222; }
.ff-color-swatch[data-color="green"] { background: #2E8B57; }
.ff-color-swatch[data-color="pink"] { background: #DB7093; }
.ff-color-swatch[data-color="purple"] { background: #6A5ACD; }
.ff-color-swatch[data-color="white"] { background: #ffffff; border-color: #ddd; }

/* Size & shape buttons */
.ff-filter-btn {
    padding: 6px 16px;
    border: 1px solid var(--ff-mid-gray);
    border-radius: 50px;
    background: var(--ff-white);
    color: var(--ff-text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--ff-transition);
    font-family: var(--ff-font);
}

.ff-filter-btn:hover {
    border-color: var(--ff-primary);
}

.ff-filter-btn.active {
    background: var(--ff-primary);
    color: var(--ff-white);
    border-color: var(--ff-primary);
}

/* Clear all filters */
.ff-filter-clear {
    font-size: 0.8rem;
    color: var(--ff-text-muted);
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    font-family: var(--ff-font);
    margin-left: auto;
}

.ff-filter-clear:hover {
    color: var(--ff-accent);
}

/* =========================================================
   Product Grid — Warby Parker Style Cards
   ========================================================= */
.ff-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--ff-card-gap);
}

.ff-product-card {
    position: relative;
    background: var(--ff-white);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow var(--ff-transition);
}

.ff-product-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Product image container */
.ff-product-card .ff-card-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--ff-light-gray);
    overflow: hidden;
}

.ff-product-card .ff-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: transform var(--ff-transition);
}

.ff-product-card:hover .ff-card-image img {
    transform: scale(1.03);
}

/* Try-On button overlay */
.ff-try-on-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--ff-mid-gray);
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: var(--ff-text);
    cursor: pointer;
    transition: all var(--ff-transition);
    font-family: var(--ff-font);
    opacity: 0;
    transform: translateY(-4px);
}

.ff-product-card:hover .ff-try-on-btn {
    opacity: 1;
    transform: translateY(0);
}

.ff-try-on-btn:hover {
    background: var(--ff-primary);
    color: var(--ff-white);
    border-color: var(--ff-primary);
}

.ff-try-on-btn svg {
    width: 16px;
    height: 16px;
}

/* Quick view overlay */
.ff-quick-view-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.85);
    color: var(--ff-white);
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: var(--ff-font-weight-semibold);
    cursor: pointer;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.25s ease;
}

.ff-product-card:hover .ff-quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Product card info */
.ff-card-info {
    padding: 16px;
}

.ff-card-info .ff-product-name {
    font-size: 0.95rem;
    font-weight: var(--ff-font-weight-normal);
    color: var(--ff-text);
    margin: 0 0 4px;
    text-decoration: none;
    display: block;
}

.ff-card-info .ff-product-name:hover {
    color: var(--ff-accent);
}

.ff-card-info .ff-product-price {
    font-size: 0.95rem;
    font-weight: var(--ff-font-weight-semibold);
    color: var(--ff-primary);
    margin: 0 0 8px;
}

/* Card color swatches (small dots) */
.ff-card-colors {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.ff-card-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform var(--ff-transition);
}

.ff-card-color-dot:hover {
    transform: scale(1.3);
}

/* Star ratings */
.ff-card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ff-card-rating .ff-stars {
    display: flex;
    gap: 1px;
    color: #f5a623;
    font-size: 0.8rem;
}

.ff-card-rating .ff-rating-count {
    font-size: 0.75rem;
    color: var(--ff-text-muted);
}

/* =========================================================
   Featured Categories
   ========================================================= */
.ff-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ff-card-gap);
}

.ff-category-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.ff-category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ff-category-card:hover img {
    transform: scale(1.05);
}

.ff-category-card .ff-cat-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 24px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: var(--ff-white);
}

.ff-category-card .ff-cat-overlay h3 {
    font-size: 1.25rem;
    color: var(--ff-white);
    margin: 0 0 8px;
}

.ff-category-card .ff-cat-overlay a {
    font-size: 0.85rem;
    color: var(--ff-white);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* =========================================================
   Social Proof / Reviews Section
   ========================================================= */
.ff-reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ff-card-gap);
}

.ff-review-card {
    background: var(--ff-warm);
    border-radius: 12px;
    padding: 32px;
}

.ff-review-card .ff-review-stars {
    color: #f5a623;
    font-size: 1rem;
    margin-bottom: 16px;
}

.ff-review-card blockquote {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ff-text);
    margin: 0 0 16px;
    font-style: normal;
}

.ff-review-card .ff-reviewer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ff-review-card .ff-reviewer img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.ff-review-card .ff-reviewer-name {
    font-weight: var(--ff-font-weight-semibold);
    font-size: 0.9rem;
}

.ff-review-card .ff-reviewer-product {
    font-size: 0.8rem;
    color: var(--ff-text-muted);
}

/* =========================================================
   CTA / Newsletter Section
   ========================================================= */
.ff-cta-section {
    background: var(--ff-primary);
    border-radius: 16px;
    padding: 64px 56px;
    text-align: center;
    color: var(--ff-white);
}

.ff-cta-section h2 {
    color: var(--ff-white);
    font-size: 2rem;
    margin-bottom: 12px;
}

.ff-cta-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.ff-cta-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    max-width: 480px;
    margin: 0 auto;
}

.ff-cta-form input[type="email"] {
    flex: 1;
    padding: 16px 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-size: 1rem;
    font-family: var(--ff-font);
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.ff-cta-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.ff-cta-form input[type="email"]:focus {
    border-color: var(--ff-accent);
    background: rgba(255, 255, 255, 0.15);
}

.ff-cta-form button {
    padding: 16px 36px;
    background: var(--ff-accent);
    color: var(--ff-white);
    border: none;
    border-radius: 50px;
    font-weight: var(--ff-font-weight-semibold);
    font-size: 0.95rem;
    cursor: pointer;
    font-family: var(--ff-font);
    transition: background var(--ff-transition);
}

.ff-cta-form button:hover {
    background: var(--ff-accent-hover);
}

/* =========================================================
   Footer
   ========================================================= */
footer[data-id="footer"] {
    background: var(--ff-primary);
    color: rgba(255, 255, 255, 0.7);
}

footer[data-id="footer"] a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--ff-transition);
}

footer[data-id="footer"] a:hover {
    color: var(--ff-white);
}

/* =========================================================
   WooCommerce Overrides
   ========================================================= */

/* Product page — vertical gallery */
.single-product .woocommerce-product-gallery {
    max-width: 100%;
}

/* Sticky add-to-cart bar */
.ct-sticky-add-to-cart {
    background: var(--ff-white);
    border-top: 1px solid var(--ff-mid-gray);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Add to cart button */
.single_add_to_cart_button,
.woocommerce .button.alt {
    background: var(--ff-accent) !important;
    border-radius: 50px !important;
    font-family: var(--ff-font) !important;
    font-weight: var(--ff-font-weight-semibold) !important;
    padding: 14px 32px !important;
    transition: background var(--ff-transition) !important;
}

.single_add_to_cart_button:hover,
.woocommerce .button.alt:hover {
    background: var(--ff-accent-hover) !important;
}

/* Product tabs */
.woocommerce-tabs .tabs li.active a {
    color: var(--ff-accent);
    border-bottom-color: var(--ff-accent);
}

/* Shop page — product card hover */
.woocommerce ul.products li.product {
    transition: box-shadow var(--ff-transition);
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Price styling */
.woocommerce .price {
    font-weight: var(--ff-font-weight-semibold);
    color: var(--ff-primary);
}

/* =========================================================
   WordPress Block Editor Overrides
   ========================================================= */

/* Reset block margins that Blocksy/Gutenberg add */
.entry-content .wp-block-group + .wp-block-group {
    margin-top: 0;
}

/* Fix blockquote styling in review cards */
.ff-review-card .wp-block-quote {
    border-left: none;
    padding-left: 0;
    margin: 0 0 16px;
}

/* Fix columns gap in Blocksy context */
.entry-content .wp-block-columns.ff-categories,
.entry-content .wp-block-columns.ff-reviews-grid {
    gap: var(--ff-card-gap);
}

/* Review stars - convert asterisks to stars */
.ff-review-stars {
    color: #f5a623;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

/* Fix cover blocks inside Blocksy entry-content */
.entry-content .wp-block-cover.ff-cat-cover {
    min-height: 300px;
}

/* =========================================================
   Responsive
   ========================================================= */

/* --- Tablet (max 999px) --- */
@media (max-width: 999px) {
    .ff-category-products .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }

    .ff-category-products .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.82rem;
    }

    .ff-category-products .woocommerce ul.products li.product .button,
    .ff-category-products .woocommerce ul.products li.product a.add_to_cart_button,
    .ff-category-products .woocommerce ul.products li.product a.product_type_variable {
        padding: 9px 12px;
        font-size: 0.78rem;
    }

    .ff-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ff-hero-content h1 {
        font-size: 2.25rem;
    }

    .ff-hero {
        min-height: 400px !important;
    }

    /* Category cards: 2 cols on tablet */
    .wp-block-columns.ff-categories {
        flex-wrap: wrap !important;
    }

    .wp-block-columns.ff-categories > .wp-block-column {
        flex-basis: calc(50% - 12px) !important;
        flex-grow: 0 !important;
    }
}

/* --- Mobile (max 767px) --- */
@media (max-width: 767px) {
    :root {
        --ff-section-gap: 48px;
    }

    /* Hero: stack content, reduce height */
    .ff-hero {
        min-height: 320px !important;
    }

    .ff-hero .wp-block-cover__inner-container {
        padding: 0 !important;
    }

    .ff-hero-content {
        padding: 32px 20px !important;
        max-width: 100% !important;
    }

    .ff-hero-content h1 {
        font-size: 1.75rem;
        margin-bottom: 8px !important;
    }

    .ff-hero-content p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .ff-hero-ctas {
        flex-direction: column;
    }

    .ff-hero-ctas .wp-block-button {
        width: 100%;
    }

    .ff-hero-ctas .wp-block-button__link {
        display: block;
        text-align: center;
        width: 100%;
        padding: 12px 24px !important;
    }

    .ff-btn-primary,
    .ff-btn-secondary {
        text-align: center;
    }

    /* ==============================================
       Category Pages — Mobile Full-Width Layout
       ============================================== */

    /* Force all category sections to break out of constrained layout */
    .ff-category-hero,
    .ff-category-trust,
    .ff-category-content,
    .ff-category-products,
    .ff-category-faq,
    .ff-category-links,
    .ff-cta-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Override Blocksy constrained layout on category pages */
    body.page .entry-content > .wp-block-group.ff-category-hero,
    body.page .entry-content > .wp-block-group.ff-category-trust,
    body.page .entry-content > .wp-block-group.ff-category-content,
    body.page .entry-content > .wp-block-group.ff-category-products,
    body.page .entry-content > .wp-block-group.ff-category-faq,
    body.page .entry-content > .wp-block-group.ff-category-links,
    body.page .entry-content > .wp-block-group.ff-cta-section {
        max-width: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Hero — edge-to-edge lavender banner, centered text */
    .ff-category-hero {
        padding: 32px 20px !important;
        text-align: center;
    }

    .ff-category-hero h1 {
        font-size: 1.5rem !important;
        text-align: center;
        line-height: 1.2 !important;
        margin-bottom: 10px !important;
    }

    .ff-category-hero p {
        font-size: 0.9rem !important;
        text-align: center;
        max-width: 100% !important;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.5;
    }

    /* Trust bar — 2x2 centered grid, edge-to-edge */
    .ff-category-trust {
        padding: 14px 16px !important;
    }

    .ff-category-trust .ff-trust-items {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px 12px;
        justify-items: center;
        max-width: 100%;
    }

    .ff-category-trust .ff-trust-item {
        justify-content: center;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .ff-category-trust .ff-trust-text {
        font-size: 0.78rem !important;
    }

    /* Content section — full-width with comfortable reading padding */
    .ff-category-content {
        padding: 28px 20px !important;
    }

    .ff-category-content h2 {
        font-size: 1.2rem;
        margin-top: 24px;
        margin-bottom: 12px;
    }

    .ff-category-content p {
        font-size: 0.88rem;
        line-height: 1.6;
        margin-bottom: 12px;
    }

    /* Product grid — 2 columns, edge-to-edge */
    .ff-category-products {
        padding: 28px 12px !important;
    }

    .ff-category-products h2 {
        font-size: 1.3rem !important;
        text-align: center;
        margin-bottom: 20px !important;
    }

    .ff-category-products .woocommerce {
        max-width: 100% !important;
    }

    .ff-category-products .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .ff-category-products .woocommerce ul.products li.product {
        border-radius: 12px;
        width: 100% !important;
    }

    .ff-category-products .woocommerce ul.products li.product .attachment-woocommerce_thumbnail,
    .ff-category-products .woocommerce ul.products li.product a > img {
        padding: 14px 10px;
        border-radius: 12px 12px 0 0;
        aspect-ratio: 4 / 3;
    }

    .ff-category-products .woocommerce ul.products li.product figure {
        margin: 0 !important;
    }

    .ff-category-products .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.76rem;
        padding: 8px 10px 2px;
        text-align: center;
    }

    .ff-category-products .woocommerce ul.products li.product .price {
        font-size: 0.85rem;
        padding: 2px 10px 4px;
        text-align: center;
    }

    .ff-category-products .woocommerce ul.products li.product .ff-card-colors {
        justify-content: center;
        padding: 0 10px;
    }

    .ff-category-products .woocommerce ul.products li.product .button,
    .ff-category-products .woocommerce ul.products li.product a.add_to_cart_button,
    .ff-category-products .woocommerce ul.products li.product a.product_type_variable {
        width: calc(100% - 20px);
        margin: auto 10px 10px;
        padding: 9px 10px;
        font-size: 0.72rem;
    }

    .ff-category-products .ff-try-on-btn {
        opacity: 1;
        transform: none;
    }

    /* FAQ — edge-to-edge background, padded content */
    .ff-category-faq {
        border-radius: 0 !important;
        padding: 36px 28px !important;
    }

    .ff-category-faq h2 {
        text-align: center;
        font-size: 1.2rem;
    }

    .ff-faq-question {
        font-size: 0.9rem;
    }

    .ff-faq-answer {
        font-size: 0.88rem;
    }

    /* Internal links — centered, compact */
    .ff-category-links {
        padding: 28px 16px !important;
    }

    .ff-category-links h2 {
        font-size: 1.2rem;
    }

    .ff-category-links .wp-block-buttons {
        gap: 8px;
        justify-content: center !important;
    }

    .ff-category-link .wp-block-button__link {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }

    /* CTA — full-width edge-to-edge */
    .ff-cta-section {
        border-radius: 0 !important;
        padding: 44px 28px !important;
    }

    .ff-cta-section h2 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    .ff-cta-section p {
        font-size: 0.92rem;
        margin-bottom: 24px;
        line-height: 1.6;
    }

    .ff-cta-section .wp-block-button__link {
        padding: 12px 28px !important;
        font-size: 0.9rem !important;
    }

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

    /* Trust bar: 2x2 grid on mobile */
    .ff-trust-items {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px 16px;
        padding: 0 20px;
    }

    .ff-trust-item {
        white-space: normal;
        font-size: 0.8rem;
    }

    .ff-trust-text {
        font-size: 0.8rem !important;
    }

    /* Filter bar: horizontal scroll */
    .ff-filter-bar {
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .ff-filter-group {
        flex-shrink: 0;
    }

    /* Categories: single column stack */
    .wp-block-columns.ff-categories {
        flex-direction: column !important;
    }

    .wp-block-columns.ff-categories > .wp-block-column {
        flex-basis: 100% !important;
    }

    .entry-content .wp-block-cover.ff-cat-cover {
        min-height: 200px;
    }

    /* Reviews: single column */
    .wp-block-columns.ff-reviews-grid {
        flex-direction: column !important;
    }

    .ff-review-card {
        padding: 24px;
    }

    .ff-cta-form {
        flex-direction: column;
    }

    .ff-section-header {
        flex-direction: column;
        gap: 16px;
    }

    /* Always show try-on button on mobile (no hover) */
    .ff-try-on-btn {
        opacity: 1;
        transform: none;
    }

    /* Card info adjustments */
    .ff-card-info {
        padding: 12px;
    }

    .ff-card-info .ff-product-name {
        font-size: 0.85rem;
    }

    .ff-card-info .ff-product-price {
        font-size: 0.85rem;
    }

    /* CTA section: less padding */
    .ff-cta-section {
        padding: 40px 20px;
        border-radius: 12px;
    }

    .ff-cta-section h2 {
        font-size: 1.5rem;
    }

    /* Section padding reduction */
    .ff-section {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* =========================================================
   Category Landing Pages
   ========================================================= */

/* Hide default page title on category pages */
body.page .ff-category-hero ~ .entry-header,
body.page:has(.ff-category-hero) .entry-header,
body.page:has(.ff-category-hero) .page-title {
    display: none !important;
}

/* Hero section */
.ff-category-hero {
    border-bottom: 1px solid var(--ff-mid-gray);
}

.ff-category-hero h1 {
    color: var(--ff-primary);
    margin-bottom: 12px;
    line-height: 1.15;
}

.ff-category-hero p {
    color: var(--ff-text-light);
    line-height: 1.6;
    max-width: 720px;
}

/* Category trust bar */
.ff-category-trust {
    border-bottom: 1px solid var(--ff-mid-gray);
}

/* Content section */
.ff-category-content h2 {
    margin-top: 40px;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.ff-category-content p {
    color: var(--ff-text);
    line-height: 1.7;
    margin-bottom: 16px;
}

/* =========================================================
   Category Products — Modern Eyewear Grid
   ========================================================= */
.ff-category-products h2 {
    margin-bottom: 32px;
    font-size: 1.75rem;
    text-align: center;
}

.ff-category-products .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ff-category-products .woocommerce ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    background: var(--ff-white);
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ff-category-products .woocommerce ul.products li.product:hover {
    box-shadow: 0 12px 40px rgba(59, 107, 229, 0.14);
    transform: translateY(-4px);
}

/* Product image container — prevent Blocksy clipping */
.ff-category-products .woocommerce ul.products li.product figure,
.ff-category-products .woocommerce ul.products li.product .ct-media-container {
    overflow: visible !important;
    margin: 0 !important;
    background: var(--ff-accent-light);
    border-radius: 16px 16px 0 0;
}

.ff-category-products .woocommerce ul.products li.product figure::before,
.ff-category-products .woocommerce ul.products li.product figure::after,
.ff-category-products .woocommerce ul.products li.product .ct-media-container::before,
.ff-category-products .woocommerce ul.products li.product .ct-media-container::after {
    display: none !important;
}

/* Product image — contained, never clipped */
.ff-category-products .woocommerce ul.products li.product .attachment-woocommerce_thumbnail,
.ff-category-products .woocommerce ul.products li.product a > img,
.ff-category-products .woocommerce ul.products li.product .ct-media-container img {
    background: var(--ff-accent-light);
    border-radius: 16px 16px 0 0;
    padding: 20px 24px;
    object-fit: contain !important;
    object-position: center !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 4 / 3;
    display: block;
    transition: transform 0.4s ease;
    position: relative !important;
}

.ff-category-products .woocommerce ul.products li.product:hover .attachment-woocommerce_thumbnail,
.ff-category-products .woocommerce ul.products li.product:hover a > img {
    transform: scale(1.05);
}

/* Product info area */
.ff-category-products .woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Product title */
.ff-category-products .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--ff-font);
    font-size: 0.88rem;
    font-weight: var(--ff-font-weight-normal);
    color: var(--ff-text);
    padding: 14px 16px 4px;
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.ff-category-products .woocommerce ul.products li.product:hover .woocommerce-loop-product__title {
    color: var(--ff-accent);
}

/* Product price */
.ff-category-products .woocommerce ul.products li.product .price {
    font-family: var(--ff-font);
    font-size: 1rem;
    font-weight: var(--ff-font-weight-semibold);
    color: var(--ff-primary);
    padding: 2px 16px 6px;
    margin: 0;
}

.ff-category-products .woocommerce ul.products li.product .price del {
    color: var(--ff-text-muted);
    font-weight: var(--ff-font-weight-normal);
    font-size: 0.82rem;
    margin-right: 4px;
}

.ff-category-products .woocommerce ul.products li.product .price ins {
    text-decoration: none;
    color: var(--ff-accent);
    font-weight: var(--ff-font-weight-semibold);
}

/* Color swatches under price */
.ff-category-products .woocommerce ul.products li.product .ff-card-colors {
    padding: 0 16px;
    margin-bottom: 6px;
}

/* Star rating */
.ff-category-products .woocommerce ul.products li.product .ff-card-rating {
    padding: 0 16px;
    margin-bottom: 8px;
}

/* Select options / Add to cart button */
.ff-category-products .woocommerce ul.products li.product .button,
.ff-category-products .woocommerce ul.products li.product a.add_to_cart_button,
.ff-category-products .woocommerce ul.products li.product a.product_type_variable {
    display: block;
    width: calc(100% - 32px);
    margin: auto 16px 16px;
    padding: 11px 16px;
    background: transparent;
    color: var(--ff-accent);
    border: 2px solid var(--ff-accent);
    border-radius: 50px;
    font-family: var(--ff-font);
    font-size: 0.82rem;
    font-weight: var(--ff-font-weight-semibold);
    text-align: center;
    text-transform: none;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    line-height: 1;
}

.ff-category-products .woocommerce ul.products li.product .button:hover,
.ff-category-products .woocommerce ul.products li.product a.add_to_cart_button:hover,
.ff-category-products .woocommerce ul.products li.product a.product_type_variable:hover {
    background: var(--ff-accent);
    color: var(--ff-white);
    border-color: var(--ff-accent);
}

/* Sale badge */
.ff-category-products .woocommerce ul.products li.product .onsale {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: var(--ff-accent);
    color: var(--ff-white);
    font-size: 0.72rem;
    font-weight: var(--ff-font-weight-semibold);
    font-family: var(--ff-font);
    padding: 4px 12px;
    border-radius: 50px;
    line-height: 1.4;
    min-height: auto;
    min-width: auto;
    letter-spacing: 0.03em;
}

/* Try-on button */
.ff-category-products .ff-try-on-btn {
    opacity: 0;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 0.78rem;
    border: 1px solid var(--ff-mid-gray);
    transition: opacity 0.25s ease, transform 0.2s ease;
    transform: translateY(-4px);
}

.ff-category-products li.product:hover .ff-try-on-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Hide category meta tags on product cards */
.ff-category-products .woocommerce ul.products li.product .entry-meta,
.ff-category-products .woocommerce ul.products li.product .meta-categories,
.ff-category-products .woocommerce ul.products li.product .posted_in,
.ff-category-products .woocommerce ul.products li.product .tagged_as,
.ff-category-products .woocommerce ul.products li.product [data-type="simple"] {
    display: none !important;
}

/* Blocksy quick view / compare / wishlist extras */
.ff-category-products .woocommerce ul.products li.product .ct-woo-card-extra {
    padding: 0 16px 8px;
}

/* FAQ section on category pages */
.ff-category-faq {
    border-radius: 12px;
    padding: 56px 56px !important;
}

.ff-category-faq h2 {
    margin-bottom: 28px;
}

.ff-faq-list {
    max-width: 100%;
}

.ff-faq-item {
    border-bottom: 1px solid var(--ff-mid-gray);
    padding: 20px 12px;
}

.ff-faq-item:last-child {
    border-bottom: none;
}

.ff-faq-question {
    font-weight: var(--ff-font-weight-semibold);
    font-size: 1rem;
    color: var(--ff-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    padding: 4px 8px;
}

.ff-faq-question::-webkit-details-marker {
    display: none;
}

.ff-faq-question::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: var(--ff-font-weight-normal);
    color: var(--ff-text-muted);
    flex-shrink: 0;
    margin-left: 16px;
    transition: transform var(--ff-transition);
}

details.ff-faq-item[open] > .ff-faq-question::after {
    content: '\2212';
}

.ff-faq-answer {
    padding: 10px 12px 8px;
    line-height: 1.65;
    color: var(--ff-text);
}

.ff-faq-answer p {
    margin: 0;
}

/* Internal links section */
.ff-category-links h2 {
    text-align: center;
    margin-bottom: 24px;
}

.ff-category-links .wp-block-buttons {
    gap: 12px;
}

.ff-category-link .wp-block-button__link {
    border-color: var(--ff-primary) !important;
    color: var(--ff-primary) !important;
    border-radius: 50px !important;
    padding: 10px 24px !important;
    font-size: 0.9rem !important;
    transition: all var(--ff-transition) !important;
}

.ff-category-link .wp-block-button__link:hover {
    background: var(--ff-primary) !important;
    color: var(--ff-white) !important;
}

/* --- Small phone (max 479px) --- */
@media (max-width: 479px) {
    .ff-hero {
        min-height: 280px !important;
    }

    .ff-hero-content h1 {
        font-size: 1.4rem;
    }

    .ff-hero-content p {
        font-size: 0.85rem;
    }

    /* Trust bar: single column on very small screens */
    .ff-trust-items {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .ff-trust-item {
        justify-content: center;
    }

    /* Category hero */
    .ff-category-hero h1 {
        font-size: 1.35rem !important;
    }

    /* Product grid — keep 2 cols but tighter */
    .ff-category-products .woocommerce ul.products {
        gap: 8px !important;
    }

    .ff-category-products .woocommerce ul.products li.product .attachment-woocommerce_thumbnail,
    .ff-category-products .woocommerce ul.products li.product a > img {
        padding: 12px 8px;
    }

    .ff-category-products .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.72rem;
        padding: 6px 8px 2px;
    }

    .ff-category-products .woocommerce ul.products li.product .price {
        font-size: 0.78rem;
        padding: 2px 8px 4px;
    }

    .ff-category-products .woocommerce ul.products li.product .button,
    .ff-category-products .woocommerce ul.products li.product a.add_to_cart_button,
    .ff-category-products .woocommerce ul.products li.product a.product_type_variable {
        width: calc(100% - 16px);
        margin: auto 8px 8px;
        padding: 7px 8px;
        font-size: 0.68rem;
    }

    .ff-product-grid {
        gap: 12px;
    }

    .ff-card-info {
        padding: 10px;
    }

    .ff-cta-section h2 {
        font-size: 1.2rem;
    }
}
