/*
 Theme Name:        Polymart Premium B2B Theme
 Description:       Polymart MMC Premium Standalone Theme. Fast, clean, lightweight B2B.
 Author:            Spark Digital
 Version:           1.0.0
 Text Domain:       polymart
 */

/* ==========================================================================
   1. GLOBAL SYSTEM VARIABLES & RESET
   ========================================================================== */
:root {
    --blue: #0079bf;
    --blue-dark: #005f96;
    --blue-deeper: #003f6b;
    --blue-light: #e8f4fb;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --font-head: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --header-height: 78px;
    --header-sticky-height: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--gray-900);
    font-weight: 700;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--blue-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* WordPress Core Alignment Styles */
.alignleft { float: left; margin: 0 20px 20px 0; }
.alignright { float: right; margin: 0 0 20px 20px; }
.aligncenter { display: block; margin: 0 auto 20px auto; text-align: center; }
.clear { clear: both; }

/* Page Layout Wrappers */
.website-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-page-wrapper {
    flex: 1;
    width: 100%;
    margin-top: 0 !important;
}

/* ==========================================================================
   2. GLASSMORPHISM FLOATING PILL HEADER (STANDALONE)
   ========================================================================== */
.pm-header {
    position: fixed !important;
    top: 20px;
    left: 50%;
    transform: translate3d(-50%, 0, 0) !important;
    width: 92%;
    max-width: 1280px;
    border-radius: 9999px;
    z-index: 10000;
    will-change: transform;
    
    /* Light Glassmorphism Base Styles - Enhanced Cam Hissiyatı */
    background-color: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow: 
        0 8px 32px rgba(15, 26, 46, 0.08), 
        0 2px 4px rgba(15, 26, 46, 0.02),
        inset 0 1px 2px rgba(255, 255, 255, 0.6) !important;
    
    padding: 0 32px;
    
    /* Smooth Scroll Shrinking Effect - Optimized for GPU acceleration (no layout-triggering transitions) */
    transition: 
        transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        border-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* WordPress Admin Bar Compatibility */
body.admin-bar .pm-header {
    top: 56px !important;
}
body.admin-bar .pm-header.pm-sticked {
    top: 56px !important; /* Managed by transform */
}
@media (max-width: 782px) {
    body.admin-bar .pm-header {
        top: 70px !important;
    }
    body.admin-bar .pm-header.pm-sticked {
        top: 70px !important; /* Managed by transform */
    }
}


.pm-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 76px; /* Slightly taller on rest */
    width: 100%;
    transition: height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Logo Alignment */
.pm-logo {
    display: flex;
    align-items: center;
}

.pm-logo img {
    max-height: 44px; /* Slightly larger logo for better visibility */
    width: auto;
    display: block;
    transition: transform 0.3s ease, max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pm-logo:hover img {
    transform: scale(1.04);
}

/* Navigation Menu */
.pm-nav {
    display: flex;
    align-items: center;
}

.pm-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 8px;
}

.pm-menu > li {
    position: relative !important; /* Alt menü hizalaması için */
}

/* Ana menü bağlantıları */
.pm-menu > li > a {
    font-family: var(--font-head) !important;
    color: var(--gray-900) !important;
    font-weight: 600 !important; /* Semi-bold for premium clarity */
    font-size: 15px !important; /* Elegant slightly more compact size */
    letter-spacing: 0.3px;
    padding: 8px 16px;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex !important;
    align-items: center;
}

/* Üzerine gelince (Hover) oluşan hafif arka plan dolgusu */
.pm-menu > li > a:hover {
    color: var(--blue) !important;
    background-color: rgba(15, 26, 46, 0.06) !important;
}

/* Aktif menü elemanı (Seçili sayfa) arka plan dolgusu */
.pm-menu > li.current-menu-item > a {
    color: var(--blue) !important;
    background-color: rgba(0, 121, 191, 0.08);
}

/* ==========================================================================
   DROPDOWN INDICATOR (ALT MENÜSÜ OLAN ELEMANLAR İÇİN OK İŞARETİ)
   ========================================================================== */
.pm-menu > li.menu-item-has-children > a {
    padding-right: 28px !important; /* Ok için sağ tarafta yer açıyoruz */
    position: relative !important;
}

/* Küçük aşağı yönlü ok sembolü */
.pm-menu > li.menu-item-has-children > a::after {
    content: '' !important;
    position: absolute !important;
    right: 12px !important;
    top: 52% !important;
    transform: translateY(-50%) !important;
    width: 8px !important;
    height: 5px !important;
    background-color: currentColor !important;
    clip-path: polygon(100% 0, 0 0, 50% 100%) !important; /* CSS üçgen */
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    opacity: 0.6 !important;
}

/* Hover olunduğunda oku yukarı doğru döndürme animasyonu */
.pm-menu > li.menu-item-has-children:hover > a::after {
    transform: translateY(-50%) rotate(180deg) !important;
    opacity: 1 !important;
}

/* ==========================================================================
   DROPDOWN SUB-MENU (ALT MENÜ TASARIMI)
   ========================================================================== */
.pm-menu .sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(15px) !important;
    min-width: 260px !important;
    
    /* Parlak Cam Efektli Dropdown Arka Planı - Refined to be more solid & legible */
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) saturate(185%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(185%) !important;
    border: 1px solid rgba(15, 26, 46, 0.08) !important; /* Soft dark border for clear edge definition */
    border-radius: 16px !important;
    box-shadow: 
        0 20px 40px rgba(15, 26, 46, 0.12),
        inset 0 1px 2px rgba(255, 255, 255, 0.9) !important;
    
    padding: 12px !important;
    list-style: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    
    /* Hover olana kadar görünmez yapma */
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.3s !important;
    z-index: 100000 !important;
}

