/* ==========================================================================
   POLYMART — Taxonomy Product Category Page Premium Styles (Glassmorphism & Full-Width Images)
   ========================================================================== */

:root {
    --pm-blue:       #0079bf;
    --pm-blue-lt:    #e8f4fb;
    --pm-blue-dark:  #0f1a2e;
    --pm-text:       #0f1a2e;
    --pm-muted:      #5c6b82;
    --pm-border:     #dde3ed;
    --pm-white:      #ffffff;
    --pm-bg-light:   #f4f6f9;
    
    --font-head:     'Plus Jakarta Sans', sans-serif;
    --font-body:     'Manrope', sans-serif;
}

/* Container Structure */
.pm-inner { 
    max-width: 1440px; 
    width: 100%; 
    margin: 0 auto; 
    padding: 0 24px; 
    box-sizing: border-box;
}

/* Woodmart / polymart default main wrappers override */
body.tax-product_cat .wd-content-layout,
body.tax-product_cat .content-layout-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    display: block !important;
}

body.tax-product_cat .wd-content-layout > .wd-col {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

body.tax-product_cat .main-page-wrapper {
    padding-top: 0 !important;
}

.pm-cat-wrap {
    background: var(--pm-white);
    padding-bottom: 0;
    width: 100%;
    font-family: var(--font-body);
}

/* ==========================================================================
   HERO SECTION (Mesh Gradient + Glassmorphism Title Board)
   ========================================================================== */
.pm-hero-cat {
    min-height: 340px;
    background: linear-gradient(135deg, #0f1a2e 0%, #0c274e 50%, #0079bf 100%) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 140px 0 60px 0 !important;
    border-bottom: 1px solid rgba(15, 26, 46, 0.15);
}

.pm-hero-cat.has-bg-image {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.pm-hero-cat.has-bg-image::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 26, 46, 0.6) !important; /* Dark glass overlay for category banner */
    z-index: 2 !important;
}

/* Glowing background shapes for mesh effect */
.pm-hero-cat .pm-decor {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
}

.pm-hero-cat .pm-decor-1 {
    top: -50px;
    right: 5%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 164, 255, 0.3) 0%, transparent 70%);
}

.pm-hero-cat .pm-decor-2 {
    bottom: -80px;
    left: 5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 121, 191, 0.25) 0%, transparent 70%);
}

.pm-hero-cat .pm-decor-3 {
    top: 20%;
    left: 45%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
}

.pm-hero-inner {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
}

/* Frosted Glass Floating Board */
.pm-hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.07) !important;
    backdrop-filter: blur(20px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 35px 70px !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 50px rgba(15, 26, 46, 0.18) !important;
    max-width: 800px;
    width: 100%;
}

/* Breadcrumb (Light Theme on Dark Mesh) */
.pm-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7) !important;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.pm-breadcrumb a {
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.pm-breadcrumb a:hover {
    color: #00a4ff !important;
}

.pm-breadcrumb .pm-sep {
    opacity: 0.5;
    color: rgba(255, 255, 255, 0.5) !important;
}

.pm-breadcrumb .pm-current {
    color: #ffffff !important;
    font-weight: 800;
}

/* Hero Title */
.pm-hero-content h1 {
    color: #ffffff !important;
    margin: 0 auto !important;
    text-transform: uppercase !important;
    font-family: var(--font-head) !important;
    font-size: clamp(26px, 4vw, 38px) !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px !important;
    line-height: 1.15 !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
}

/* Accent Line */
.pm-hero-content .pm-line {
    width: 50px !important;
    height: 4px !important;
    background: linear-gradient(90deg, #00a4ff 0%, #ffffff 100%) !important;
    margin-top: 20px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 164, 255, 0.3) !important;
}

/* ==========================================================================
   SUB-NAVIGATION PILLS (Sticky Frosted Glass Tab Bar)
   ========================================================================== */
.pm-cat-nav-wrap {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45) !important;
    padding: 16px 0;
    position: sticky;
    top: 102px; /* Offset for sticky floating menu */
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(15, 26, 46, 0.03) !important;
}

.pm-cat-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.pm-cat-nav::-webkit-scrollbar {
    display: none;
}

.pm-cat-tab {
    display: inline-block;
    text-decoration: none;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    border-radius: 30px;
    color: var(--pm-blue-dark);
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 6px rgba(15, 26, 46, 0.02);
}

.pm-cat-tab:hover {
    border-color: var(--pm-blue) !important;
    color: var(--pm-blue);
    background: rgba(255, 255, 255, 0.85) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 121, 191, 0.1);
}

.pm-cat-tab.active {
    background: var(--pm-blue) !important;
    border-color: var(--pm-blue) !important;
    color: var(--pm-white) !important;
    box-shadow: 0 6px 16px rgba(0, 121, 191, 0.22);
}

/* ==========================================================================
   PRODUCTS GRID & GLASSMORPHISM CARDS (Full-Width Images)
   ========================================================================== */
