/* Sale Countdown Timer Styles - Enhanced & Column Layout Fix */

/* Reset any inherited styles */
.sct-timer-wrapper,
.sct-timer-wrapper * {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

.sct-timer-wrapper {
    padding: 30px 15px;
    border-radius: 15px;
    text-align: center;
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px auto;
    display: block;
    overflow: visible !important;
    float: none !important;
    clear: both;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.sct-timer-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

/* Decorative corner elements */
.sct-timer-wrapper::before,
.sct-timer-wrapper::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    z-index: 1;
}

.sct-timer-wrapper::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.sct-timer-wrapper::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

.sct-timer-title {
    font-size: 28px;
    font-weight: 900;
    margin: 0 0 20px 0 !important;
    padding: 0 10px !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.2;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    display: inline-block;
    animation: titlePulse 2s ease-in-out infinite;
}

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

.sct-timer-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
    opacity: 0.6;
}

.sct-timer-boxes {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

.sct-timer-box {
    border-radius: 12px;
    padding: 18px 10px;
    flex: 1 1 auto;
    min-width: 0 !important;
    max-width: 90px;
    width: auto !important;
    text-align: center;
    position: relative;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    float: none !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.sct-timer-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
    border-radius: 10px;
    pointer-events: none;
}

.sct-timer-box:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.sct-timer-number {
    display: block !important;
    font-size: 38px;
    font-weight: 800;
    font-style: italic;
    line-height: 1;
    white-space: nowrap;
    margin: 0 !important;
    padding: 0 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.sct-timer-label {
    display: block !important;
    font-size: 9px;
    font-weight: 700;
    margin: 5px 0 0 0 !important;
    padding: 0 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    white-space: nowrap;
}

.sct-timer-colon {
    font-size: 32px;
    font-weight: 800;
    padding: 0 3px;
    animation: blink 1.5s ease-in-out infinite;
    flex-shrink: 0;
    line-height: 1;
    display: inline-block !important;
    float: none !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes blink {
    0%, 40% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.9); }
    60%, 100% { opacity: 1; transform: scale(1); }
}

/* ============================================
   COLUMN LAYOUT FIX - CRITICAL
   ============================================ */

/* Force timer to stay within its container */
.sct-timer-wrapper {
    contain: layout style paint;
    isolation: isolate;
    flex-shrink: 1;
    min-width: 0;
}

/* Elementor columns fix */
.elementor-column .sct-timer-wrapper,
.elementor-widget-container .sct-timer-wrapper,
.elementor-column > .elementor-widget-wrap > .elementor-element .sct-timer-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.elementor-column {
    overflow: visible !important;
}

/* WPBakery/Visual Composer fix */
.vc_column_container .sct-timer-wrapper,
.wpb_column .sct-timer-wrapper,
.vc_col-sm-6 .sct-timer-wrapper,
.vc_col-md-6 .sct-timer-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Gutenberg columns fix */
.wp-block-column .sct-timer-wrapper,
.wp-block-columns .sct-timer-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Divi fix */
.et_pb_column .sct-timer-wrapper,
.et_pb_module .sct-timer-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Generic column classes fix - IMPORTANT */
[class*="col-"] .sct-timer-wrapper,
[class*="column"] .sct-timer-wrapper,
.row .sct-timer-wrapper,
.grid .sct-timer-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex-shrink: 1 !important;
}

/* Bootstrap grid fix */
.container .sct-timer-wrapper,
.container-fluid .sct-timer-wrapper {
    max-width: 100% !important;
}

/* Prevent horizontal overflow */
body, html {
    overflow-x: hidden;
}

.sct-timer-wrapper {
    overflow-x: hidden !important;
}

/* ============================================
   RESPONSIVE SIZES
   ============================================ */

/* Extra Large - 600px+ */
@media (min-width: 600px) {
    .sct-timer-wrapper {
        padding: 35px 20px;
        border-radius: 18px;
    }
    .sct-timer-title {
        font-size: 32px;
        margin-bottom: 25px !important;
        letter-spacing: 3px;
    }
    .sct-timer-box {
        padding: 20px 12px;
        border-radius: 14px;
        max-width: 100px;
    }
    .sct-timer-number {
        font-size: 44px;
    }
    .sct-timer-label {
        font-size: 10px;
        margin-top: 6px !important;
    }
    .sct-timer-colon {
        font-size: 36px;
        padding: 0 5px;
    }
    .sct-timer-boxes {
        gap: 10px;
    }
}

/* Large - 500px to 599px */
@media (min-width: 500px) and (max-width: 599px) {
    .sct-timer-wrapper {
        padding: 28px 15px;
    }
    .sct-timer-title {
        font-size: 26px;
        margin-bottom: 20px !important;
    }
    .sct-timer-box {
        padding: 16px 10px;
    }
    .sct-timer-number {
        font-size: 36px;
    }
    .sct-timer-label {
        font-size: 9px;
    }
    .sct-timer-colon {
        font-size: 30px;
    }
}

