/**
 * Cartemio Frontend Stylesheet - Grid Layout, Brand Aesthetics, WebP & Lazy Loading
 */

:root {
    --cartemio-cream: #FBF9F4;
    --cartemio-cream-warm: #F4EFE6;
    --cartemio-forest: #1E392A;
    --cartemio-forest-dark: #14271C;
    --cartemio-forest-light: #2C523C;
    --cartemio-charcoal: #22252A;
    --cartemio-charcoal-light: #4A4F55;
    --cartemio-muted: #6E747B;
    --cartemio-border: #E6DFD5;
    --cartemio-terracotta: #C26343;
    --cartemio-terracotta-hover: #A64E31;
    --cartemio-sand: #EFE9DE;
}

/* ==========================================================================
   HOMEPAGE & ARCHIVE PRODUCT GRID
   ========================================================================== */

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

@media (max-width: 1100px) {
    .woocommerce ul.products,
    .cartemio-curated-grid ul.products,
    ul.products.columns-4 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 820px) {
    .woocommerce ul.products,
    .cartemio-curated-grid ul.products,
    ul.products.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 580px) {
    .woocommerce ul.products,
    .cartemio-curated-grid ul.products,
    ul.products.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .woocommerce ul.products li.product,
    .woocommerce-page ul.products li.product {
        padding: 10px !important;
        border-radius: 10px !important;
    }
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        height: 2.6em !important;
        min-height: 2.6em !important;
        margin-bottom: 6px !important;
    }
    .woocommerce ul.products li.product .price {
        font-size: 1.02rem !important;
        margin-bottom: 8px !important;
    }
    .woocommerce ul.products li.product .button,
    .woocommerce ul.products li.product a.button.add_to_cart_button {
        padding: 8px 8px !important;
        font-size: 0.8rem !important;
        border-radius: 4px !important;
    }
}

@media (max-width: 360px) {
    .woocommerce ul.products,
    .cartemio-curated-grid ul.products,
    ul.products.columns-4 {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}

/* Clear float bugs from legacy WooCommerce themes */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

/* ==========================================================================
   PRODUCT CARD STYLING & STRICT EQUAL IMAGE SIZING
   ========================================================================== */

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
    background: #FFFFFF !important;
    border: 1px solid var(--cartemio-border) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease !important;
    position: relative !important;
    box-sizing: border-box !important;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 14px 30px rgba(30, 57, 42, 0.12) !important;
    border-color: var(--cartemio-forest) !important;
}

/* THUMBNAIL WRAPPER: STRICT EQUAL SQUARE RATIO ON ALL SCREEN SIZES */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
.woocommerce ul.products li.product .woocommerce-loop-product__thumbnail,
.woocommerce ul.products li.product .attachment-woocommerce_thumbnail_container {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background-color: #F8F6F0 !important;
    margin: 0 0 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Link wrapper */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap a.woocommerce-LoopProduct-link,
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap a.woocommerce-loop-product__link,
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
}

/* Strict uniform responsive image display */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img,
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product img.attachment-woocommerce_thumbnail,
.woocommerce ul.products li.product img.size-woocommerce_thumbnail {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 8px !important;
    margin: 0 !important;
    display: block !important;
    aspect-ratio: 1 / 1 !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.woocommerce ul.products li.product:hover .astra-shop-thumbnail-wrap img,
.woocommerce ul.products li.product:hover a img {
    transform: scale(1.06) !important;
}

/* SUMMARY WRAPPER: BALANCED SPACING & ALIGNMENT */
.woocommerce ul.products li.product .astra-shop-summary-wrap {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-top: 0 !important;
}

/* Category taxonomy pill */
.woocommerce ul.products li.product .ast-woo-product-category {
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: var(--cartemio-terracotta) !important;
    margin-bottom: 6px !important;
    display: block !important;
}

/* Product Card Title */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--cartemio-font-serif, "Playfair Display", Georgia, serif) !important;
    font-size: 1.02rem !important;
    font-weight: 600 !important;
    color: var(--cartemio-forest) !important;
    line-height: 1.35 !important;
    margin: 0 0 10px !important;
    height: 2.7em !important;
    min-height: 2.7em !important;
    max-height: 2.7em !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Product Card Price */