.pm-cat-products {
    padding: 60px 0 !important;
    background: var(--pm-bg-light) !important;
    /* Dotted background pattern and glowing orbs to emphasize the glass transparency */
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(0, 121, 191, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(0, 121, 191, 0.04) 0%, transparent 40%),
        radial-gradient(rgba(0, 121, 191, 0.05) 1.2px, transparent 1.2px) !important;
    background-size: 100% 100%, 100% 100%, 24px 24px !important;
    position: relative;
}

/* 4 Column Grid */
body.tax-product_cat ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.tax-product_cat ul.products::before,
body.tax-product_cat ul.products::after {
    display: none !important;
}

/* Premium Frosted Glass Product Card */
body.tax-product_cat ul.products li.product {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(25px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(190%) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-radius: 20px !important;
    padding: 0 0 24px 0 !important; /* Side & top padding removed for full-width image */
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100% !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: 
        0 10px 30px rgba(15, 26, 46, 0.03), 
        0 1px 2px rgba(255, 255, 255, 0.8) inset !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    overflow: hidden !important;
}

/* Card Hover State */
body.tax-product_cat ul.products li.product:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 45px rgba(15, 26, 46, 0.08) !important;
    border-color: rgba(0, 121, 191, 0.25) !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

/* Link Wrapper */
body.tax-product_cat ul.products li.product a.woocommerce-LoopProduct-link {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Full Width 1x1 Image (Fully Visible) */
body.tax-product_cat ul.products li.product img {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important; /* Overrides the global max-height constraint */
    aspect-ratio: 1 / 1 !important; /* Forces 1x1 aspect ratio */
    object-fit: contain !important; /* Since both image file and container are 1:1, contain will fill it completely without cropping */
    display: block !important;
    border-radius: 20px 20px 0 0 !important; /* Rounded top corners matching the card */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    border-bottom: 1px solid rgba(15, 26, 46, 0.05) !important; /* Subtle separator line */
}

body.tax-product_cat ul.products li.product:hover img {
    transform: scale(1.03) !important;
}

/* Left aligned Title with side margin offsets */
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-head) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #000000 !important;
    text-transform: uppercase !important;
    margin: 20px 20px 16px 20px !important; /* Side margin handles spacing */
    line-height: 1.4 !important;
    height: 44px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: left !important;
    transition: color 0.3s ease !important;
}

body.tax-product_cat ul.products li.product:hover .woocommerce-loop-product__title {
    color: var(--pm-blue) !important;
}

/* Button with side margins matching titles */
body.tax-product_cat ul.products li.product .button {
    background-color: var(--pm-blue) !important;
    color: var(--pm-white) !important;
    font-family: var(--font-head) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    padding: 12px 24px !important;
    border-radius: 30px !important;
    margin: auto 20px 0 20px !important; /* Margins for spacing */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: calc(100% - 40px) !important; /* Precise width alignment */
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 121, 191, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transform: none !important; /* Reset any legacy rotate/scale flips */
}

body.tax-product_cat ul.products li.product .button:hover {
    background-color: var(--pm-blue-dark) !important;
    box-shadow: 0 6px 20px rgba(15, 26, 46, 0.25) !important;
}

/* ==========================================================================
   WOOCOMMERCE NOTICES (Frosted Glass Notice Bar)
   ========================================================================== */
.woocommerce-message {
    border-top: 0 !important;
    background-color: rgba(232, 244, 251, 0.7) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    color: var(--pm-blue-dark) !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 20px rgba(0, 121, 191, 0.03) !important;
    padding: 16px 24px !important;
    font-weight: 600 !important;
    margin-bottom: 35px !important;
    border: 1px solid rgba(0, 121, 191, 0.15) !important;
    border-left: 4px solid var(--pm-blue) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-family: var(--font-body) !important;
}

.woocommerce-message a.button {
    background-color: var(--pm-blue) !important;
    color: #ffffff !important;
    border-radius: 30px !important;
    padding: 8px 20px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    width: auto !important;
    box-shadow: none !important;
}

.woocommerce-message a.button:hover {
    background-color: var(--pm-blue-dark) !important;
}

/* ==========================================================================
   SEO CONTENT SECTION
   ========================================================================== */
.pm-seo-content {
    background: #fdfdfe;
    padding: 60px 0 70px;
    border-top: 1px solid rgba(15, 26, 46, 0.06);
}

.pm-seo-inner {
    max-width: 1200px;
}

.pm-seo-text {
    position: relative;
    font-size: 16px;
    line-height: 1.8;
    color: var(--pm-muted);
    transition: max-height 0.4s ease;
}

.pm-seo-text.collapsed {
    max-height: 120px;
    overflow: hidden;
}

.pm-seo-text.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to top, #fdfdfe, transparent);
    pointer-events: none;
}

.pm-seo-text h2, .pm-seo-text h3 {
    color: var(--pm-blue-dark);
    font-family: var(--font-head);
    font-weight: 800;
    margin: 30px 0 15px;
    text-transform: uppercase;
}

.pm-seo-text h2 em, .pm-seo-text h3 em {
    color: var(--pm-blue);
    font-style: normal;
}

.pm-seo-text h2:first-child { margin-top: 0; }
.pm-seo-text p { margin-bottom: 16px; }

