/**
 * Frontend Styles for Pre-Order for WooCommerce
 *
 * @package PreOrder
 * @since   1.0.0
 */

/* ===========================
   Pre-Order Badge Styles
   =========================== */

.preorder-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #ff6b6b;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.preorder-badge.rounded {
    border-radius: 20px;
}

.preorder-badge.square {
    border-radius: 0;
}

/* Badge positions */
.preorder-badge-before-title {
    display: block;
    margin-bottom: 12px;
}

.preorder-badge-after-title {
    display: block;
    margin-top: 10px;
    margin-bottom: 8px;
}

.preorder-badge-on-image {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    margin: 0;
}

/* ===========================
   Availability Message
   =========================== */

.preorder-availability {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #2271b1;
    font-size: 14px;
    line-height: 1.6;
}

.preorder-availability-date {
    font-weight: 600;
    color: #2271b1;
}

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

.preorder-countdown {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.preorder-countdown-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.preorder-countdown-timer {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

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

.preorder-countdown-value {
    font-size: 32px;
    font-weight: 700;
    color: #2271b1;
    line-height: 1;
    margin-bottom: 5px;
}

.preorder-countdown-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
}

/* Countdown Style: Boxes */
.preorder-countdown.style-boxes .preorder-countdown-item {
    background: #fff;
    padding: 15px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Countdown Style: Circular */
.preorder-countdown.style-circular .preorder-countdown-item {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #2271b1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.preorder-countdown.style-circular .preorder-countdown-value {
    color: #fff;
    font-size: 24px;
}

.preorder-countdown.style-circular .preorder-countdown-label {
    color: #fff;
    font-size: 10px;
}

/* ===========================
   Price Display
   =========================== */

.preorder-price-wrapper {
    margin: 10px 0;
}

.preorder-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9em;
    margin-right: 8px;
}

.preorder-discounted-price {
    color: #00a32a;
    font-weight: 700;
    font-size: 1.1em;
}

.preorder-savings {
    display: inline-block;
    padding: 3px 10px;
    background: #00a32a;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
    line-height: 1.4;
}

/* ===========================
   Cart & Checkout Styles
   =========================== */

.preorder-cart-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 15px 0;
    font-size: 14px;
}

.preorder-item-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #ff6b6b;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}

.preorder-item-availability {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

/* ===========================
   Button Styles
   =========================== */

.single_add_to_cart_button.preorder-button {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
}

.single_add_to_cart_button.preorder-button:hover {
    background-color: #ff5252;
    border-color: #ff5252;
}

/* ===========================
   Quantity + Button Alignment
   =========================== */

/* Make the quantity + button row a flex container */
.cart .quantity,
form.cart .quantity {
    display: inline-flex;
    align-items: stretch;
}

/* Match quantity input height to the button */
form.cart .quantity input.qty {
    height: 45px;
    min-height: 45px;
    line-height: 45px;
    box-sizing: border-box;
    vertical-align: middle;
}

/* Match button height to quantity input */
form.cart .single_add_to_cart_button {
    height: 45px;
    min-height: 45px;
    line-height: 43px;
    box-sizing: border-box;
    vertical-align: middle;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===========================
   Responsive Styles
   =========================== */

@media screen and (max-width: 768px) {
    .preorder-countdown-timer {
        gap: 10px;
    }

    .preorder-countdown-item {
        min-width: 50px;
    }

    .preorder-countdown-value {
        font-size: 24px;
    }

    .preorder-countdown.style-circular .preorder-countdown-item {
        width: 60px;
        height: 60px;
    }

    .preorder-countdown.style-circular .preorder-countdown-value {
        font-size: 18px;
    }
}

/* ===========================
   RTL Support
   =========================== */

[dir="rtl"] .preorder-badge-on-image {
    left: auto;
    right: 10px;
}

[dir="rtl"] .preorder-availability {
    border-left: none;
    border-right: 4px solid #2271b1;
}

[dir="rtl"] .preorder-cart-notice {
    border-left: none;
    border-right: 4px solid #ffc107;
}