/* ==========================================================================
   Single Blog Post Styles (Redesign)
   ========================================================================== */

/* hide duplicated publish date */
header.entry-header.ast-no-title {
    display: none;
}

/* hide borders */
div#primary,
div#secondary {
    border: none !important;
}

/* hide nawigacja next/prev wpis */
nav.navigation.post-navigation {
    display: none;
}

/* Layout Adjustments - FLEXBOX RESPONSIVENESS */
.single-post-grid {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row-reverse;
    /* Desktop: Sidebar Left (Secondary), Content Right (Primary) */
    width: 100%;
    gap: 0;
}

/* Primary Content */
.single-post-grid #primary {
    width: 70%;
    margin: 0;
    float: none;
    /* Override Astra floats */
    padding: 0;
}

/* Sidebar */
.single-post-grid #secondary {
    width: 30%;
    margin: 0;
    float: none;
    /* Override Astra floats */
    padding: 0 !important;
}

/* Sidebar Wrapper - Consistent with shop & product sidebars */
.single-post-grid #secondary .sidebar-main {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    overflow: hidden;
}

/* Ensure sidebar layout works nicely */
.single-post #primary {
    margin-top: 0;
}

/* Custom Hero Section */
.single-post-hero {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.single-post-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
}

.single-post-hero .hero-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    width: 100%;
}

.single-post-hero .entry-title {
    color: #fff;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.single-post-hero .hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    align-items: center;
}

.single-post-hero .hero-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.single-post-hero .hero-meta i {
    color: var(--primary-color);
}

/* Base Post Card */
.single-post article.post {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    border: none;
    padding: 0;
    padding-top: 0 !important;
    margin: 30px 30px 30px 15px !important;
    border: 1px solid var(--border-color);
}

.single-post .entry-content {
    padding: 0;
    background: transparent;
}

/* Typography refinements */
.single-post .entry-content p {
    margin-bottom: 1.5em;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Sidebar Styles */
#secondary .widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
    display: inline-block;
}

#secondary .widget {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 25px;
    border: none;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

#secondary .widget:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Product list in sidebar */
#secondary ul.product_list_widget li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

#secondary ul.product_list_widget li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

#secondary ul.product_list_widget img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

#secondary ul.product_list_widget a {
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    line-height: 1.3;
}

#secondary ul.product_list_widget a:hover {
    color: var(--primary-color);
}

/* =========================================
   ASB Shortcode / Widget Styles (Dark Mode)
   ========================================= */

/* Main Container */
.asb-products-container {
    margin: 30px 0;
}

.asb-products-title {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: 600;
}

