/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* Custom Deal Card Styles */
.cd-deal-card-li {
    list-style: none;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.cd-deal-card-li:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cd-deal-card {
    display: flex;
    min-height: 200px;
}

/* Image Column */
.cd-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24.333%;
    position: relative;
    background: #f8f9fa;
    width: 100%;
    aspect-ratio: 1 / 1; /* Keeps a nice square ratio */
    overflow: hidden;
    padding: 15px;
}

.cd-card-image a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.cd-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Keeps full image visible inside */
    object-position: center;
    transition: transform 0.3s ease;
}

.cd-card-image:hover img {
    transform: scale(1.1);
}

/* Content Column */
.cd-card-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header Card */
.cd-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cd-vote-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #e1e8ed;
}

.cd-deal-temp-arrow {
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.2s ease;
}

.cd-deal-temp-arrow.up:hover {
    color: #27ae60;
    stroke: #27ae60;
}

.cd-deal-temp-arrow.down:hover {
    color: #e74c3c;
    stroke: #e74c3c;
}

.cd-deal-temp-arrow.voted.up {
    color: #27ae60;
    stroke: #27ae60;
}

.cd-deal-temp-arrow.voted.down {
    color: #e74c3c;
    stroke: #e74c3c;
}


/* Notification System Styles */
.cd-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.cd-notification-info {
    background: #007cba;
}

.cd-notification-success {
    background: #27ae60;
}

.cd-notification-error {
    background: #e74c3c;
}

.cd-notification-warning {
    background: #f39c12;
}

.cd-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cd-notification.hide {
    opacity: 0;
    transform: translateX(100%);
}

.cd-deal-score {
    font-weight: 600;
    color: #333;
    min-width: 20px;
    text-align: center;
}

.cd-posted-time {
    background: #f8f9fa;
    color: #7f8c8d;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #e1e8ed;
}

/* Title */
.cd-card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
    overflow: hidden;
   display: -webkit-box;
   -webkit-line-clamp: 2; /* number of lines to show */
           line-clamp: 2; 
   -webkit-box-orient: vertical;
}

.cd-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cd-card-title a:hover {
    color: #007cba;
}

/* Price Section */

.price {
    font-size: 20px;
    font-weight: 700;
    margin-right: 10px;
}

.cd-card-price {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 15px;
}


.cd-card-price .sale-price {
    font-size: 20px ;
    font-weight: 700 ;
    color: #ce1734;
    white-space: nowrap;
    margin-right: 0;
}

.cd-card-price .regular-price {
    color: #7f8c8d;
    font-size: 16px;
    text-decoration: line-through;
    white-space: nowrap;
}

.cd-card-price del {
    color: #7f8c8d;
    font-size: 16px;
}

.cd-availability {
    color: #7f8c8d;
    font-size: 14px;
    white-space: nowrap;
    margin-left: 10px;
}

.cd-deal-discount-badge {
    background: #eef8ec;
    color: #238012;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.cd-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    margin-left: 10px;
}

.cd-author-avatar {
    width: 20px ;
    height: 20px ;
    border-radius: 50% ;
    display: inline-block;
    vertical-align: middle;
    object-fit: scale-down;
    border: 1px solid #e1e8ed;
}

.cd-author-text {
    color: #7f8c8d;
    font-size: 12px;
}