/* Görünmez hover köprüsü (menünün kapanmasını engellemek için) */
.pm-menu .sub-menu::before {
    content: '' !important;
    position: absolute !important;
    top: -20px !important;
    left: 0 !important;
    right: 0 !important;
    height: 20px !important;
    background: transparent !important;
    pointer-events: auto !important;
}

/* Hover durumunda alt menüyü gösterip yukarı doğru süzme */
.pm-menu > li:hover .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(8px) !important;
}

/* Alt menü liste elemanları */
.pm-menu .sub-menu li {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Alt menü linkleri */
.pm-menu .sub-menu li a {
    font-family: var(--font-head) !important;
    color: var(--gray-900) !important; /* High contrast dark color */
    font-size: 14.5px !important;
    font-weight: 600 !important; /* Semi-bold for excellent legibility */
    padding: 10px 16px !important;
    border-radius: 8px !important;
    display: block !important;
    text-align: left !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

/* Alt menü link hover efekti (Sola hafif kayma ve mavi renk) */
.pm-menu .sub-menu li a:hover {
    color: var(--blue) !important;
    background-color: rgba(0, 121, 191, 0.05) !important;
    padding-left: 20px !important;
}

.pm-menu > li:last-child > a:hover::before {
    left: 100%;
}

/* Right Section Actions */
.pm-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pm-search-btn, .pm-cart-btn, .pm-mobile-toggle {
    color: var(--gray-900);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pm-search-btn:hover, .pm-cart-btn:hover, .pm-mobile-toggle:hover {
    color: var(--blue);
    transform: scale(1.08);
}

/* Cart Counter */
.pm-cart-btn {
    position: relative;
    padding: 4px;
}

.pm-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--blue);
    color: var(--white);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 121, 191, 0.3);
}

/* Mobile Hamburger button (hidden on desktop) */
.pm-mobile-toggle {
    display: none;
}