.woocommerce ul.products li.product .price {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: var(--cartemio-charcoal) !important;
    margin-bottom: 14px !important;
    display: block !important;
}

/* Add to Cart Button on Card */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.button.add_to_cart_button {
    background-color: var(--cartemio-forest) !important;
    color: #FFFFFF !important;
    border: 1px solid var(--cartemio-forest) !important;
    border-radius: 6px !important;
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    margin-top: auto !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product a.button.add_to_cart_button:hover {
    background-color: var(--cartemio-terracotta) !important;
    border-color: var(--cartemio-terracotta) !important;
    box-shadow: 0 4px 12px rgba(194, 99, 67, 0.25) !important;
}

/* On Sale Badge */
.woocommerce ul.products li.product span.onsale {
    position: absolute !important;
    top: 24px !important;
    left: 24px !important;
    background-color: var(--cartemio-terracotta) !important;
    color: #FFFFFF !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    z-index: 3 !important;
    line-height: 1 !important;
}

/* ==========================================================================
   HOMEPAGE FEATURED CATEGORIES SECTION
   ========================================================================== */

.cartemio-categories-section {
    margin-bottom: 60px !important;
}

.cartemio-section-header {
    text-align: center !important;
    max-width: 680px !important;
    margin: 0 auto 36px !important;
}

.cartemio-section-tag {
    display: inline-block !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.14em !important;
    color: var(--cartemio-terracotta) !important;
    margin-bottom: 8px !important;
}

.cartemio-section-title {
    font-family: var(--cartemio-font-serif, "Playfair Display", Georgia, serif) !important;
    font-size: clamp(1.8rem, 3.5vw, 2.4rem) !important;
    color: var(--cartemio-forest) !important;
    margin: 0 0 10px !important;
    line-height: 1.2 !important;
}

.cartemio-section-subtitle {
    color: var(--cartemio-muted) !important;
    font-size: 1.02rem !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

.cartemio-categories-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 26px !important;
}

@media (max-width: 990px) {
    .cartemio-categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 600px) {
    .cartemio-categories-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
}

.cartemio-cat-card {
    display: flex !important;
    flex-direction: column !important;
    background: #FFFFFF !important;
    border: 1px solid var(--cartemio-border) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.cartemio-cat-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 36px rgba(30, 57, 42, 0.12) !important;
    border-color: var(--cartemio-forest) !important;
}

.cartemio-cat-thumb-wrap {
    position: relative !important;
    width: 100% !important;
    height: 210px !important;
    overflow: hidden !important;
    background-color: var(--cartemio-cream-warm) !important;
}

.cartemio-cat-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.cartemio-cat-card:hover .cartemio-cat-img {
    transform: scale(1.06) !important;
}

.cartemio-cat-pill {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(6px) !important;
    color: var(--cartemio-forest) !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    letter-spacing: 0.04em !important;
}

.cartemio-cat-content {
    padding: 22px 24px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}

.cartemio-cat-sub {
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: var(--cartemio-terracotta) !important;
    margin-bottom: 6px !important;
    display: block !important;
}

.cartemio-cat-title {
    font-family: var(--cartemio-font-serif, "Playfair Display", Georgia, serif) !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--cartemio-forest) !important;
    margin: 0 0 8px !important;
    line-height: 1.25 !important;
}

.cartemio-cat-desc {
    color: var(--cartemio-muted) !important;
    font-size: 0.88rem !important;
    line-height: 1.55 !important;
    margin: 0 0 18px !important;
    flex-grow: 1 !important;
}

