/*
Theme Name: Krambu
Theme URI: https://www.krambu.com/
Author: Krambu
Author URI: https://www.krambu.com/
Description: A modern, premium WordPress theme for Krambu - pioneering direct liquid cooling for next-generation AI servers. Features WooCommerce integration optimized for high-value enterprise server products.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: krambu
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, woocommerce
*/

/* ============================================
   KRAMBU THEME - Custom Styles
   ============================================
   Most styling is handled via theme.json. 
   These are additional enhancements and animations.
   ============================================ */

/* --- Root Variables (CSS Custom Properties) --- */
:root {
    --krambu-transition-fast: 150ms ease;
    --krambu-transition-base: 250ms ease;
    --krambu-transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --krambu-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --krambu-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --krambu-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --krambu-shadow-purple: 0 4px 14px 0 rgb(126 0 255 / 0.25);
}

/* --- Animations --- */
@keyframes krambu-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes krambu-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes krambu-pulse-subtle {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

@keyframes krambu-gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

main {
    margin-block-start: 0;
}

/* --- Utility Classes --- */
.krambu-animate-fade-in {
    animation: krambu-fade-in 0.5s var(--krambu-transition-slow) forwards;
}

.krambu-animate-fade-in-up {
    animation: krambu-fade-in-up 0.6s var(--krambu-transition-slow) forwards;
}

.krambu-gradient-text {
    background: linear-gradient(135deg, var(--wp--preset--color--accent-primary) 0%, var(--wp--preset--color--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.krambu-gradient-bg {
    background: linear-gradient(135deg, var(--wp--preset--color--accent-primary) 0%, var(--wp--preset--color--accent-secondary) 100%);
}

.krambu-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.krambu-glass-dark {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* --- Header Enhancements --- */
.krambu-header {
    transition: background-color var(--krambu-transition-base),
        box-shadow var(--krambu-transition-base);
}

.krambu-header.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--krambu-shadow-md);
}

/* --- Button Enhancements --- */
.wp-block-button__link {
    transition: all var(--krambu-transition-base);
    position: relative;
    overflow: hidden;
}

.wp-block-button__link:hover {
    transform: translateY(-1px);
}

.wp-block-button__link:active {
    transform: translateY(0);
}

/* Primary button with purple gradient */
.wp-block-button.is-style-krambu-primary .wp-block-button__link {
    background: linear-gradient(135deg, var(--wp--preset--color--accent-primary) 0%, var(--wp--preset--color--accent-secondary) 100%);
    border: none;
    box-shadow: var(--krambu-shadow-purple);
}

.wp-block-button.is-style-krambu-primary .wp-block-button__link:hover {
    box-shadow: 0 6px 20px 0 rgb(126 0 255 / 0.35);
}

/* --- Card Effects --- */
.krambu-card {
    border-radius: 12px;
}


/* --- Product Cards (WooCommerce) --- */
.woocommerce ul.products li.product {
    transition: transform var(--krambu-transition-base),
        box-shadow var(--krambu-transition-base);
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
}

/* Product image container - dark background for server images */
.woocommerce ul.products li.product .woocommerce-loop-product__link img,
.woocommerce div.product div.images img {
    background-color: var(--wp--preset--color--surface-dark, #0A0A0F);
    border-radius: 8px;
}

/* --- Specification Tables --- */
.krambu-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.krambu-specs-table th,
.krambu-specs-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--wp--preset--color--border, #E5E5E5);
}

.krambu-specs-table tr:nth-child(even) {
    background-color: var(--wp--preset--color--base-alt, #F8F7FC);
}

.krambu-specs-table th {
    font-weight: 600;
    color: var(--wp--preset--color--contrast-muted, #484B49);
    width: 40%;
}

.krambu-specs-table td {
    font-weight: 500;
}

/* Section header in spec table */
.krambu-specs-table tr.section-header td {
    background: var(--wp--preset--color--surface-dark, #0A0A0F);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Navigation --- */
.wp-block-navigation-item__content {
    position: relative;
    transition: color var(--krambu-transition-fast);
}

.wp-block-navigation-item__content::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--wp--preset--color--accent-primary);
    transition: width var(--krambu-transition-base);
}

.wp-block-navigation-item__content:hover::after,
.current-menu-item .wp-block-navigation-item__content::after,
.krambu-primary-nav .menu-item a:hover::after,
.krambu-primary-nav .current-menu-item>a::after {
    width: 100%;
}

/* --- Dynamic Menu Support (krambu/menu-location) --- */

/* Header Menu Layout */
.krambu-primary-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
    /* Updated: Moved menu down more */
    gap: var(--wp--preset--spacing--50);
}

.krambu-primary-nav .menu-item {
    padding: 0;
}

.krambu-primary-nav .menu-item a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    position: relative;
    transition: color var(--krambu-transition-fast);
    display: block;
}

/* Replicate underline effect for standard menu items */
.krambu-primary-nav>.menu-item>a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--wp--preset--color--accent-primary);
    transition: width var(--krambu-transition-base);
}

/* --- Dropdown Menus --- */
.krambu-primary-nav .menu-item {
    position: relative;
}

/* Hide Submenus by default */
.krambu-primary-nav .sub-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--wp--preset--color--surface-dark, #0A0A0F);
    box-shadow: var(--krambu-shadow-lg);
    border-radius: 8px;
    padding: 0;
    /* Remove padding per user request */
    overflow: hidden;
    /* Ensure items clip to rounded corners */
    margin: 10px 0 0 0;
    /* Add 10px spacing from parent */
    list-style: none;
    z-index: 100;
    transform: translateY(10px);
    opacity: 0;
    visibility: hidden;
    /* Delay visibility hidden to allow mouse to cross gap if bridge fails */
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add bridge to prevent menu from closing when crossing the gap */
.krambu-primary-nav .sub-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    /* Overlap parent slightly more */
    left: 0;
    width: 100%;
    height: 20px;
    /* Cover the 10px gap + 10px overlap */
    background: transparent;
    /* Explicitly transparent */
    display: block;
}

