/* ============================================================
   CUSTOM CSS — Extra WooCommerce Grid & Page Fixes
   These rules have maximum specificity to override ALL defaults
   ============================================================ */

/* ★ NUCLEAR GRID FIX — Guarantees 4-col grid on shop/category pages ★ */
body.woocommerce ul.products[class],
body.woocommerce-page ul.products[class],
body .woocommerce ul.products,
body .woocommerce-page ul.products,
.woocommerce .products,
.woocommerce-page .products,
.wp-block-woocommerce-product-collection ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
}

@media (min-width: 768px) {
    body.woocommerce ul.products[class],
    body.woocommerce-page ul.products[class],
    body .woocommerce ul.products,
    body .woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 1024px) {
    body.woocommerce ul.products[class],
    body.woocommerce-page ul.products[class],
    body .woocommerce ul.products,
    body .woocommerce-page ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Kill ALL clearfixes & floats that break grid */
body.woocommerce ul.products::before,
body.woocommerce ul.products::after,
body.woocommerce-page ul.products::before,
body.woocommerce-page ul.products::after,
body .woocommerce ul.products::before,
body .woocommerce ul.products::after {
    display: none !important;
    content: none !important;
}

/* Individual product card */
body .woocommerce ul.products li.product,
body .woocommerce-page ul.products li.product,
.woocommerce ul.products li.product,
ul.products li.product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
    list-style: none !important;
}

body .woocommerce ul.products li.product:hover {
    transform: translateY(-8px);
    border-color: rgba(5, 150, 105, 0.3);
    box-shadow: 0 20px 40px -12px rgba(5, 150, 105, 0.15);
}

/* Product image fix */
body .woocommerce ul.products li.product a img,
body .woocommerce ul.products li.product img.attachment-woocommerce_thumbnail,
.woocommerce ul.products li.product a img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0 !important;
    margin: 0 !important;
    display: block !important;
}

/* Product title */
body .woocommerce ul.products li.product .woocommerce-loop-product__title,
body .woocommerce ul.products li.product h2.woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
    color: #ffffff !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    padding: 0.875rem 1rem 0.25rem !important;
    margin: 0 !important;
    line-height: 1.4;
}

/* Product price */
body .woocommerce ul.products li.product .price,
body .woocommerce ul.products li.product .price span.woocommerce-Price-amount,
.woocommerce ul.products li.product span.price {
    color: #34d399 !important;
    font-weight: 700 !important;
    font-size: 1.125rem !important;
    padding: 0.25rem 1rem 0.5rem !important;
    display: block !important;
}

