/* Drip Promotion - Popup Styles */

/* Overlay */
.dpro-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.dpro-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Container */
.dpro-popup__container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 680px;
    max-width: 94vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: dpro-slide-up 0.35s ease-out;
    display: flex;
    flex-direction: column;
}

/* Scrollable content area below timer bar */
.dpro-popup__body {
    overflow-y: auto;
    flex: 1 1 auto;
}

@keyframes dpro-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Timer bar */
.dpro-popup__timer-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2A7544 0%, #339957 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.dpro-popup__timer-icon {
    font-size: 16px;
}

.dpro-popup__timer-countdown {
    font-family: "Courier New", monospace;
    font-size: 16px;
    font-weight: 700;
    color: #d4a017;
    letter-spacing: 1px;
}

/* Header */
.dpro-popup__header {
    text-align: center;
    padding: 24px 24px 8px;
}

.dpro-popup__title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px;
    color: #2A7544;
    line-height: 1.2;
}

.dpro-popup__subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Loading */
/* Loading - reserve space for products */
.dpro-popup__loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    min-height: 220px;
}

.dpro-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #2A7544;
    border-radius: 50%;
    animation: dpro-spin 0.7s linear infinite;
}

@keyframes dpro-spin {
    to { transform: rotate(360deg); }
}

/* Products grid */
.dpro-popup__products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 24px;
    min-height: 220px;
}

/* Product card */
.dpro-product-card {
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    background: #fff;
}

.dpro-product-card:hover {
    border-color: #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dpro-product-card--selected {
    border-color: #2A7544;
    box-shadow: 0 4px 16px rgba(42, 117, 68, 0.15);
    background: #f5faf7;
}

.dpro-product-card__check {
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    background: #2A7544;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    line-height: 26px;
    text-align: center;
}

.dpro-product-card--selected .dpro-product-card__check {
    display: block;
}

.dpro-product-card__image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f8f8;
    transition: opacity 0.2s;
}

.dpro-product-card__name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
    line-height: 1.3;
    min-height: 34px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dpro-product-card__price {
    margin: 0 0 10px;
    font-size: 14px;
}

.dpro-gift-price-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.3;
}

.dpro-original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 13px;
}