/* Show Submenus on Hover */
.krambu-primary-nav .menu-item:hover>.sub-menu,
.krambu-primary-nav .menu-item:focus-within>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    /* Remove delay on hover so it appears instantly */
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

/* Submenu Items */
.krambu-primary-nav .sub-menu .menu-item {
    display: block;
    width: 100%;
}

.krambu-primary-nav .sub-menu .menu-item a {
    padding: 0.75rem 1.25rem;
    color: #fff;
    font-size: 0.9rem;
    white-space: nowrap;
}

.krambu-primary-nav .sub-menu .menu-item a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--wp--preset--color--accent-primary);
}

/* Remove underline from submenu items */
.krambu-primary-nav .sub-menu .menu-item a::after {
    display: none;
}

/* Nested Dropdowns (e.g. Level 3) */
.krambu-primary-nav .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 5px;
}

/* Footer Menu Styling */
.krambu-footer-menu {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0;
    line-height: 2.2;
}

.krambu-footer-menu .menu-item a {
    text-decoration: none;
    color: inherit;
    transition: color var(--krambu-transition-fast);
}

.krambu-footer-menu .menu-item a:hover {
    color: var(--wp--preset--color--accent-primary);
    text-decoration: underline;
}

/* --- Focus States (Accessibility) --- */
:focus-visible {
    outline: 2px solid var(--wp--preset--color--accent-primary);
    outline-offset: 2px;
}

/* --- Selection Color --- */
::selection {
    background-color: var(--wp--preset--color--accent-primary);
    color: white;
}