/* Add to cart button */
body .woocommerce ul.products li.product a.button,
body .woocommerce ul.products li.product a.add_to_cart_button,
.woocommerce ul.products li.product .button {
    background: linear-gradient(135deg, #059669, #14b8a6) !important;
    color: white !important;
    border-radius: 12px !important;
    border: none !important;
    padding: 0.625rem 1.25rem !important;
    margin: 0.25rem 1rem 1rem !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    display: inline-block !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

body .woocommerce ul.products li.product a.button:hover {
    box-shadow: 0 12px 24px -8px rgba(5, 150, 105, 0.4) !important;
    transform: translateY(-2px);
}

/* ============================================================
   CATEGORY PAGE FIXES
   ============================================================ */

/* Category page title */
.woocommerce .term-description,
.woocommerce-page .term-description {
    color: #94a3b8;
    margin-bottom: 2rem;
    text-align: center;
}

.woocommerce .term-description p {
    max-width: 42rem;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================================
   SINGLE PRODUCT FIXES
   ============================================================ */
.woocommerce div.product div.images {
    border-radius: 24px;
    overflow: hidden;
}

.woocommerce div.product div.summary {
    color: #cbd5e1;
}

/* ============================================================
   ELEMENTOR DARK THEME
   ============================================================ */
.elementor-widget-text-editor {
    color: #cbd5e1;
}

.elementor-heading-title {
    color: #ffffff;
}

.elementor-widget-image img {
    border-radius: 16px;
}

/* ============================================================
   RELATED PRODUCTS + UP-SELLS — FULL DARK CARD STYLING
   ============================================================ */

/* Grid layout */
body .woocommerce .related ul.products,
body .woocommerce .up-sells ul.products,
body .woocommerce section.related ul.products,
body section.related ul.products,
.related.products ul.products,
.up-sells ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
}

@media (min-width: 768px) {
    body .woocommerce .related ul.products,
    body .woocommerce .up-sells ul.products,
    body .woocommerce section.related ul.products,
    body section.related ul.products,
    .related.products ul.products,
    .up-sells ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Kill clearfixes */
body .woocommerce .related ul.products::before,
body .woocommerce .related ul.products::after,
body .woocommerce .up-sells ul.products::before,
body .woocommerce .up-sells ul.products::after {
    display: none !important;
    content: none !important;
}

/* Card styling — dark background, rounded, hover lift */
body .woocommerce .related ul.products li.product,
body .woocommerce .up-sells ul.products li.product,
.related.products ul.products li.product,
section.related ul.products li.product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

body .woocommerce .related ul.products li.product:hover,
body .woocommerce .up-sells ul.products li.product:hover {
    transform: translateY(-8px) !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
    box-shadow: 0 20px 40px -12px rgba(5, 150, 105, 0.15) !important;
}

/* Related product image — fill width, square aspect */
body .woocommerce .related ul.products li.product a img,
body .woocommerce .up-sells ul.products li.product a img,
body .woocommerce .related ul.products li.product img,
body .woocommerce .up-sells ul.products li.product img,
section.related ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: block !important;
}

/* Related product title */
body .woocommerce .related ul.products li.product .woocommerce-loop-product__title,
body .woocommerce .related ul.products li.product h2,
body .woocommerce .up-sells ul.products li.product .woocommerce-loop-product__title,
body .woocommerce .up-sells ul.products li.product h2,
section.related ul.products li.product h2 {
    color: #ffffff !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    padding: 0.875rem 1rem 0.25rem !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

/* Related product price — single line, no wrapping */
body .woocommerce .related ul.products li.product .price,
body .woocommerce .related ul.products li.product .price span,
body .woocommerce .related ul.products li.product .price bdi,
body .woocommerce .related ul.products li.product .price .woocommerce-Price-amount,
body .woocommerce .up-sells ul.products li.product .price,
body .woocommerce .up-sells ul.products li.product .price span,
body .woocommerce .up-sells ul.products li.product .price bdi,
body .woocommerce .up-sells ul.products li.product .price .woocommerce-Price-amount,
section.related ul.products li.product .price,
section.related ul.products li.product .price span {
    color: #34d399 !important;
    font-weight: 700 !important;
    font-size: 1.125rem !important;
    padding: 0.25rem 1rem 0.5rem !important;
    display: inline !important;
    white-space: nowrap !important;
}

/* Price currency symbol — keep inline */
body .woocommerce .related ul.products li.product .price .woocommerce-Price-currencySymbol,
body .woocommerce .up-sells ul.products li.product .price .woocommerce-Price-currencySymbol {
    display: inline !important;
    margin-right: 0 !important;
}

/* Related product button */
body .woocommerce .related ul.products li.product a.button,
body .woocommerce .related ul.products li.product a.add_to_cart_button,
body .woocommerce .up-sells ul.products li.product a.button,
body .woocommerce .up-sells ul.products li.product a.add_to_cart_button,
section.related ul.products li.product .button {
    background: linear-gradient(135deg, #059669, #14b8a6) !important;
    color: white !important;
    border-radius: 12px !important;
    border: none !important;
    padding: 0.625rem 1.25rem !important;
    margin: 0.25rem 1rem 1rem !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    display: inline-block !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

body .woocommerce .related ul.products li.product a.button:hover,
body .woocommerce .up-sells ul.products li.product a.button:hover {
    box-shadow: 0 12px 24px -8px rgba(5, 150, 105, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* Related products section heading */
body .woocommerce .related.products > h2,
body .woocommerce section.related > h2,
body .woocommerce .up-sells > h2 {
    color: #ffffff !important;
    font-size: 1.75rem !important;
    margin-bottom: 1.5rem !important;
}

/* Star ratings in related */
body .woocommerce .related ul.products li.product .star-rating,
body .woocommerce .up-sells ul.products li.product .star-rating {
    padding: 0 1rem !important;
    margin: 0.25rem 0 !important;
}

/* ============================================================
   MEGA MENU — FORCE HIDDEN (backup if CSS vars don't load)
   ============================================================ */
.sw-mega-menu-panel {
    display: none !important;
}

.sw-nav-dropdown-wrapper:hover .sw-mega-menu-panel {
    display: block !important;
}

/* ============================================================
   BLOG POST / PAGE CONTENT TYPOGRAPHY
   ============================================================ */
.sw-article-body,
.sw-post-content .sw-article-body,
.entry-content,
.page-content,
.sw-post-content .entry-content {
    color: #cbd5e1;
    font-size: 1.0625rem;
    line-height: 1.85;
}

.sw-article-body h1,
.sw-article-body h2,
.sw-article-body h3,
.sw-article-body h4,
.sw-article-body h5,
.sw-article-body h6 {
    color: #ffffff;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.sw-article-body h1 { font-size: 2rem; }
.sw-article-body h2 { font-size: 1.625rem; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 0.5rem; }
.sw-article-body h3 { font-size: 1.375rem; }
.sw-article-body h4 { font-size: 1.125rem; }

.sw-article-body p {
    margin-bottom: 1.25rem;
    color: #cbd5e1;
}

.sw-article-body a {
    color: #34d399;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sw-article-body a:hover {
    color: #5eead4;
}

.sw-article-body strong,
.sw-article-body b {
    color: #f1f5f9;
    font-weight: 700;
}

.sw-article-body em,
.sw-article-body i {
    color: #e2e8f0;
}

.sw-article-body ul,
.sw-article-body ol {
    margin: 1rem 0 1.5rem 1.5rem;
    padding: 0;
    color: #cbd5e1;
}

.sw-article-body ul { list-style: disc; }
.sw-article-body ol { list-style: decimal; }

.sw-article-body li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
    line-height: 1.7;
}

.sw-article-body li::marker {
    color: #34d399;
}

.sw-article-body blockquote {
    border-left: 4px solid #059669;
    background: rgba(5, 150, 105, 0.08);
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: 0 12px 12px 0;
    color: #e2e8f0;
    font-style: italic;
}

.sw-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.sw-article-body figure {
    margin: 1.5rem 0;
}

.sw-article-body figcaption {
    text-align: center;
    color: #64748b;
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.sw-article-body pre,
.sw-article-body code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #34d399;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
}

.sw-article-body code {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.sw-article-body pre {
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.sw-article-body pre code {
    background: none;
    border: none;
    padding: 0;
}

.sw-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
}

.sw-article-body th {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sw-article-body td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}

.sw-article-body tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.sw-article-body hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2rem 0;
}

.sw-article-body .wp-block-image,
.sw-article-body .wp-block-gallery {
    margin: 1.5rem 0;
}

.sw-article-body .wp-block-image img {
    border-radius: 12px;
}

/* Excerpt label fix */
.sw-post-content .sw-article-body > p:first-child {
    font-size: 1.125rem;
    color: #e2e8f0;
}

/* Post navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
}

.post-navigation a {
    color: #34d399;
    text-decoration: none;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    flex: 1;
    transition: all 0.2s ease;
}

.post-navigation a:hover {
    border-color: rgba(5,150,105,0.3);
    background: rgba(5,150,105,0.05);
}

/* Tags */
.sw-post-content .tag-links a,
.sw-post-content a[rel="tag"] {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: 8px;
    color: #34d399;
    font-size: 0.8125rem;
    margin: 0.25rem;
    text-decoration: none;
}

.sw-post-content a[rel="tag"]:hover {
    background: rgba(5, 150, 105, 0.2);
}

/* Category links in post meta */
.sw-post-content .cat-links a,
.sw-post-content a[rel="category tag"] {
    color: #34d399;
    text-decoration: none;
}

/* Page content (non-blog) also gets styled */
.page .sw-article-body,
.page-template .sw-article-body {
    color: #cbd5e1;
    line-height: 1.85;
}