/* Description */
.cd-card-excerpt {
    color: #7f8c8d;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Footer Card */
.cd-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.cd-footer-left {
    display: flex;
    gap: 20px;
}

.cd-footer-icon {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.2s ease;
    text-decoration: none;
}

.cd-footer-icon:hover {
    color: #007cba;
    text-decoration: none;
}


.cd-icon-count {
    font-size: 14px;
    font-weight: 500;
}

/* Get Deal Button */
.cd-get-deal-btn {
    background: #1976d2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.cd-get-deal-btn:hover {
    background: #005a87;
    color: white;
}

.cd-get-deal-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cd-deal-card {
        flex-direction: row;
        display: block;
    }
    
    .cd-card-image {
        flex: none;
        padding: 15px;
        border-bottom: 1px solid #eee;
        width: 100%;
        height: 250px;
    }

    .cd-card-image a {
        width: 100%;
        height: 100%;
        display: block;
    }

    .cd-card-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .cd-card-content {
        padding: 20px;
    }
    
    .cd-card-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .cd-card-price {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .cd-card-price .sale-price {
        font-size: 18px;
    }
    
    .cd-card-price .regular-price {
        font-size: 14px;
    }
    
    .cd-deal-discount-badge {
        font-size: 11px;
        padding: 1px 5px;
    }
    
    .cd-availability {
        font-size: 13px;
        margin-left: 0;
    }
    
    .cd-author {
        margin-left: 0;
    }
    
    .cd-card-excerpt {
        margin-bottom: 20px;
        font-size: 14px;
    }
    
    .cd-card-footer {
        flex-direction: row;
        gap: 15px;
        align-items: stretch;
    }
    
    .cd-footer-left {
        justify-content: center;
        gap: 20px;
    }
    
    .cd-get-deal-btn {
        padding: 12px 20px;
        font-size: 14px;
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cd-card-content {
        padding: 10px;
    }
    
    .cd-card-title {
        font-size: 16px;
    }
    
    .cd-card-price {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .cd-card-price .sale-price {
        font-size: 16px;
    }
    
    .cd-availability {
        margin-left: 0;
    }
    
    .cd-author {
        margin-left: 0;
    }
    
    .cd-card-excerpt {
        font-size: 13px;
    }
    
    .cd-footer-left {
        gap: 15px;
    }
    
    .cd-get-deal-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Single Product Page Styles */
body.single-product .cd-single-product-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0px;
}

.cd-single-product-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0px;
}

.cd-single-product-wrapper {
    display: flex;
    gap: 20px;
    padding: 10px;
}

.cd-main-content {
    flex: 1;
    min-width: 0;
}

.cd-sidebar {
    flex: 0 0 300px;
    height: fit-content;
    position: sticky;
    top: 60px;
}


.cd-widget-area:last-child {
    margin-bottom: 0;
}

.cd-widget-area .widget {
    margin-bottom: 20px;
}

.cd-widget-area .widget:last-child {
    margin-bottom: 0;
}

.cd-widget-area .widget-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.cd-product-summary {
    margin-bottom: 20px;
}

.cd-product-summary .cd-deal-card {
    background: #fff ;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}


.cd-product-summary .cd-card-content {
    padding: 30px;
}

.cd-product-summary .cd-card-title {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Section Titles */
.cd-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* About this Deal Section */
.cd-about-deal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.cd-about-content {
    color: #555;
    line-height: 1.6;
}

.cd-about-content p {
    margin-bottom: 15px;
}

.cd-about-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.cd-about-content li {
    margin-bottom: 8px;
}

/* Comments Section */
.cd-comments-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

/* Ensure comment form is visible */
#comments {
    scroll-margin-top: 80px;
}

#comments .comment-respond {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* Lightbox Styles */
.cd-image-lightbox {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f9fa;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    text-decoration: none;
}

.cd-image-lightbox img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; /* keeps image fully visible and centered */
    object-position: center;
    padding: 10px;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.cd-image-lightbox:hover img {
    transform: scale(1.1);
}

/* Add expand indicator for single product lightbox */
.cd-image-lightbox::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.cd-image-lightbox::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.3s ease;
    z-index: 11;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.cd-image-lightbox:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.cd-image-lightbox:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* No image fallback */
.cd-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    color: #7f8c8d;
    font-size: 14px;
    text-align: center;
    border: 2px dashed #ddd;
    border-radius: 8px;
}


/* Lightbox overlay */
.cd-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0 ;
    width: 100% ;
    height: 100% ;
    background: rgba(0, 0, 0, 0.9) ;
    z-index: 999999 ;
    display: none ;
    align-items: center ;
    justify-content: center ;
    opacity: 0 ;
    transition: opacity 0.3s ease ;
}

.cd-lightbox-overlay.active {
    display: flex ;
    opacity: 1 ;
}

.cd-lightbox-content {
    position: relative ;
    max-width: 90% ;
    max-height: 90% ;
    display: flex ;
    align-items: center ;
    justify-content: center ;
}

.cd-lightbox-image {
    max-width: 80% ;
    max-height: 80% ;
    width: auto ;
    height: auto ;
    border-radius: 8px ;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) ;
    object-fit: contain ;
    cursor: zoom-in ;
    transition: transform 0.3s ease ;
}

.cd-lightbox-image.zoomed {
    max-width: 95% ;
    max-height: 95% ;
    cursor: zoom-out ;
    transform: scale(1.1) ;
}

.cd-lightbox-close {
    position: absolute ;
    top: 20px ;
    right: 20px ;
    background: rgba(255, 255, 255, 0.9) ;
    border: none ;
    width: 40px ;
    height: 40px ;
    border-radius: 50% ;
    cursor: pointer ;
    display: flex ;
    align-items: center ;
    justify-content: center ;
    font-size: 20px ;
    color: #333 ;
    transition: all 0.3s ease ;
    z-index: 1000000 ;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) ;
}

.cd-lightbox-close:hover {
    background: rgba(255, 255, 255, 1) ;
    transform: scale(1.1) ;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) ;
}

.cd-lightbox-close::before {
    content: '×' ;
    font-weight: bold ;
    font-size: 24px ;
    line-height: 1 ;
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .cd-lightbox-content {
        max-width: 95% ;
        max-height: 95% ;
        padding: 20px ;
    }
    
    .cd-lightbox-close {
        top: 15px ;
        right: 15px ;
        width: 35px ;
        height: 35px ;
        font-size: 18px ;
        z-index: 1000000 ;
    }
    
    .cd-lightbox-close::before {
        font-size: 20px ;
    }
}