/* STICKY HEADER SCROLL STATE */
.pm-header.pm-sticked {
    transform: translate3d(-50%, -6px, 0) !important; /* Hardware-accelerated movement instead of top offset change */
    background-color: rgba(255, 255, 255, 0.72) !important; /* More transparent white background on scroll */
    border: 1px solid rgba(255, 255, 255, 0.65) !important;
    box-shadow: 
        0 12px 35px rgba(15, 26, 46, 0.12),
        inset 0 1px 2px rgba(255, 255, 255, 0.7) !important;
}

.pm-header.pm-sticked .pm-header-container {
    height: 62px; /* Slimmer when scrolled */
}

.pm-header.pm-sticked .pm-logo img {
    max-height: 36px; /* Smaller logo when scrolled */
}

/* ==========================================================================
   3. MOBILE NAVIGATION DRAWER
   ========================================================================== */
.pm-mobile-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 26, 46, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.pm-mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer !important; /* iOS Safari click event fix */
}

.pm-mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background-color: var(--white);
    z-index: 99999;
    box-shadow: -10px 0 40px rgba(15, 26, 46, 0.15);
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pm-mobile-drawer.active {
    right: 0;
}

.pm-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pm-drawer-close {
    background: none;
    border: none;
    color: var(--gray-900);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    padding: 12px !important; /* Touch target size expansion */
    margin: -12px !important; /* Negative margin to maintain alignment */
}

.pm-drawer-close:hover {
    color: var(--blue);
}

.pm-drawer-nav {
    flex: 1 !important;
    overflow-y: auto !important; /* Make ONLY navigation links scrollable */
    -webkit-overflow-scrolling: touch !important; /* Momentum scrolling on iOS Safari */
    padding-right: 8px !important; /* Avoid scrollbar overlay issues */
}

.pm-mobile-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pm-mobile-menu a {
    font-family: var(--font-head) !important;
    color: var(--gray-900);
    font-weight: 500;
    font-size: 18px;
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.pm-mobile-menu a:hover {
    color: var(--blue);
    padding-left: 8px;
}

/* Mobile Sub-menu Navigation Drawer Styling */
.pm-mobile-menu .sub-menu {
    list-style: none !important;
    padding-left: 20px !important;
    margin-top: 8px !important;
    display: none !important; /* Başlangıçta gizli */
    flex-direction: column !important;
    gap: 8px !important;
}

.pm-mobile-menu .menu-item-has-children.active-submenu > .sub-menu {
    display: flex !important; /* Aktifken görünür */
}

/* Mobil menü ok işareti */
.pm-mobile-menu li.menu-item-has-children > a {
    padding-right: 32px !important;
    position: relative !important;
}

.pm-mobile-menu li.menu-item-has-children > a::after {
    content: '' !important;
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 10px !important;
    height: 6px !important;
    background-color: currentColor !important;
    clip-path: polygon(100% 0, 0 0, 50% 100%) !important;
    transition: transform 0.3s ease !important;
    opacity: 0.6 !important;
}

.pm-mobile-menu li.menu-item-has-children.active-submenu > a::after {
    transform: translateY(-50%) rotate(180deg) !important;
    opacity: 1 !important;
}

.pm-mobile-menu .sub-menu li {
    width: 100% !important;
    margin: 0 !important;
}

.pm-mobile-menu .sub-menu li a {
    font-family: var(--font-head) !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    color: var(--gray-600) !important;
    border-bottom: none !important;
    padding: 6px 0 !important;
    text-transform: none !important;
    transition: all 0.25s ease !important;
}

.pm-mobile-menu .sub-menu li a:hover {
    color: var(--blue) !important;
    padding-left: 6px !important;
}

/* Responsive Menu Adjustments */
@media (max-width: 1024px) {
    .pm-header {
        top: 15px;
        padding: 0 20px;
        width: 95%;
    }
    
    .pm-header-container {
        height: 68px;
    }
    
    .pm-nav {
        display: none; /* Hide main horizontal menu on tablet/mobile */
    }
    
    .pm-mobile-toggle {
        display: inline-flex;
    }
    
    .pm-logo img {
        max-height: 42px;
    }
}

/* Space for floating header (Only on non-home pages) */
body:not(.home) .main-page-wrapper {
    padding-top: 120px !important;
}

/* ==========================================================================
   4. STANDALONE WOOCOMMERCE PRODUCT GRID STYLING
   ========================================================================== */
.woocommerce .products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 40px 0 !important;
}