/* Modern Read More Button */
.pm-read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    padding: 12px 24px;
    background: transparent;
    border: 1.5px solid var(--pm-border);
    border-radius: 50px;
    color: var(--pm-text);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-head);
}

.pm-read-more-btn:hover {
    border-color: var(--pm-blue);
    color: var(--pm-blue);
    background: var(--pm-blue-lt);
    box-shadow: 0 4px 12px rgba(0,121,191,0.1);
}

.pm-read-more-btn svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.pm-read-more-btn.open svg {
    transform: rotate(180deg);
}

/* ==========================================================================
   RESPONSIVE LAYOUTS & DEVICE ADAPTATIONS
   ========================================================================== */
@media (max-width: 1200px) {
    .pm-cat-nav-wrap {
        top: 78px;
    }
    body.tax-product_cat ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 1024px) {
    .pm-inner { 
        padding: 0 20px; 
    }
    .pm-hero-content {
        padding: 30px 40px !important;
    }
}

@media (max-width: 768px) {
    .pm-cat-nav-wrap {
        top: 0;
        padding: 12px 0;
    }
    .pm-cat-nav {
        justify-content: flex-start;
        padding: 0 10px;
    }
    .pm-cat-tab {
        padding: 8px 18px;
        font-size: 13px;
    }
    
    body.tax-product_cat ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
    body.tax-product_cat ul.products li.product {
        border-radius: 16px !important;
        padding: 0 0 16px 0 !important;
    }
    body.tax-product_cat ul.products li.product img {
        border-radius: 16px 16px 0 0 !important;
        margin-bottom: 12px !important;
    }
    body.tax-product_cat ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px !important;
        height: 38px !important;
        margin: 0 16px 12px 16px !important;
    }
    body.tax-product_cat ul.products li.product .button {
        padding: 10px 16px !important;
        font-size: 11px !important;
        margin: auto 16px 0 16px !important;
        width: calc(100% - 32px) !important;
    }
    .pm-hero-cat {
        min-height: 220px;
        padding: 100px 0 40px 0 !important;
    }
    .pm-hero-content {
        padding: 20px 24px !important;
        border-radius: 16px !important;
    }
    .pm-breadcrumb {
        margin-bottom: 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    body.tax-product_cat ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    body.tax-product_cat ul.products li.product {
        padding: 0 0 12px 0 !important;
        border-radius: 12px !important;
    }
    body.tax-product_cat ul.products li.product img {
        border-radius: 12px 12px 0 0 !important;
    }
    body.tax-product_cat ul.products li.product .woocommerce-loop-product__title {
        font-size: 13px !important;
        height: 36px !important;
        margin: 0 12px 10px 12px !important;
    }
    body.tax-product_cat ul.products li.product .button {
        padding: 8px 12px !important;
        font-size: 10px !important;
        margin: auto 12px 0 12px !important;
        width: calc(100% - 24px) !important;
    }
}

/* Hide WooCommerce added to cart link from product cards */
.added_to_cart.wc-forward {
    display: none !important;
}

/* ==========================================================================
   PREMIUM WOOCOMMERCE NOTICES / MESSAGES / ERRORS (Glassmorphic)
   ========================================================================== */
.woocommerce-message, 
.woocommerce-error, 
.woocommerce-info {
    max-width: 1200px !important;
    margin: 30px auto !important;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    border-radius: 16px !important;
    padding: 20px 30px !important;
    color: #0f1a2e !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    box-shadow: 0 10px 30px rgba(15, 26, 46, 0.05) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    box-sizing: border-box !important;
    list-style: none !important;
    position: relative !important;
}

.woocommerce-message {
    border-left: 4px solid #10b981 !important;
}

.woocommerce-error {
    border-left: 4px solid #ef4444 !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}
.woocommerce-error li {
    margin: 5px 0 !important;
}

.woocommerce-message::before {
    content: "✅" !important;
    font-size: 20px !important;
    margin-right: 10px !important;
    position: static !important;
    float: none !important;
    display: inline-block !important;
}

.woocommerce-error::before {
    content: "⚠️" !important;
    font-size: 20px !important;
    margin-right: 10px !important;
    position: static !important;
    float: none !important;
    display: inline-block !important;
}

.woocommerce-message .button,
.woocommerce-error .button,
.woocommerce-info .button {
    background-color: #0079bf !important;
    color: #ffffff !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 10px 20px !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 12px rgba(0, 121, 191, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    border: none !important;
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    margin: 0 !important;
}

.woocommerce-message .button:hover,
.woocommerce-error .button:hover,
.woocommerce-info .button:hover {
    background-color: #0f1a2e !important;
    box-shadow: 0 6px 20px rgba(15, 26, 46, 0.25) !important;
}

/* Prevent duplicate notices */
.woocommerce-notices-wrapper:nth-of-type(n+2) {
    display: none !important;
}

@media (max-width: 768px) {
    .woocommerce-message, 
    .woocommerce-error, 
    .woocommerce-info {
        margin: 20px 15px !important;
        padding: 16px 20px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    .woocommerce-message .button,
    .woocommerce-error .button,
    .woocommerce-info .button {
        width: 100% !important;
    }
}