@media (max-width: 480px) {
    .cd-lightbox-close {
        top: 10px ;
        right: 10px ;
        width: 32px ;
        height: 32px ;
    }
    
    .cd-lightbox-close::before {
        font-size: 18px ;
    }
}

.cd-comments-content {
    color: #555;
}

/* Sticky Bottom Bar */
.cd-sticky-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 0;
}

.cd-sticky-bottom-bar.visible {
    transform: translateY(0);
}

.cd-sticky-content {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
}

.cd-sticky-image {
    flex: 0 0 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.cd-sticky-image img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
}

.cd-sticky-info {
    flex: 1;
    min-width: 0;
}

.cd-sticky-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cd-sticky-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cd-sticky-current-price {
    font-size: 16px;
    font-weight: 700;
    color: #e74c3c;
}

.cd-sticky-original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.cd-sticky-action {
    flex: 0 0 auto;
}

.cd-sticky-get-deal-btn {
    background: #1976d2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.cd-sticky-get-deal-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.cd-sticky-get-deal-btn .cd-deal-external-icon {
    flex-shrink: 0;
}

/* Mobile adjustments for sticky bar */
@media (max-width: 768px) {
    .cd-sticky-content {
        padding: 10px 15px;
        gap: 12px;
    }
    
    .cd-sticky-image {
        flex: 0 0 50px;
        height: 50px;
    }
    
    .cd-sticky-title {
        font-size: 13px;
        -webkit-line-clamp: 1;
    }
    
    .cd-sticky-current-price {
        font-size: 15px;
    }
    
    .cd-sticky-original-price {
        font-size: 13px;
    }
    
    .cd-sticky-get-deal-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cd-sticky-content {
        padding: 8px 12px;
        gap: 10px;
    }
    
    .cd-sticky-image {
        flex: 0 0 45px;
        height: 45px;
    }
    
    .cd-sticky-title {
        font-size: 12px;
    }
    
    .cd-sticky-get-deal-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

.cd-no-comments {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 40px 0;
}

/* Related Products Section */
.cd-related-products {
    margin-bottom: 40px;
    padding: 0px ;
}

.cd-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cd-related-list .cd-deal-card-li {
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.cd-no-related {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 40px 0;
}

/* Mobile Responsive for Single Product */
@media (max-width: 768px) {
    .cd-single-product-page {
        padding: 10px;
    }
    
    .cd-single-product-wrapper {
        display: block;
        gap: 20px;
    }
    
    .cd-sidebar {
        flex: none;
        order: 1; /* Show sidebar after main content on mobile */
        position: static; /* Remove sticky positioning on mobile */
        top: auto;
    }
    
    .cd-main-content {
        order: 0; /* Main content first on mobile */
    }
    
    .cd-widget-area {
        padding: 15px;
    }
    
    .cd-product-summary .cd-deal-card {
        flex-direction: row;
    }
    
    .cd-product-summary .cd-card-image {
        flex: none;
        height: 250px;
        max-width: 100%;
        overflow: hidden;
    }
    

    .cd-product-summary .cd-card-image a {
        width: 100%;
        height: 250px;
        display: block;
    }

    .cd-product-summary .cd-card-image img {
        width: 100%;
        height: 100%;
        object-fit: scale-down;
        padding: 15px;
    }
    
    .cd-product-summary .cd-card-content {
        padding: 20px;
    }
    
    .cd-product-summary .cd-card-title {
        font-size: 20px;
    }
    
    .cd-section-title {
        font-size: 20px;
    }
    
    /* Mobile specific adjustments */
    .cd-card-price {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .cd-footer-left {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .cd-get-deal-btn {
        width: 100%;
        text-align: center;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .cd-single-product-page {
        padding: 5px;
    }
    
    .cd-product-summary .cd-card-content {
        padding: 15px;
    }
    
    .cd-product-summary .cd-card-title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .cd-section-title {
        font-size: 18px;
    }
    
    .cd-widget-area {
        padding: 10px;
    }
    
    .cd-card-footer {
        flex-direction: row;
        gap: 15px;
        align-items: center;
    }
    
    .cd-footer-left {
        justify-content: center;
    }
    
}

/* Single column layout on desktop - override theme styles */
@media (min-width: 1000px) {
    .woocommerce.columns-4 ul.products.columns-4 {
        display: block;
        grid-template-columns: none;
        --shop-columns: none;
    }
    
    .woocommerce.columns-4 ul.products.columns-4 li.product {
        width: 100%;
        float: none;
        margin-bottom: 20px;
        display: block;
        grid-column: none;
    }
    
    /* Additional override for any grid display */
    .woocommerce ul.products[data-products] {
        display: block;
        grid-template-columns: none;
    }
    
    .woocommerce ul.products[data-products] li.product {
        width: 100%;
        float: none;
        margin-bottom: 20px;
        display: block;
    }
}

@media (max-width: 999.98px) {
    [data-products] {
        --shop-columns: repeat(1, minmax(0, 1fr));
    }
}