/* Individual Product Card */
.asb-product-item .asb-product-inner {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.asb-product-item .asb-product-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* Image */
.asb-product-image {
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 8px;
}

.asb-product-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Title */
.asb-product-title {
    font-size: 1rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.asb-product-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.asb-product-title a:hover {
    color: var(--primary-color);
}

/* Price */
.asb-product-price {
    font-weight: 700;
    color: var(--primary-color);
    margin-top: auto;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.asb-product-price del {
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: normal;
    margin-right: 5px;
}

/* Rating */
.asb-product-rating {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #f1c40f;
}

/* Action Button */
.asb-product-actions .button,
.asb-product-actions .added_to_cart {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--primary-color) !important;
    color: #000;
    padding: 14px 5px !important;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
    margin-left: 0 !important;
}

.asb-product-actions .button:hover {
    opacity: 0.9;
    color: #000;
}

/* Badge */
.asb-sale-badge {
    background-color: var(--primary-color);
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 5;
}

/* Dark Mode Overrides */
body[data-theme="dark"] .asb-product-item .asb-product-inner {
    border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .single-post-hero {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* desktop layout manual enhancements */
.single-post-hero {
    border-radius: 10px;
    margin: 30px 30px 30px 15px;
    width: auto;
}

/* Manual enhances */
.asb-product-item {
    background: var(--asb-product-item-bg);
    border: var(--asb-product-item-border);
}

/* =========================================
   Smart Category Sidebar Styles
   ========================================= */

/* Category Button */
.goled-cat-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    color: #000;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 25px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

a.goled-cat-btn.goled-blog-btn {
    margin-bottom: 0;
}

.goled-cat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    color: #000;
}

.goled-cat-btn i {
    font-size: 0.9em;
}

/* Sidebar Products List */
.goled-sidebar-products h4.swidget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.goled-sidebar-products ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.goled-sidebar-products li {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.goled-sidebar-products li:last-child {
    border: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.sp-prod-link {
    display: flex;
    gap: 15px;
    text-decoration: none;
    align-items: center;
    color: var(--text-color);
}

.sp-prod-link:hover .sp-prod-title {
    color: var(--primary-color);
}

.sp-prod-img {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: #f4f4f4;
}

.sp-prod-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-prod-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sp-prod-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    transition: color 0.2s;
}

.sp-prod-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
}

.sp-prod-price del {
    color: var(--text-muted);
    font-weight: 400;
    margin-right: 5px;
    font-size: 0.85em;
}

/* Dark Mode Adjustments */
body[data-theme="dark"] .sp-prod-img {
    background: #222;
}

body[data-theme="dark"] .goled-cat-btn {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Comment section manual improvements */
textarea#comment,
input#submit {
    border-radius: 12px !important;
}

input#submit {
    background-color: var(--primary-color) !important;
}

.cf-turnstile div {
    border-radius: 10px;
    overflow: hidden;
    height: 67px;
    border: 1px solid #787878;
    border-bottom: 2px solid #787878;
}

.ast-comment {
    background-color: var(--ast-global-color-secondary, --ast-global-color-5);
    color: var(--ast-global-color-2) !important;
    border: 1px solid var(--ast-border-color);
    border-radius: 12px;
    padding: 1em !important;
}

div#respond {
    border-top: none !important;
}

.asb-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1178px) {
    .single-post-grid {
        flex-direction: column;
    }

    .single-post-grid #primary,
    .single-post-grid #secondary {
        width: 100%;
        padding: 0;
    }

    .single-post-grid #secondary {
        margin-top: 5px;
    }

    .single-post-hero .entry-title {
        font-size: 1.5rem;
    }

    .single-post-hero .hero-content {
        padding: 20px;
    }

    .single-post-hero {
        height: 300px;
        margin: 15px;
    }

    .single-post article.post {
        margin: 15px !important;
    }

    div#respond {
        padding: 15px 20px 0;
    }

    div#secondary {
        margin: 0 20px 20px !important;
        box-sizing: border-box;
        width: auto !important;
    }

    .sidebar-main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    aside.widget.widget_blog_back {
        grid-column: span 2;
        margin-bottom: 0 !important;
        padding-bottom: 20px !important;
    }

    aside.widget.widget_recent_entries {
        grid-column: span 2;
    }

    aside.widget.widget_smart_promotions,
    aside.widget.widget_smart_category {
        margin-bottom: 0 !important;
    }
}

@media (max-width: 1024px) {
    .single-post .widget {
        border: none !important;
    }

    .single-post .sidebar-main span.sp-prod-title {
        --webkit-line-clamp: 2;
        overflow: hidden;
        display: -webkit-box;
        --webkit-box-orient: vertical;
    }

    .goled-sidebar-products li:last-child {
        padding-bottom: 15px !important;
    }

    .asb-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .asb-products-grid .asb-product-item:nth-child(4) {
        display: none;
    }
}

@media (max-width: 768px) {
    .asb-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .asb-products-grid .asb-product-item:nth-child(4) {
        display: block !important;
    }
}

@media (max-width: 620px) {

    .sidebar-main {
        grid-template-columns: 1fr;
    }

    aside.widget.widget_blog_back,
    aside.widget.widget_recent_entries {
        grid-column: span 1;
    }
}

@media (min-width:1179px) {
    .sidebar-main {
        margin: 30px 15px 30px 30px;
    }
}