.dpro-free-label {
    display: inline-block;
    background: linear-gradient(135deg, #2A7544 0%, #339957 100%);
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Mini cart: force FREE label to new line via flex column */
.woocommerce-mini-cart .dpro-gift-price-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

.woocommerce-mini-cart .dpro-original-price {
    font-size: 12px !important;
}

.woocommerce-mini-cart .dpro-free-label {
    font-size: 11px !important;
    padding: 1px 6px !important;
    margin-top: 2px !important;
    width: fit-content !important;
}

/* Mini cart: hide text GIFT badge, use icon on thumbnail instead */
.woocommerce-mini-cart .dpro-mini-gift .dpro-gift-badge {
    display: none !important;
}

.woocommerce-mini-cart .dpro-mini-gift .cart-item-image {
    position: relative !important;
}

.woocommerce-mini-cart .dpro-mini-gift .cart-item-image::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    width: 18px;
    height: 18px;
    background: #2A7544;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 12 20 22 4 22 4 12'/%3E%3Crect x='2' y='7' width='20' height='5'/%3E%3Cline x1='12' y1='22' x2='12' y2='7'/%3E%3Cpath d='M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z'/%3E%3Cpath d='M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z'/%3E%3C/svg%3E");
    background-size: 10px 10px;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

/* ===== Blocks Cart: Gift item styling (CSS-only, class applied via JS filter) ===== */

/* Hide the discounted "0 euro" price */
.dpro-cart-gift-item .wc-block-components-product-price__value.is-discounted,
.dpro-cart-gift-item ins.wc-block-components-product-price__value {
    display: none !important;
}

/* Hide screen-reader text for discounted price */
.dpro-cart-gift-item .wc-block-cart-item__prices .screen-reader-text:last-of-type {
    display: none !important;
}

/* Hide the "Save XX" sale badge */
.dpro-cart-gift-item .wc-block-components-sale-badge {
    display: none !important;
}

/* Layout price column to stack vertically */
.dpro-cart-gift-item .wc-block-cart-item__prices .wc-block-components-product-price {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
}

/* Add FREE label after price block */
.dpro-cart-gift-item .wc-block-cart-item__prices .wc-block-components-product-price::after {
    content: 'FREE';
    display: inline-block;
    background: #2A7544;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    text-decoration: none;
}

/* Total column: hide "0 euro" text, show FREE */
.dpro-cart-gift-item .wc-block-cart-item__total .wc-block-components-product-price {
    display: flex !important;
    align-items: center !important;
}

.dpro-cart-gift-item .wc-block-cart-item__total .wc-block-components-product-price__value {
    font-size: 0 !important;
    line-height: 0 !important;
}

.dpro-cart-gift-item .wc-block-cart-item__total .wc-block-components-product-price__value::after {
    content: 'FREE';
    font-size: 11px;
    line-height: normal;
    background: #2A7544;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Gift icon on thumbnail in blocks cart */
.dpro-cart-gift-item .wc-block-cart-item__image {
    position: relative !important;
}

.dpro-cart-gift-item .wc-block-cart-item__image::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    width: 18px;
    height: 18px;
    background: #2A7544;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 12 20 22 4 22 4 12'/%3E%3Crect x='2' y='7' width='20' height='5'/%3E%3Cline x1='12' y1='22' x2='12' y2='7'/%3E%3Cpath d='M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z'/%3E%3Cpath d='M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z'/%3E%3C/svg%3E");
    background-size: 10px 10px;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

.dpro-product-card__select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
    color: #333;
}

.dpro-product-card__select:focus {
    outline: none;
    border-color: #2A7544;
}

/* Actions */
.dpro-popup__actions {
    padding: 16px 24px 24px;
    text-align: center;
}

.dpro-popup__btn-add {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 44px !important;
    padding: 10px 14px !important;
    background-color: #2A7544 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    letter-spacing: 0.3px !important;
    box-shadow: none !important;
    text-transform: none !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
}

.dpro-popup__btn-add:hover {
    background-color: #2B513B !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(42, 117, 68, 0.35) !important;
}

.dpro-popup__btn-add--loading {
    pointer-events: none;
    opacity: 0.7;
}

.dpro-popup__btn-decline {
    display: inline-block !important;
    margin-top: 12px !important;
    background: none !important;
    border: none !important;
    color: #dc2626 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    text-decoration: underline !important;
    text-transform: none !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    transition: color 0.2s !important;
}

.dpro-popup__btn-decline:hover {
    color: #b91c1c !important;
}

/* Warning toast */
.dpro-popup__warning {
    display: none;
    text-align: center;
    padding: 8px 16px;
    margin: 0 24px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    animation: dpro-shake 0.4s ease;
}

.dpro-popup__warning--visible {
    display: block;
}

@keyframes dpro-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Cart banners */
.dpro-cart-banner {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dpro-banner-icon {
    display: inline-block !important;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    color: initial !important;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important;
    font-style: normal !important;
    animation: dpro-wiggle 2s ease-in-out infinite;
}

.dpro-cart-banner__icon {
    display: inline-block !important;
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
    color: initial !important;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important;
    font-style: normal !important;
    animation: dpro-wiggle 2s ease-in-out infinite;
}

@keyframes dpro-wiggle {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-12deg) scale(1.1); }
    30% { transform: rotate(10deg) scale(1.1); }
    45% { transform: rotate(-8deg); }
    60% { transform: rotate(6deg); }
    75% { transform: rotate(0deg); }
}

.dpro-cart-banner--mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2A7544 0%, #339957 100%);
    color: #fff;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    border-radius: 0;
}

.dpro-cart-banner--mini:hover {
    opacity: 0.9;
}

.dpro-cart-banner--page {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f5faf7 0%, #eaf5ee 100%);
    border: 2px dashed #2A7544;
    border-radius: 12px;
    margin-bottom: 20px;
}

.dpro-cart-banner--page:hover {
    background: linear-gradient(135deg, #eaf5ee 0%, #dff0e5 100%);
}

.dpro-cart-banner__inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dpro-cart-banner__icon {
    font-size: 32px;
    color: #2A7544;
}

.dpro-cart-banner__text strong {
    display: block;
    font-size: 16px;
    color: #2A7544;
    margin-bottom: 2px;
}

.dpro-cart-banner__text p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.dpro-cart-banner--checkout {
    padding: 14px 20px;
    background: #fff8e1;
    border-left: 4px solid #ffa000;
    margin-bottom: 20px;
    font-size: 14px;
    border-radius: 0 8px 8px 0;
}

.dpro-cart-banner--checkout:hover {
    background: #fff3c4;
}

/* Deadline countdown timer (gift expiration) */
.dpro-deadline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    box-sizing: border-box;
}

.dpro-deadline__icon {
    font-size: 18px;
    flex-shrink: 0;
}

.dpro-deadline__text {
    flex: 1;
    font-size: 13px;
    line-height: 1.3;
}