/* --- Scroll Behavior --- */
html {
    scroll-behavior: smooth;
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Print Styles --- */
@media print {

    .krambu-header,
    .krambu-footer,
    .wp-block-navigation {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: underline;
    }

    .krambu-specs-table {
        page-break-inside: avoid;
    }
}

/* --- Custom Backgrounds --- */
.krambu-bg-matrix-dots {
    background-color: #000000;
    background-image: radial-gradient(var(--wp--preset--color--accent-primary) 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    background-attachment: fixed;
    /* Parallax effect */
    position: relative;
}

/* Add a subtle overlay with backdrop blur */
.krambu-bg-matrix-dots::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, #000000 140%);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    pointer-events: none;
    z-index: 0;
}

.krambu-hero-stats.krambu-bg-matrix-dots::before {
    background: radial-gradient(circle at center, transparent 0%, #000000 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

}

/* Ensure content sits above the blurred overlay */
.krambu-bg-matrix-dots>* {
    position: relative;
    z-index: 1;
}

.krambu-bg-gradient-light-purple {
    background-color: #ffffff;
    background-image:
        /* Fade to white top */
        linear-gradient(to bottom, #ffffff 0%, transparent 15%),
        /* Fade to white bottom */
        linear-gradient(to top, #ffffff 0%, transparent 15%),
        /* Organic Shape 1 (Top Left - Vibrant) */
        radial-gradient(circle at -10% 20%, rgba(126, 0, 255, 0.18) 0%, transparent 50%),
        /* Organic Shape 2 (Bottom Right - Softer) */
        radial-gradient(circle at 110% 80%, rgba(126, 0, 255, 0.15) 0%, transparent 50%),
        /* Organic Shape 3 (Center spread) */
        radial-gradient(circle at 60% 40%, rgba(126, 0, 255, 0.08) 0%, transparent 60%);
    position: relative;
    overflow: hidden;
}

/* Overwrite previous gradient with organic shapes version */
.krambu-bg-gradient-light-purple {
    background-color: #ffffff;
    background-image:
        /* Fade to white top */
        linear-gradient(to bottom, #ffffff 0%, transparent 20%),
        /* Fade to white bottom */
        linear-gradient(to top, #ffffff 0%, transparent 20%),
        /* Organic Shape 1 (Top Left) */
        radial-gradient(circle at 0% 20%, rgba(126, 0, 255, 0.15) 0%, transparent 60%),
        /* Organic Shape 2 (Bottom Right) */
        radial-gradient(circle at 100% 80%, rgba(140, 50, 255, 0.12) 0%, transparent 60%),
        /* Organic Shape 3 (Center subtle) */
        radial-gradient(circle at 50% 50%, rgba(126, 0, 255, 0.05) 0%, transparent 50%);
    background-attachment: scroll;
}

/* Overwrite with Mesh Gradient "Stripe/Jetbrains" Vibe */
/* Refined Overflowing Shapes (Stripe/Jetbrains Vibe) */
.krambu-bg-gradient-light-purple {
    /* Transparent base to allow body/neighbor blending if desired, 
       but standard white base for text contrast usually safer. 
       We'll use white but rely on z-index for bleeding shapes. */
    background-color: #ffffff;
    background-image: none;
    position: relative;
    overflow: visible;
    /* KEY: Allow bleed */
    z-index: 5;
    /* Lift above neighbors to show bleed */
}

/* Ensure content sits above shapes */
.krambu-bg-gradient-light-purple>* {
    position: relative;
    z-index: 2;
}

/* Shape 1: Top Left - Vibrant Organic Blob */
.krambu-bg-gradient-light-purple::before {
    content: '';
    position: absolute;
    top: -150px;
    left: -100px;
    width: 800px;
    height: 800px;
    /* Vibrant purple/blue gradient */
    background: radial-gradient(circle at 30% 30%, rgba(126, 0, 255, 0.12), transparent 70%);
    /* Harder organic shape (less blur, defined edges per request?) 
       User said "hard shapes maybe... organic shape" - usually means vector-like blobs */
    border-radius: 45% 55% 70% 30% / 30% 30% 70% 70%;
    z-index: -1;
    transform: rotate(-10deg);
    pointer-events: none;
}

/* Shape 2: Bottom Right - Vibrant Organic Blob */
.krambu-bg-gradient-light-purple::after {
    content: '';
    position: absolute;
    bottom: -150px;
    right: -100px;
    width: 900px;
    height: 700px;
    /* Tech blue/pink gradient */
    background: radial-gradient(circle at 70% 70%, rgba(56, 189, 248, 0.12), transparent 70%);
    border-radius: 30% 70% 50% 50% / 30% 60% 40% 70%;
    z-index: -1;
    transform: rotate(10deg);
    pointer-events: none;
}

/* Overwrite with Organic Overflowing Shapes */
.krambu-bg-gradient-light-purple {
    background-color: transparent;
    /* Allow bleed */
    background-image: none;
    position: relative;
    overflow: visible !important;
    /* Allow shapes to bleed */
    z-index: 1;
    /* Ensure on top for bleed visibility */
}

/* Shape 1: Top Left - Overflowing Organic Blob */
.krambu-bg-gradient-light-purple::before {
    content: '';
    position: absolute;
    top: -15%;
    left: -10%;
    width: 60%;
    height: 120%;
    background: radial-gradient(circle at center, rgba(126, 0, 255, 0.08), transparent 70%);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    z-index: -1;
    transform: rotate(-15deg);
    pointer-events: none;
}

/* Shape 2: Bottom Right - Overflowing Organic Blob */
.krambu-bg-gradient-light-purple::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 70%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(50, 100, 255, 0.08), transparent 70%);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    z-index: -1;
    transform: rotate(15deg);
    pointer-events: none;
}

/* Add a hard vector-like accent shape (Stripe vibe) */
.krambu-bg-gradient-light-purple .wp-block-columns::before {
    content: '';
    position: absolute;
    top: 10%;
    right: 5%;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(126, 0, 255, 0.05), rgba(255, 0, 200, 0.05));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    z-index: -1;
    filter: blur(40px);
}

/* FIX: Vivid Overflowing Organic Shapes */
.krambu-bg-gradient-light-purple {
    background-color: transparent !important;
    /* Ensure transparent so shapes show */
    background-image: none !important;
    position: relative;
    overflow: visible !important;
    z-index: 1;
}

/* Ensure content sits above shapes */
.krambu-bg-gradient-light-purple>* {
    position: relative;
    z-index: 5;
}

/* Shape 1: Top Left - VIBRANT Purple/Pink Blob */
.krambu-bg-gradient-light-purple::before {
    content: '';
    position: absolute;
    top: -200px;
    left: -150px;
    width: 60vw;
    height: 60vw;
    max-width: 800px;
    max-height: 800px;
    /* Much higher opacity: 0.5 */
    background: radial-gradient(circle at center, rgba(147, 51, 234, 0.5), transparent 70%);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    z-index: -1;
    transform: rotate(-15deg);
    pointer-events: none;
    filter: blur(40px);
    /* Soften the hard edges slightly but keep shape */
}

/* Shape 2: Bottom Right - VIBRANT Blue/Cyan Blob */
.krambu-bg-gradient-light-purple::after {
    content: '';
    position: absolute;
    bottom: -150px;
    right: -100px;
    width: 60vw;
    height: 60vw;
    max-width: 800px;
    max-height: 800px;
    /* Much higher opacity: 0.5 */
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.5), transparent 70%);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    z-index: -1;
    transform: rotate(15deg);
    pointer-events: none;
    filter: blur(40px);
}

/* FINAL ADJUSTMENT: High Visibility & Harder Shapes */
.krambu-bg-gradient-light-purple::before {
    /* More visible opacity (0.8) and less blur */
    background: radial-gradient(circle at center, rgba(147, 51, 234, 0.8) 0%, rgba(147, 51, 234, 0) 70%) !important;
    filter: blur(100px) !important;
    top: -100px !important;
    left: -100px !important;
    width: 600px !important;
    height: 600px !important;
}

.krambu-bg-gradient-light-purple::after {
    /* More visible opacity (0.8) and less blur */
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.8) 0%, rgba(56, 189, 248, 0) 70%) !important;
    filter: blur(100px) !important;
    bottom: -100px !important;
    right: -100px !important;
    width: 600px !important;
    height: 600px !important;
}

