/**
 * Countdown Deal Frontend Styles
 * 
 * Styles for product grid and countdown timers
 * 
 * @package Countdown_Deal
 * @author Templines
 * @link https://templines.com
 * @since 1.0.0
 */

/* ==========================================================================
   Product Grid Layout
   ========================================================================== */

.cd-countdown-deal-widget {
    width: 100%;
}

.cd-products-grid {
    display: grid;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.cd-products-grid.cd-columns-1 {
    grid-template-columns: 1fr;
}

.cd-products-grid.cd-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cd-products-grid.cd-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.cd-products-grid.cd-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.cd-products-grid.cd-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.cd-products-grid.cd-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .cd-products-grid.cd-columns-4,
    .cd-products-grid.cd-columns-5,
    .cd-products-grid.cd-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cd-products-grid.cd-columns-3,
    .cd-products-grid.cd-columns-4,
    .cd-products-grid.cd-columns-5,
    .cd-products-grid.cd-columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .cd-products-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Product Item
   ========================================================================== */

.cd-product-item {
    position: relative;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.cd-product-item:hover,
.cd-product-item.cd-hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #007cba;
}

.cd-product-item.cd-sale-expired {
    opacity: 0.7;
    filter: grayscale(50%);
}

/* Sale Badge */
.cd-sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Product Image */
.cd-product-image {
    position: relative;
    margin-bottom: 15px;
    text-align: center;
    overflow: hidden;
    border-radius: 5px;
}

.cd-product-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    transition: transform 0.3s ease;
}

.cd-product-item:hover .cd-product-image img {
    transform: scale(1.05);
}

/* Product Content */
.cd-product-content {
    text-align: center;
}

.cd-product-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

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

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

.cd-product-rating {
    margin-bottom: 10px;
}