.dpro-deadline__timer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    flex-shrink: 0;
    white-space: nowrap;
}

.dpro-deadline__sep {
    opacity: 0.6;
}

/* Mini-cart deadline (full width, no border) */
.dpro-deadline--mini {
    padding: 12px 16px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border-radius: 0;
    margin-bottom: 8px;
}

.dpro-deadline--mini .dpro-deadline__timer {
    font-size: 15px;
    color: #b45309;
}

/* Cart page deadline */
.dpro-deadline--cart {
    padding: 16px 20px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    margin-bottom: 20px;
    color: #92400e;
}

.dpro-deadline--cart .dpro-deadline__timer {
    font-size: 15px;
    color: #b45309;
}

/* Checkout deadline (same as cart) */
.dpro-deadline--checkout {
    padding: 16px 20px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    margin-bottom: 20px;
    color: #92400e;
}

.dpro-deadline--checkout .dpro-deadline__timer {
    font-size: 15px;
    color: #b45309;
}

/* Gift badge in cart (hidden, icon-only on mini-cart) */
.dpro-gift-badge {
    display: none !important;
}

/* Success animation */
.dpro-popup__success {
    text-align: center;
    padding: 40px 24px;
}

.dpro-popup__success-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    animation: dpro-bounce 0.5s ease;
}

@keyframes dpro-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.dpro-popup__success h3 {
    font-size: 20px;
    margin: 0 0 8px;
    color: #2A7544;
}

.dpro-popup__success p {
    color: #666;
    margin: 0;
}

/* Responsive */
@media (max-width: 680px) {
    .dpro-popup__container {
        width: 94vw;
        max-width: 94vw;
        max-height: 90vh;
        border-radius: 12px;
    }

    .dpro-popup__products {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 12px 16px;
    }

    .dpro-product-card {
        padding: 10px;
    }

    .dpro-product-card__name {
        font-size: 11px;
        min-height: 28px;
    }

    .dpro-popup__title {
        font-size: 20px;
    }

    .dpro-popup__btn-add {
        font-size: 14px;
        padding: 14px 20px;
    }
}

@media (max-width: 420px) {
    .dpro-popup__products {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        padding: 8px 12px;
    }

    .dpro-product-card {
        padding: 8px;
    }

    .dpro-product-card__select {
        font-size: 11px;
        padding: 4px 6px;
    }
}

/* ==========================================================================
   Checkout Reservation Timer
   "Your items are reserved" bar — shown when no gift deadline is active.
   ========================================================================== */

.dpro-reservation {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2B513B 0%, #345F47 100%);
    color: #FFFFFF;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(43, 81, 59, 0.18);
    font-size: 13px;
    line-height: 1.5;
    animation: dpro-reservation-fadein 0.5s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle horizontal sheen */
.dpro-reservation::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.06),
        transparent
    );
    animation: dpro-reservation-sheen 5s ease-in-out infinite;
    pointer-events: none;
}

.dpro-reservation__icon {
    font-size: 22px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    line-height: 1;
}

.dpro-reservation__content {
    flex: 1;
    min-width: 0;
}

.dpro-reservation__title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
    letter-spacing: 0.2px;
}

.dpro-reservation__subtitle {
    font-size: 12.5px;
    opacity: 0.92;
    line-height: 1.4;
}

.dpro-reservation__timer {
    display: inline-block;
    font-family: 'SF Mono', 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    padding: 1px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    white-space: nowrap;
    vertical-align: baseline;
}

/* Urgent state (< 2 minutes remaining) */
.dpro-reservation--urgent .dpro-reservation__timer {
    background: rgba(239, 68, 68, 0.35);
    animation: dpro-reservation-pulse 1s ease-in-out infinite;
}

/* Fade-in on mount */
@keyframes dpro-reservation-fadein {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slow horizontal light sweep */
@keyframes dpro-reservation-sheen {
    0%, 100% { left: -100%; }
    50%      { left: 150%; }
}

/* Timer pulse for urgency */
@keyframes dpro-reservation-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.65; }
}

/* Fade-out on expiry */
.dpro-reservation--expired {
    animation: dpro-reservation-fadeout 0.5s ease forwards;
}

@keyframes dpro-reservation-fadeout {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
        overflow: hidden;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .dpro-reservation {
        gap: 10px;
        padding: 12px 16px;
    }

    .dpro-reservation__icon {
        font-size: 20px;
    }

    .dpro-reservation__title {
        font-size: 13px;
    }

    .dpro-reservation__subtitle {
        font-size: 12px;
    }

    .dpro-reservation__timer {
        font-size: 12px;
        padding: 1px 6px;
    }
}