/* Medium - 350px to 499px */
@media (min-width: 350px) and (max-width: 499px) {
    .sct-timer-wrapper {
        padding: 20px 10px;
    }
    .sct-timer-title {
        font-size: 20px;
        letter-spacing: 1.5px;
        margin-bottom: 15px !important;
    }
    .sct-timer-box {
        padding: 12px 6px;
        border-radius: 10px;
    }
    .sct-timer-number {
        font-size: 28px;
    }
    .sct-timer-label {
        font-size: 8px;
    }
    .sct-timer-colon {
        font-size: 24px;
    }
    .sct-timer-boxes {
        gap: 5px;
    }
}

/* Small - 250px to 349px */
@media (min-width: 250px) and (max-width: 349px) {
    .sct-timer-wrapper {
        padding: 15px 8px;
        border-radius: 10px;
    }
    .sct-timer-wrapper::before,
    .sct-timer-wrapper::after {
        width: 25px;
        height: 25px;
        border-width: 2px;
    }
    .sct-timer-title {
        font-size: 16px;
        margin-bottom: 12px !important;
        letter-spacing: 1px;
    }
    .sct-timer-box {
        padding: 8px 4px;
        border-radius: 8px;
        border-width: 1px;
    }
    .sct-timer-number {
        font-size: 22px;
    }
    .sct-timer-label {
        font-size: 7px;
        margin-top: 3px !important;
    }
    .sct-timer-colon {
        font-size: 18px;
        padding: 0 2px;
    }
    .sct-timer-boxes {
        gap: 3px;
    }
}

/* Very Small - below 250px */
@media (max-width: 249px) {
    .sct-timer-wrapper {
        padding: 10px 5px;
        border-radius: 8px;
    }
    .sct-timer-wrapper::before,
    .sct-timer-wrapper::after {
        display: none;
    }
    .sct-timer-title {
        font-size: 12px;
        margin-bottom: 8px !important;
        letter-spacing: 0.5px;
    }
    .sct-timer-title::after {
        display: none;
    }
    .sct-timer-box {
        padding: 6px 3px;
        border-radius: 6px;
    }
    .sct-timer-number {
        font-size: 16px;
    }
    .sct-timer-label {
        font-size: 6px;
        margin-top: 2px !important;
    }
    .sct-timer-colon {
        font-size: 14px;
        padding: 0 1px;
    }
    .sct-timer-boxes {
        gap: 2px;
    }
}

/* ============================================
   WIDGET / SIDEBAR COMPACT MODE
   ============================================ */
.widget .sct-timer-wrapper,
.sidebar .sct-timer-wrapper,
.widget-area .sct-timer-wrapper,
[class*="sidebar"] .sct-timer-wrapper,
[id*="sidebar"] .sct-timer-wrapper,
aside .sct-timer-wrapper {
    padding: 15px 8px !important;
    border-radius: 10px;
    margin: 12px auto !important;
}

.widget .sct-timer-wrapper::before,
.widget .sct-timer-wrapper::after,
.sidebar .sct-timer-wrapper::before,
.sidebar .sct-timer-wrapper::after {
    display: none;
}

.widget .sct-timer-title,
.sidebar .sct-timer-title,
aside .sct-timer-title {
    font-size: 16px !important;
    margin-bottom: 10px !important;
    letter-spacing: 1px;
}

.widget .sct-timer-box,
.sidebar .sct-timer-box,
aside .sct-timer-box {
    padding: 8px 4px !important;
    border-radius: 8px;
}

.widget .sct-timer-number,
.sidebar .sct-timer-number,
aside .sct-timer-number {
    font-size: 20px !important;
}

.widget .sct-timer-label,
.sidebar .sct-timer-label,
aside .sct-timer-label {
    font-size: 7px !important;
}

.widget .sct-timer-colon,
.sidebar .sct-timer-colon,
aside .sct-timer-colon {
    font-size: 18px !important;
}

.widget .sct-timer-boxes,
.sidebar .sct-timer-boxes,
aside .sct-timer-boxes {
    gap: 3px !important;
}

/* ============================================
   ANIMATION ENHANCEMENTS
   ============================================ */

@keyframes flipIn {
    0% {
        transform: rotateX(-90deg);
        opacity: 0;
    }
    50% {
        transform: rotateX(-45deg);
        opacity: 0.5;
    }
    100% {
        transform: rotateX(0);
        opacity: 1;
    }
}

.sct-timer-number.flip {
    animation: flipIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Glow effect on hover */
.sct-timer-box:hover .sct-timer-number {
    filter: drop-shadow(0 0 8px currentColor);
}

/* Timer ended state */
.sct-timer-wrapper.ended {
    opacity: 0.6;
    filter: grayscale(50%);
}

.sct-timer-wrapper.ended .sct-timer-title::after {
    content: ' - SALE ENDED';
    display: inline;
    font-size: 0.6em;
    opacity: 0.8;
}