/* FINAL FIX: Restore Base Gradient + Keep Shapes */
.krambu-bg-gradient-light-purple {
    /* Restore a subtle background to connect the shapes */
    background-color: #fdfbfd !important;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 230, 255, 0.4) 100%) !important;
    /* Keep overflow visible for the shapes */
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

/* FORCE OVERFLOW VISIBILITY GLOBALLY FOR THIS CONTAINER */
.krambu-bg-gradient-light-purple {
    overflow: visible !important;
    transform: none !important;
    /* Transform can create usage stacking context that clips */
    perspective: none !important;
}

/* Force parent group to allow overflow */
.wp-block-group:has(> .krambu-bg-gradient-light-purple) {
    overflow: visible !important;
}

/* Fallback for browsers without :has support or general fix */
.wp-block-group.alignfull {
    overflow: visible !important;
}

/* Ensure shapes are Z-indexed correctly to bleed */
.krambu-bg-gradient-light-purple::before,
.krambu-bg-gradient-light-purple::after {
    z-index: 0 !important;
    /* Move to 0 to be above negative parents but below content */
}

/* Content above shapes */
.krambu-bg-gradient-light-purple>* {
    z-index: 10 !important;
}

/* DARK MODE SWITCH: Air Cooled Section */
.krambu-bg-gradient-light-purple {
    background-color: #0d0415 !important;
    /* Deep dark purple/black base */
    background-image: none !important;
    overflow: hidden !important;
    /* Contain the blobs within the dark section */
    position: relative;
    z-index: 1;
    color: white;
    /* Ensure text inherits white */
}

/* Adjust blobs to be "Glows" in the dark */
.krambu-bg-gradient-light-purple::before {
    background: radial-gradient(circle at center, rgba(147, 51, 234, 0.4) 0%, transparent 70%) !important;
    filter: blur(60px) !important;
    opacity: 1 !important;
    /* Reset position to be inside/corner glows */
    top: -20% !important;
    left: -10% !important;
    width: 60% !important;
    height: 100% !important;
}

.krambu-bg-gradient-light-purple::after {
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.3) 0%, transparent 70%) !important;
    filter: blur(60px) !important;
    opacity: 1 !important;
    bottom: -20% !important;
    right: -10% !important;
    width: 60% !important;
    height: 100% !important;
}