.woocommerce .products::before,
.woocommerce .products::after {
    display: none !important; /* Remove legacy clear floats from WooCommerce default layouts */
}

/* WooCommerce Product Card Layout */
.woocommerce ul.products li.product {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    margin: 0 !important;
    width: 100% !important;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(15, 26, 46, 0.08);
    border-color: var(--blue-light);
}

.woocommerce ul.products li.product img {
    margin: 0 auto 15px auto !important;
    max-height: 200px;
    object-fit: contain;
    width: auto !important;
    display: block;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px !important;
    line-height: 1.4;
    min-height: 48px; /* Consistent height for product titles */
}

/* Custom Add to Cart / Quick Quote Button Style */
.woocommerce ul.products li.product .button {
    background-color: var(--blue) !important;
    color: var(--white) !important;
    font-family: var(--font-head);
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 12px 20px !important;
    border-radius: 4px !important;
    margin-top: 15px !important;
    display: inline-block !important;
    width: 100%;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 121, 191, 0.2) !important;
    transition: all 0.3s ease !important;
}

.woocommerce ul.products li.product .button:hover {
    background-color: var(--blue-dark) !important;
    box-shadow: 0 6px 18px rgba(0, 121, 191, 0.4) !important;
}

/* Responsive Product Grid */
@media (max-width: 1200px) {
    .woocommerce .products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 768px) {
    .woocommerce .products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .woocommerce ul.products li.product {
        padding: 12px;
    }
    
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px;
        min-height: 40px;
    }
}

/* ==========================================================================
   5. WOOCOMMERCE PAGINATION STYLING
   ========================================================================== */
.woocommerce-pagination {
    text-align: center !important;
    margin: 60px 0 40px 0 !important;
    padding: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
}

.woocommerce-pagination ul.page-numbers {
    display: inline-flex !important;
    gap: 8px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

.woocommerce-pagination ul.page-numbers li {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-pagination ul.page-numbers li span.page-numbers,
.woocommerce-pagination ul.page-numbers li a.page-numbers {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 6px !important;
    border-radius: 8px !important; /* Modern rounded square */
    font-family: var(--font-head), sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-sizing: border-box !important;
}

/* Inactive State */
.woocommerce-pagination ul.page-numbers li a.page-numbers {
    background-color: #ffffff !important;
    color: var(--gray-800) !important;
    border: 1px solid var(--gray-200) !important;
}

/* Active State */
.woocommerce-pagination ul.page-numbers li span.page-numbers.current {
    background-color: var(--blue) !important;
    color: var(--white) !important;
    border: 1px solid var(--blue) !important;
    box-shadow: 0 4px 12px rgba(0, 121, 191, 0.2) !important;
}

/* Hover State */
.woocommerce-pagination ul.page-numbers li a.page-numbers:hover {
    background-color: var(--blue-light) !important;
    color: var(--blue) !important;
    border-color: var(--blue) !important;
}

/* Next / Prev specific text/icon override */
.woocommerce-pagination ul.page-numbers li a.next,
.woocommerce-pagination ul.page-numbers li a.prev {
    font-size: 16px !important;
}

/* ==========================================================================
   6. WOOCOMMERCE ADD TO CART BUTTON RESET
   ========================================================================== */
.single_add_to_cart_button,
.woocommerce-variation-add-to-cart .single_add_to_cart_button,
.variations_form .single_add_to_cart_button,
.woocommerce ul.products li.product .button {
    transform: none !important;
}