.cartemio-cat-link {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: var(--cartemio-forest) !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    transition: color 0.2s ease !important;
    margin-top: auto !important;
}

.cartemio-cat-card:hover .cartemio-cat-link {
    color: var(--cartemio-terracotta) !important;
}

.cartemio-arrow {
    transition: transform 0.2s ease !important;
}

.cartemio-cat-card:hover .cartemio-arrow {
    transform: translateX(4px) !important;
}

/* ==========================================================================
   HOMEPAGE: REMOVE PAGE TITLE "HOME"
   ========================================================================== */

.home .entry-header,
.home h1.entry-title,
.home .ast-single-post-order .entry-header,
body.home header.entry-header,
body.page-id-35 .entry-header,
body.page-id-35 h1.entry-title {
    display: none !important;
}

/* ==========================================================================
   HEADER SHOPPING CART ICON & BADGE
   ========================================================================== */

.cartemio-menu-cart-item {
    display: flex !important;
    align-items: center !important;
    margin-left: 10px !important;
}

.cartemio-cart-nav-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: var(--cartemio-forest) !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease !important;
}

.cartemio-cart-nav-link:hover {
    color: var(--cartemio-terracotta) !important;
    background-color: var(--cartemio-cream-warm) !important;
    transform: translateY(-1px) !important;
}