/* Ensure list markers and strong text are white in this section */
.krambu-bg-gradient-light-purple ul li,
.krambu-bg-gradient-light-purple p,
.krambu-bg-gradient-light-purple h2,
.krambu-bg-gradient-light-purple h3,
.krambu-bg-gradient-light-purple strong {
    color: white !important;
}

/* ADDITION: Bleeding Box Shadow Glow */
.krambu-bg-gradient-light-purple {
    /* Soft, large purple glow to bleed into white sections */
    box-shadow: 0 0 100px -20px #0d0415,
        0 0 40px -10px #0d0415 !important;
    /* Ensure it floats above/blends nicely */
    z-index: 10 !important;
}

/* TARGETED MARGIN FIX: Apply only where explicitly requested */
.krambu-no-margin-top {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}

/* FORCE FOOTER REMOVAL specifically */
footer.wp-block-template-part.krambu-no-margin-top {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
}

/* Also target generic footer if it has the class */
footer {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}

/* Product Details Refinements */

/* Vertical Gallery */
.woocommerce-product-gallery {
    display: flex !important;
    gap: 20px;
}

.woocommerce-product-gallery .flex-viewport {
    order: 2;
    width: 80% !important;
}

.woocommerce-product-gallery .flex-control-nav {
    order: 1;
    width: 20% !important;
    display: flex;
    flex-direction: column;
}

.woocommerce-product-gallery .flex-control-nav li {
    width: 100% !important;
    float: none !important;
    margin-bottom: 10px;
}