.cd-product-price {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

.cd-product-price .woocommerce-Price-amount {
    color: #007cba;
}

.cd-product-price del .woocommerce-Price-amount {
    color: #999;
    font-weight: normal;
}

/* Product Actions */
.cd-product-actions {
    margin-top: 15px;
}



.cd-product-actions .button,
.cd-product-actions .add_to_cart_button , .cd-product-actions .added_to_cart {
    width: 100%;
    padding: 12px 20px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}


.cd-product-actions .add_to_cart_button.added{
    display: none;
}

.cd-product-actions .button:hover,
.cd-product-actions .add_to_cart_button:hover {
    background: #005a87;
    transform: translateY(-2px);
    color: #fff;
}

.cd-product-actions .button.disabled,
.cd-product-actions .add_to_cart_button.disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Countdown Timer Styles
   ========================================================================== */

/* Global Countdown Block */
.cd-global-countdown-block {
    background: #764ba2;
    color: white;
    padding: 30px 20px;
    margin-bottom: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.cd-global-countdown-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.cd-global-countdown-title {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    color: #fff;
}

.cd-global-countdown-description {
    font-size: 1.2em;
    margin: 0 0 25px 0;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.cd-global-countdown {
    margin: 0 auto;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.cd-global-countdown .cd-countdown-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cd-global-countdown .cd-countdown-item {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 15px 10px;
    min-width: 80px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-direction: column;
    align-items: center;
}

.cd-global-countdown .cd-countdown-number {
    display: block;
    font-size: 2.2em;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color: white;
    background: transparent;
    border: none;
    padding: 0;
}


.cd-global-countdown .cd-countdown-separator {
    font-size: 2em;
    font-weight: 700;
    opacity: 0.7;
    animation: pulse 2s infinite;
}

/* Global countdown urgency states */
.cd-global-countdown.cd-urgency-high .cd-global-countdown-block {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.cd-global-countdown.cd-urgency-critical .cd-global-countdown-block {
    background: linear-gradient(135deg, #ff3838 0%, #c44569 100%);
    animation: globalUrgentPulse 1s infinite alternate;
}

@keyframes globalUrgentPulse {
    from { transform: scale(1); }
    to { transform: scale(1.02); }
}


.cd-countdown.cd-urgency-medium {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.cd-countdown.cd-urgency-high {
    background: #f8d7da;
    border-color: #f5c6cb;
    animation: urgentPulse 1s infinite alternate;
}

@keyframes urgentPulse {
    from { box-shadow: 0 0 5px rgba(220, 53, 69, 0.3); }
    to { box-shadow: 0 0 15px rgba(220, 53, 69, 0.6); }
}

.cd-countdown-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    padding: 10px;
}

.cd-product-content .cd-countdown-wrapper {
    border: 1px solid #eee;
}

.cd-products-list .cd-countdown-wrapper {
    background: #fff;
}


.cd-products-list .cd-countdown.cd-style-modern .cd-countdown-wrapper {
    display: flex;
    width: fit-content;
    padding: 10px 20px;
    margin: 0 auto;
    align-content: flex-start;
    align-items: center;
}



.cd-products-list .cd-countdown.cd-style-modern  .cd-countdown-separator {
    margin-top: -16px;
}


.cd-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.cd-countdown-number {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    min-width: 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.cd-countdown-number.cd-number-change {
    transform: scale(1.1);
    color: #fff;
}

.cd-countdown-label {
    font-size: 10px;
    color: #666;
    margin-top: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

.cd-countdown-separator {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0 3px;
}

.cd-countdown-expired {
    text-align: center;
    color: #e74c3c;
    font-weight: bold;
    font-size: 16px;
}

/* ==========================================================================
   Countdown Styles Variations
   ========================================================================== */

/* Modern Style (Default) */


/* Classic Style */
.cd-countdown.cd-style-classic .cd-countdown-number {
    background: #333;
    color: #fff;
    border: 2px solid #555;
    font-family: 'Courier New', monospace;
}

.cd-countdown.cd-style-classic .cd-countdown-separator {
    color: #333;
}

/* Minimal Style */
.cd-countdown.cd-style-minimal {
    background: transparent;
    border: none;
    padding: 5px 0;
}

.cd-countdown.cd-style-minimal .cd-countdown-number {
    background: transparent;
    border: none;
    color: #007cba;
    font-size: 20px;
    padding: 0;
    margin-bottom: -10px;
}

.cd-countdown.cd-style-minimal .cd-countdown-separator {
    color: #007cba;
}

/* Circular Style */
.cd-countdown.cd-style-circular .cd-countdown-wrapper {
    gap: 8px;
}

.cd-countdown.cd-style-circular .cd-countdown-item {
    position: relative;
}

.cd-countdown.cd-style-circular .cd-countdown-number {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #007cba;
    color: #fff;
    border: 2px solid #005a87;
    font-size: 14px;
    font-weight: bold;
}

.cd-countdown.cd-style-circular .cd-countdown-separator {
    display: none;
}

/* Progress Bar Style */
.cd-countdown.cd-style-progress {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    position: relative;
    overflow: hidden;
}

.cd-countdown.cd-style-progress .cd-countdown-wrapper {
    display: block;
}

.cd-countdown.cd-style-progress .cd-countdown-progress-container {
    position: relative;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 8px;
}

.cd-countdown.cd-style-progress .cd-countdown-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #007cba 0%, #005a87 100%);
    border-radius: 15px;
    transition: width 1s ease-in-out;
    width: 0%;
}

.cd-countdown.cd-style-progress .cd-countdown-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.cd-countdown.cd-style-progress .cd-countdown-time-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.cd-countdown.cd-style-progress .cd-countdown-time-left {
    font-weight: 600;
    color: #333;
}

.cd-countdown.cd-style-progress .cd-countdown-percentage {
    font-weight: 600;
    color: #007cba;
}

.cd-countdown.cd-style-progress.cd-urgency-high .cd-countdown-progress-bar {
    background: linear-gradient(90deg, #ff6b6b 0%, #ee5a24 100%);
}

.cd-countdown.cd-style-progress.cd-urgency-critical .cd-countdown-progress-bar {
    background: linear-gradient(90deg, #ff3838 0%, #c44569 100%);
    animation: progressUrgent 0.5s infinite alternate;
}

@keyframes progressUrgent {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.cd-countdown.cd-style-progress .cd-countdown-separator {
    display: none;
}

.cd-countdown.cd-style-progress .cd-countdown-item {
    display: none;
}

/* ==========================================================================
   List Display Layout
   ========================================================================== */

.cd-display-list .cd-products-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.cd-product-category-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.cd-product-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.cd-product-category-card__media {
    flex: 0 0 35%;
    position: relative;
    overflow: hidden;
}

.cd-product-category-card__media img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cd-product-category-card:hover .cd-product-category-card__media img {
    transform: scale(1.05);
}

.cd-product-category-card__media .cd-sale-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #e74c3c;
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
    animation: pulse 2s infinite;
}

.cd-product-category-card__info {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.cd-product-category-card__cat {
    color: #007cba;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.cd-product-category-card__title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.cd-product-category-card__title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cd-product-category-card__title a:hover {
    color: #007cba;
}

.cd-product-category-card__price {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #007cba;
}

.cd-product-category-card__price del {
    color: #999;
    font-weight: normal;
    margin-right: 10px;
}

.cd-product-category-card__intro {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 16px;
}

.cd-product-category-card .cd-countdown {
    margin-bottom: 20px;
}

.cd-product-category-card__more {
    margin-top: auto;
}

.cd-button {
    display: inline-block;
    padding: 12px 30px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cd-button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.cd-button-large {
    padding: 15px 40px;
    font-size: 18px;
}

/* ZIG ZAG Layout - Reverse every second item */
.cd-list-zigzag .cd-product-category-card.cd-reverse {
    flex-direction: row-reverse;
}

.cd-list-zigzag .cd-product-category-card.cd-reverse .cd-product-category-card__media .cd-sale-badge {
    left: auto;
    right: 15px;
}

/* Animation for ZIG ZAG items */
.cd-list-zigzag .cd-product-category-card {
    animation: slideInFromLeft 0.6s ease-out;
}

.cd-list-zigzag .cd-product-category-card.cd-reverse {
    animation: slideInFromRight 0.6s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design for List Layout */
@media (max-width: 768px) {
    .cd-product-category-card,
    .cd-product-category-card.cd-reverse {
        flex-direction: column;
    }
    
    .cd-product-category-card__media {
        flex: none;
    }
    
    .cd-product-category-card__media img {
        height: 200px;
    }
    
    .cd-product-category-card__info {
        padding: 50px;
    }
    
    .cd-product-category-card__title {
        font-size: 20px;
    }
    
    /* Reset sale badge position on mobile */
    .cd-list-zigzag .cd-product-category-card.cd-reverse .cd-product-category-card__media .cd-sale-badge {
        left: 15px;
        right: auto;
    }
}

/* ==========================================================================
   Admin Styles for Product Edit
   ========================================================================== */

.countdown-status-none {
    color: #666;
}

.countdown-status-upcoming {
    color: #f39c12;
    font-weight: bold;
}

.countdown-status-active {
    color: #27ae60;
    font-weight: bold;
}

.countdown-status-expired {
    color: #e74c3c;
    font-weight: bold;
}

/* ==========================================================================
   Loading and Animation States
   ========================================================================== */

.cd-countdown-loading {
    opacity: 0.5;
    pointer-events: none;
}

.cd-countdown-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.cd-countdown-item {
    position: relative;
}

.cd-countdown-item::before {
    content: attr(aria-label);
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Screen reader only text */
.cd-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .cd-countdown {
        display: none !important;
    }
    
    .cd-product-item {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}




body  .cd-product-category-card__price {
    font-size: 30px;
    font-weight: 500;
    margin-bottom: 15px;
}


@media (min-width: 1000px) {

body  .cd-product-category-card .cd-countdown {

}




body .cd-product-category-card.cd-reverse .cd-countdown {

}
    
} 

@media (max-width: 1000px) {
    
    
 body  .cd-global-countdown .cd-countdown-separator {
    display: none;
}

 body  .cd-products-list .cd-countdown.cd-style-modern .cd-countdown-wrapper {
    width: 100%;
}
    
    
  body  .cd-product-category-card {
    display: flex;
    flex-direction: column;
}
    
    
 body .cd-product-category-card {
    max-width: 700px ;
    margin: 0 auto 50px;
}
    
    
    body .cd-button {
    width: 100%;
    text-align: center;
}
    
    
 body  .cd-list-zigzag .cd-product-category-card.cd-reverse {
    flex-direction: column;
}
    
    
    
}




/* Position countdown timer inside the product image */
.cd-product-category-card__media {
    position: relative;
    overflow: hidden;
}

.cd-product-category-card__media .cd-countdown {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: 20px;
    z-index: 10;
    margin: 0;
}

/* Adjust countdown timer styles for overlay */
.cd-product-category-card__media .cd-countdown-wrapper {
    justify-content: center;
}

.cd-product-category-card__media .cd-countdown-number {
    color: #ffffff;
    font-weight: bold;
}

.cd-product-category-card__media .cd-countdown-label {
    font-size: 0.8em;
}

.cd-product-category-card__media .cd-countdown-separator {
margin-top: -15px;
}

/* Adjust progress style countdown */
.cd-product-category-card__media .cd-countdown-progress-container {
    background: rgba(255, 255, 255, 0.3);
}

.cd-product-category-card__media .cd-countdown-progress-bar {
    background: #ffffff;
}

.cd-product-category-card__media .cd-countdown-time-display {
    color: #ffffff;
}

/* Hide countdown timer in product info section */
.cd-product-category-card__info .cd-countdown {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .cd-product-category-card__media .cd-countdown {
        padding: 5px;
    }
    
    .cd-product-category-card__media .cd-countdown-number {
        font-size: 0.9em;
    }
    
    .cd-product-category-card__media .cd-countdown-label {
        font-size: 0.7em;
    }
}