.cartemio-cart-nav-icon {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cartemio-cart-svg {
    stroke: currentColor !important;
    width: 22px !important;
    height: 22px !important;
    display: block !important;
    transition: stroke 0.2s ease !important;
}

.cartemio-cart-badge-count {
    position: absolute !important;
    top: -8px !important;
    right: -10px !important;
    background-color: var(--cartemio-terracotta) !important;
    color: #FFFFFF !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    min-width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
    border-radius: 9px !important;
    text-align: center !important;
    padding: 0 4px !important;
    box-shadow: 0 2px 6px rgba(194, 99, 67, 0.4) !important;
    letter-spacing: -0.02em !important;
}

/* Mobile Header Cart Trigger */
.cartemio-mobile-cart-trigger {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 12px !important;
}

.cartemio-mobile-cart-trigger .cartemio-cart-nav-link {
    padding: 6px !important;
}

/* ==========================================================================
   CART PAGE ICONS & LAYOUT MARGIN FIX
   ========================================================================== */

/* Cart Table - Remove Product Icon */
.woocommerce table.cart td.product-remove,
.woocommerce-page table.cart td.product-remove {
    width: 38px !important;
    padding: 16px 8px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.woocommerce table.cart a.remove,
.woocommerce-page table.cart a.remove {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    line-height: 1 !important;
    border-radius: 50% !important;
    color: var(--cartemio-muted) !important;
    background: #F4EFE6 !important;
    border: 1px solid var(--cartemio-border) !important;
    text-decoration: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.woocommerce table.cart a.remove:hover,
.woocommerce-page table.cart a.remove:hover {
    color: #FFFFFF !important;
    background: var(--cartemio-terracotta) !important;
    border-color: var(--cartemio-terracotta) !important;
    transform: scale(1.08) !important;
}

.woocommerce table.cart a.remove svg,
.woocommerce-page table.cart a.remove svg,
.woocommerce table.cart a.remove .ahfb-svg-iconset svg,
.woocommerce-page table.cart a.remove .ahfb-svg-iconset svg {
    width: 13px !important;
    height: 13px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    fill: currentColor !important;
}

.woocommerce table.cart a.remove .ahfb-svg-iconset,
.woocommerce-page table.cart a.remove .ahfb-svg-iconset {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Cart Table - Product Thumbnail */
.woocommerce table.cart td.product-thumbnail,
.woocommerce-page table.cart td.product-thumbnail {
    width: 80px !important;
    padding: 14px 10px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.woocommerce table.cart td.product-thumbnail img,
.woocommerce-page table.cart td.product-thumbnail img {
    width: 64px !important;
    height: 64px !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    margin: 0 auto !important;
    display: block !important;
    border: 1px solid var(--cartemio-border) !important;
}

/* Cart Table - Quantity Input Margin Fix */
.woocommerce table.cart td.product-quantity,
.woocommerce-page table.cart td.product-quantity {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 14px 10px !important;
}

.woocommerce table.cart td.product-quantity .quantity,
.woocommerce-page table.cart td.product-quantity .quantity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
}

.woocommerce table.cart td.product-quantity input.qty,
.woocommerce-page table.cart td.product-quantity input.qty {
    width: 58px !important;
    height: 38px !important;
    line-height: 38px !important;
    text-align: center !important;
    border: 1px solid var(--cartemio-border) !important;
    border-radius: 6px !important;
    padding: 0 6px !important;
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: var(--cartemio-charcoal) !important;
    background: #FFFFFF !important;
}

/* Cart Table - Actions & Coupon Area */
.woocommerce table.cart td.actions,
.woocommerce-page table.cart td.actions {
    padding: 18px 14px !important;
    vertical-align: middle !important;
}

.woocommerce table.cart td.actions .coupon,
.woocommerce-page table.cart td.actions .coupon {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce table.cart td.actions .coupon input#coupon_code {
    width: 170px !important;
    height: 40px !important;
    border: 1px solid var(--cartemio-border) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin: 0 !important;
    font-size: 0.9rem !important;
}

.woocommerce table.cart td.actions .coupon button.button {
    height: 40px !important;
    line-height: 38px !important;
    padding: 0 18px !important;
    margin: 0 !important;
    font-size: 0.88rem !important;
    background: #FFFFFF !important;
    color: var(--cartemio-forest) !important;
    border: 1px solid var(--cartemio-forest) !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

.woocommerce table.cart td.actions .coupon button.button:hover {
    background: var(--cartemio-forest) !important;
    color: #FFFFFF !important;
}

.woocommerce table.cart td.actions button[name="update_cart"] {
    height: 40px !important;
    line-height: 38px !important;
    padding: 0 20px !important;
    margin: 0 !important;
    background: #F4EFE6 !important;
    color: var(--cartemio-forest) !important;
    border: 1px solid var(--cartemio-border) !important;
    border-radius: 6px !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
}

/* WooCommerce Notices (Info & Error) Icon Margin Fix */
.woocommerce .woocommerce-info,
.woocommerce-page .woocommerce-info,
.woocommerce .woocommerce-message,
.woocommerce-page .woocommerce-message {
    padding: 16px 20px 16px 48px !important;
    border-radius: 8px !important;
    border-top: 3px solid var(--cartemio-forest) !important;
    background: var(--cartemio-cream) !important;
    color: var(--cartemio-charcoal) !important;
    position: relative !important;
    margin: 0 0 24px !important;
    line-height: 1.6 !important;
}

.woocommerce .woocommerce-info::before,
.woocommerce-page .woocommerce-info::before,
.woocommerce .woocommerce-message::before,
.woocommerce-page .woocommerce-message::before {
    color: var(--cartemio-forest) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: 18px !important;
    margin: 0 !important;
    font-size: 1.15rem !important;
    line-height: 1 !important;
}

/* Nav Menu Dropdown Arrow Margin Fix */
.main-header-menu .menu-item .ast-icon.icon-arrow {
    margin-left: 6px !important;
    margin-right: 0 !important;
    display: inline-flex !important;
    vertical-align: middle !important;
}

.main-header-menu .menu-item:not(.menu-item-has-children) .ast-icon.icon-arrow {
    display: none !important;
}

/* ==========================================================================
   TOP ANNOUNCEMENT & CONTACT UTILITY BAR
   ========================================================================== */

.cartemio-top-bar {
    background-color: var(--cartemio-forest-dark) !important;
    color: #FBF9F4 !important;
    font-size: 0.82rem !important;
    padding: 8px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    position: relative !important;
    z-index: 99 !important;
}

.cartemio-top-bar-inner {
    max-width: 1240px !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

.cartemio-top-bar-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.cartemio-top-shipping {
    font-weight: 600 !important;
    color: #F4EFE6 !important;
    letter-spacing: 0.02em !important;
}

.cartemio-phone-link {
    color: #FBF9F4 !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    transition: color 0.2s ease !important;
}

.cartemio-phone-link:hover {
    color: var(--cartemio-terracotta) !important;
}

.cartemio-hours {
    color: #A3ACA5 !important;
    font-size: 0.78rem !important;
}

@media (max-width: 820px) {
    .cartemio-top-bar-inner {
        justify-content: center !important;
        text-align: center !important;
        gap: 8px !important;
    }
    .cartemio-top-address {
        display: none !important;
    }
}

/* ==========================================================================
   FOOTER US COMPANY & HEADQUARTERS SECTION
   ========================================================================== */

.cartemio-footer-company-section {
    background-color: #14271C !important;
    color: #E2DDD5 !important;
    padding: 56px 20px 48px !important;
    border-top: 1px solid #233F2E !important;
}

.cartemio-footer-container {
    max-width: 1240px !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: 1.4fr 1.2fr 1.4fr !important;
    gap: 40px !important;
}

@media (max-width: 900px) {
    .cartemio-footer-container {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
}

.cartemio-footer-logo-wrap {
    margin-bottom: 16px !important;
}

.cartemio-footer-logo-wrap svg {
    display: block !important;
}

.cartemio-footer-desc {
    color: #B5BEB7 !important;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
    max-width: 360px !important;
    margin: 0 !important;
}

.cartemio-footer-heading {
    font-family: var(--cartemio-font-serif, "Playfair Display", Georgia, serif) !important;
    color: #FFFFFF !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    margin: 0 0 16px !important;
    letter-spacing: 0.02em !important;
}

.cartemio-contact-list,
.cartemio-guarantee-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    font-size: 0.9rem !important;
    color: #D3CDC4 !important;
    line-height: 1.5 !important;
}

.cartemio-contact-list a {
    color: #F4EFE6 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.cartemio-contact-list a:hover {
    color: var(--cartemio-terracotta) !important;
}

.cartemio-contact-list strong {
    color: #FFFFFF !important;
    display: block !important;
    margin-bottom: 2px !important;
}

.cartemio-guarantee-list strong {
    color: #FFFFFF !important;
}

/* ==========================================================================
   ENHANCED CART DELETE BUTTON
   ========================================================================== */

.woocommerce table.cart a.cartemio-remove-item-btn,
.woocommerce-page table.cart a.cartemio-remove-item-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: auto !important;
    height: 36px !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    background-color: #F8F5EE !important;
    border: 1px solid #E2DDD5 !important;
    color: #8C5543 !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.woocommerce table.cart a.cartemio-remove-item-btn:hover,
.woocommerce-page table.cart a.cartemio-remove-item-btn:hover {
    background-color: var(--cartemio-terracotta) !important;
    border-color: var(--cartemio-terracotta) !important;
    color: #FFFFFF !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(194, 99, 67, 0.25) !important;
}

.cartemio-trash-icon {
    width: 15px !important;
    height: 15px !important;
    stroke: currentColor !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 !important;
    transition: stroke 0.2s ease !important;
}

.cartemio-remove-label {
    display: inline-block !important;
    vertical-align: middle !important;
    font-size: 0.82rem !important;
    line-height: 1 !important;
}

/* Header Logo Explicit Size Guarantee */
.site-branding .custom-logo-link,
.site-logo-img .custom-logo-link {
    display: inline-flex !important;
    align-items: center !important;
    min-width: 180px !important;
    min-height: 40px !important;
}

.site-branding .custom-logo-link svg,
.site-logo-img .custom-logo-link svg {
    display: block !important;
    width: 210px !important;
    height: 48px !important;
    max-height: 48px !important;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE RESPONSIVENESS & IMAGE OPTIMIZATION
   ========================================================================== */

/* Universal Responsive Image Guarantee */
img,
.woocommerce img,
.woocommerce-page img {
    max-width: 100% !important;
    height: auto !important;
}

/* 1. SINGLE PRODUCT PAGE RESPONSIVE GALLERY & DETAIL LAYOUT */
.woocommerce div.product .woocommerce-product-gallery,
.woocommerce-page div.product .woocommerce-product-gallery {
    margin-bottom: 24px !important;
}

.woocommerce div.product .woocommerce-product-gallery__wrapper,
.woocommerce div.product .woocommerce-product-gallery__image {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background-color: #F8F6F0 !important;
}

.woocommerce div.product .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 10px !important;
    display: block !important;
    box-shadow: 0 4px 16px rgba(30, 57, 42, 0.08) !important;
}

@media (max-width: 820px) {
    .woocommerce div.product .woocommerce-product-gallery,
    .woocommerce-page div.product .woocommerce-product-gallery,
    .woocommerce div.product div.images,
    .woocommerce-page div.product div.images {
        width: 100% !important;
        float: none !important;
        margin: 0 0 28px 0 !important;
    }
    
    .woocommerce div.product div.summary,
    .woocommerce-page div.product div.summary {
        width: 100% !important;
        float: none !important;
        padding-left: 0 !important;
    }

    .woocommerce div.product .product_title {
        font-size: 1.6rem !important;
        line-height: 1.25 !important;
    }

    .woocommerce div.product p.price,
    .woocommerce div.product span.price {
        font-size: 1.35rem !important;
    }

    .woocommerce div.product form.cart {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
    }

    .woocommerce div.product form.cart .quantity {
        margin-right: 0 !important;
    }

    .woocommerce div.product form.cart .quantity input.qty {
        width: 70px !important;
        height: 46px !important;
        font-size: 1.05rem !important;
    }

    .woocommerce div.product form.cart button.single_add_to_cart_button {
        flex: 1 !important;
        min-width: 180px !important;
        height: 46px !important;
        font-size: 1rem !important;
        padding: 0 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .cartemio-tab-content table.shop_attributes th,
    .cartemio-tab-content table.shop_attributes td {
        padding: 8px 6px !important;
        font-size: 0.88rem !important;
    }
}

/* 2. RESPONSIVE CART TABLE & TOTALS */
@media (max-width: 768px) {
    .woocommerce table.cart,
    .woocommerce-page table.cart {
        border: none !important;
        background: transparent !important;
    }

    .woocommerce table.cart thead,
    .woocommerce-page table.cart thead {
        display: none !important;
    }

    .woocommerce table.cart tbody,
    .woocommerce-page table.cart tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        width: 100% !important;
    }

    .woocommerce table.cart tr.cart_item,
    .woocommerce-page table.cart tr.cart_item {
        display: grid !important;
        grid-template-columns: 74px 1fr auto !important;
        grid-template-areas:
            "thumb title remove"
            "thumb price remove"
            "thumb qty total";
        align-items: center !important;
        gap: 8px 12px !important;
        background: #FFFFFF !important;
        border: 1px solid var(--cartemio-border) !important;
        border-radius: 10px !important;
        padding: 14px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
    }

    .woocommerce table.cart td.product-thumbnail {
        grid-area: thumb !important;
        padding: 0 !important;
        width: 74px !important;
    }

    .woocommerce table.cart td.product-thumbnail img {
        width: 74px !important;
        height: 74px !important;
        aspect-ratio: 1 / 1 !important;
        object-fit: cover !important;
        border-radius: 6px !important;
    }

    .woocommerce table.cart td.product-name {
        grid-area: title !important;
        padding: 0 !important;
        font-size: 0.94rem !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
    }

    .woocommerce table.cart td.product-price {
        grid-area: price !important;
        padding: 0 !important;
        font-size: 0.95rem !important;
        color: var(--cartemio-charcoal) !important;
    }

    .woocommerce table.cart td.product-quantity {
        grid-area: qty !important;
        padding: 0 !important;
        text-align: left !important;
    }

    .woocommerce table.cart td.product-quantity .quantity input.qty {
        width: 54px !important;
        height: 36px !important;
    }

    .woocommerce table.cart td.product-subtotal {
        grid-area: total !important;
        padding: 0 !important;
        text-align: right !important;
        font-weight: 700 !important;
        font-size: 1rem !important;
        color: var(--cartemio-forest) !important;
    }

    .woocommerce table.cart td.product-remove {
        grid-area: remove !important;
        padding: 0 !important;
        text-align: right !important;
    }

    .woocommerce table.cart td.actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding: 16px !important;
        background: #FFFFFF !important;
        border: 1px solid var(--cartemio-border) !important;
        border-radius: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .woocommerce table.cart td.actions .coupon {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .woocommerce table.cart td.actions .coupon input#coupon_code {
        width: 100% !important;
        height: 42px !important;
    }

    .woocommerce table.cart td.actions .coupon button.button,
    .woocommerce table.cart td.actions button[name="update_cart"] {
        width: 100% !important;
        height: 42px !important;
        text-align: center !important;
    }

    .woocommerce .cart-collaterals .cart_totals,
    .woocommerce-page .cart-collaterals .cart_totals {
        width: 100% !important;
        float: none !important;
        margin-top: 20px !important;
    }
}

/* 3. RESPONSIVE CHECKOUT */
@media (max-width: 900px) {
    .woocommerce-checkout #customer_details,
    .woocommerce-checkout #order_review_heading,
    .woocommerce-checkout #order_review {
        width: 100% !important;
        float: none !important;
    }

    .woocommerce-checkout #order_review {
        padding: 20px 16px !important;
        background: #FFFFFF !important;
        border: 1px solid var(--cartemio-border) !important;
        border-radius: 10px !important;
        box-sizing: border-box !important;
    }

    .woocommerce-checkout form.checkout .form-row {
        width: 100% !important;
        float: none !important;
        margin-bottom: 14px !important;
    }

    .woocommerce-checkout input.input-text,
    .woocommerce-checkout select {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
    }
}

/* 4. RESPONSIVE HEADER & TOP BAR ON MOBILE PHONES */
@media (max-width: 600px) {
    .cartemio-top-bar {
        padding: 6px 10px !important;
        font-size: 0.74rem !important;
    }

    .cartemio-top-bar-inner {
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 4px !important;
    }

    .cartemio-top-address {
        display: none !important;
    }

    .cartemio-top-shipping {
        font-size: 0.76rem !important;
    }

    .cartemio-top-phone {
        font-size: 0.74rem !important;
    }

    .cartemio-hours {
        display: none !important;
    }

    .site-branding .custom-logo-link svg,
    .site-logo-img .custom-logo-link svg {
        width: 165px !important;
        height: 38px !important;
    }
}

/* 5. RESPONSIVE CATEGORY CARDS & HERO */
@media (max-width: 600px) {
    .cartemio-cat-thumb-wrap {
        height: 160px !important;
    }

    .cartemio-cat-content {
        padding: 14px 16px !important;
    }

    .cartemio-cat-title {
        font-size: 1.1rem !important;
    }

    .cartemio-cat-desc {
        font-size: 0.82rem !important;
        margin-bottom: 12px !important;
    }

    .cartemio-hero-section {
        padding: 50px 16px !important;
        border-radius: 8px !important;
    }

    .cartemio-hero-section h1 {
        font-size: 1.8rem !important;
        margin-bottom: 14px !important;
    }

    .cartemio-hero-section p {
        font-size: 0.95rem !important;
        margin-bottom: 22px !important;
    }

    .cartemio-hero-section .button,
    .cartemio-hero-section a {
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
}