.woocommerce-product-gallery .flex-control-nav li img {
    border-radius: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.woocommerce-product-gallery .flex-control-nav li img.flex-active,
.woocommerce-product-gallery .flex-control-nav li img:hover {
    opacity: 1;
    border: none !important;
}

/* Styled Tabs */
.woocommerce-tabs ul.tabs {
    background: transparent !important;
    border-bottom: none !important;
    padding: 0 !important;
    margin: 0 0 30px !important;
    display: flex;
    gap: 10px;
    overflow: visible !important;
}

.woocommerce-tabs ul.tabs::before,
.woocommerce-tabs ul.tabs::after {
    display: none !important;
}

.woocommerce-tabs ul.tabs li {
    background: transparent !important;
    border: none !important;
    border-radius: 999px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce-tabs ul.tabs li::before,
.woocommerce-tabs ul.tabs li::after {
    display: none !important;
}

.woocommerce-tabs ul.tabs li a {
    display: inline-block;
    padding: 10px 24px !important;
    background: var(--wp--preset--color--base-alt) !important;
    color: var(--wp--preset--color--contrast-muted) !important;
    border-radius: 999px !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.woocommerce-tabs ul.tabs li.active a,
.woocommerce-tabs ul.tabs li a:hover {
    background: var(--wp--preset--color--accent-primary) !important;
    color: white !important;
}

.woocommerce-tabs .panel {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Styled Quantity & Add to Cart */
.cart {
    display: flex;
    gap: 15px;
    align-items: center;
}

.quantity {
    display: inline-flex;
    align-items: center;
    background: var(--wp--preset--color--base-alt);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 8px;
    padding: 4px;
}

.quantity input.qty {
    background: transparent !important;
    border: none !important;
    text-align: center;
    width: 50px !important;
    font-weight: 600;
    color: var(--wp--preset--color--contrast);
    padding: 0 !important;
}

/* Hide spinners */
.quantity input.qty::-webkit-inner-spin-button,
.quantity input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove default animations if any remain contextually */
.krambu-animate-fade-in-up {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Ensure main product gallery has white background */
.woocommerce-product-gallery .flex-viewport,
.woocommerce-product-gallery .flex-control-nav li img {
    background-color: var(--wp--preset--color--base) !important;
}

/* Force gallery container background to white/transparent */
.woocommerce-product-gallery {
    background-color: transparent !important;
}

/* Related Products Grid Fix */
.krambu-product-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: var(--wp--preset--spacing--30) !important;
}

@media (max-width: 1024px) {
    .krambu-product-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .krambu-product-list {
        grid-template-columns: 1fr !important;
    }
}

/* Related Products Grid Fix - STRONG Override */
.wp-block-woocommerce-related-products ul.products,
.wp-block-woocommerce-related-products .krambu-product-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: var(--wp--preset--spacing--30) !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Ensure individual items don't stretch */
.wp-block-woocommerce-related-products ul.products li.product,
.wp-block-woocommerce-related-products .krambu-product-list li.product,
.wp-block-woocommerce-related-products .krambu-product-list>* {
    width: 100% !important;
    margin: 0 !important;
    max-width: none !important;
    grid-column: span 1 !important;
}

/* Responsive */
@media (max-width: 1024px) {

    .wp-block-woocommerce-related-products ul.products,
    .wp-block-woocommerce-related-products .krambu-product-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {

    .wp-block-woocommerce-related-products ul.products,
    .wp-block-woocommerce-related-products .krambu-product-list {
        grid-template-columns: 1fr !important;
    }
}

/* GRID FIX: Remove pseudo-elements becoming grid items */
.wp-block-woocommerce-related-products ul.products::before,
.wp-block-woocommerce-related-products ul.products::after,
.wp-block-woocommerce-related-products .krambu-product-list::before,
.wp-block-woocommerce-related-products .krambu-product-list::after {
    display: none !important;
    content: none !important;
}

/* Remove purple background on hover for product listings */
.woocommerce ul.products li.product:hover,
.woocommerce ul.products li.product .woocommerce-loop-product__link:hover {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Ensure images have white background if needed, or transparent to match card */
.woocommerce ul.products li.product .woocommerce-loop-product__link img {
    background-color: transparent !important;
}

/* Transparent Blur Cards for Matrix Background */
.krambu-blur-card-dark {
    background-color: rgba(10, 10, 15, 0.65) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* User converted "light" cards to dark style */
.krambu-blur-card-light {
    background-color: rgba(10, 10, 15, 0.4) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    color: white !important;
}

.krambu-blur-card-light p,
.krambu-blur-card-light h1,
.krambu-blur-card-light h2,
.krambu-blur-card-light h3,
.krambu-blur-card-light h4,
.krambu-blur-card-light h5,
.krambu-blur-card-light h6 {
    color: white !important;
}

/* Ensure links in dark blur cards are visible */
.krambu-blur-card-light a,
.krambu-blur-card-dark a {
    color: white !important;
}

/* --- About Us Timeline --- */
.krambu-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Vertical Line */
.krambu-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 120px;
    /* Line position (space for year on left) */
    width: 2px;
    background: linear-gradient(to bottom, var(--wp--preset--color--accent-primary) 0%, rgba(126, 0, 255, 0.2) 100%);
}

.krambu-timeline-item {
    position: relative;
    margin-bottom: 60px;
    padding-left: 160px;
    /* 120px + padding */
    min-height: 100px;
    /* Ensure space */
}

.krambu-timeline-item:last-child {
    margin-bottom: 0;
}

/* The Dot on the Line */
.krambu-timeline-item::after {
    content: '';
    position: absolute;
    left: 113px;
    /* 120px line center - 7px radius = 113px */
    top: 0;
    /* Align with top of item, will adjust to match card top */
    width: 16px;
    height: 16px;
    background: var(--wp--preset--color--base-alt);
    border: 3px solid var(--wp--preset--color--accent-primary);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 4px var(--wp--preset--color--base-alt);
    /* Separation from line */
}

/* Year Text */
.krambu-timeline-year {
    position: absolute;
    left: 0;
    top: -1px;
    /* Slight visual alignment fix with the dot/card title */
    width: 100px;
    /* Space up to the line */
    text-align: right;
    padding-right: 20px;

    /* Typography */
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--wp--preset--color--accent-primary);
}

/* Remove any other pseudo elements on year just in case */
.krambu-timeline-year::after,
.krambu-timeline-year::before {
    display: none;
}

/* Content Card */
.krambu-timeline-content {
    position: relative;
    top: -18px;
    /* Pull up slightly to align top of card with dot/year */
}

.krambu-timeline-card {
    background: var(--wp--preset--color--surface-dark, #0A0A0F);
    padding: 24px 32px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--krambu-shadow-md);
    position: relative;
    transition: transform var(--krambu-transition-base);
}

.krambu-timeline-card:hover {
    transform: translateY(-2px);
    border-color: rgba(126, 0, 255, 0.3);
}

/* Arrow pointing to dot */
.krambu-timeline-card::before {
    content: '';
    position: absolute;
    top: 20px;
    /* Match dot area roughly */
    left: -8px;
    width: 16px;
    height: 16px;
    background: var(--wp--preset--color--surface-dark, #0A0A0F);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
}

.krambu-timeline-card ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.krambu-timeline-card li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: #e0e0e0;
    /* Improved contrast: Light grey instead of muted */
    line-height: 1.6;
    font-size: 1.05rem;
}

.krambu-timeline-card li:last-child {
    margin-bottom: 0;
}

.krambu-timeline-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--wp--preset--color--accent-primary);
    font-weight: bold;
}

.krambu-timeline-card strong {
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .krambu-timeline {
        padding-top: 10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Move line to left */
    .krambu-timeline::before {
        left: 20px;
    }

    .krambu-timeline-item {
        padding-left: 50px;
        /* Space for line+dot */
        margin-bottom: 40px;
    }

    /* Dot moves to left line */
    .krambu-timeline-item::after {
        left: 13px;
        /* 20px line - 7px radius = 13px */
        top: 0;
    }

    .krambu-timeline-year {
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
        text-align: left;
        margin-bottom: 8px;
        padding-right: 0;
        font-size: 1.4rem;
        /* Line up with dot/content? On mobile year is usually above content. */
        margin-left: -5px;
        /* Align visual text */
    }

    .krambu-timeline-content {
        top: 0;
    }

    /* Adjust arrow for mobile? */
    .krambu-timeline-card::before {
        top: 15px;
    }
}