/* =========================================================================
   Valltasy Gift Wrap - Styles
   ========================================================================= */

/* --- Per-product button in the cart row --- */
.vt-gift-wrap-action {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vt-gift-wrap-btn {
    cursor: pointer;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px !important;
    line-height: 1.4 !important;
    padding: 3px 12px 0 12px !important;
}

/* Highlight pulse when arriving from checkout */
@keyframes vtGiftWrapPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(130, 102, 186, 0); }
    50% { box-shadow: 0 0 0 6px rgba(130, 102, 186, 0.35); }
}

.vt-gift-wrap-btn--highlight {
    animation: vtGiftWrapPulse 0.8s ease-in-out 3;
}

.vt-gift-wrap-btn .widget-title {
    margin: 0;
    padding: 0;
    display: inline;
    font-size: inherit;
    line-height: inherit;
}


.vt-gift-wrap-price {
    font-weight: 400;
}

.vt-gift-wrap-price .woocommerce-Price-amount,
.vt-gift-wrap-price .amount {
    color: inherit !important;
}

/* --- Gift-wrap cart row styling --- */
.vt-gift-wrap-row {
    background: #fffbf0 !important;
}

.vt-wrap-item-label {
    font-weight: 600;
    color: #EDA12B;
}

.vt-wrap-item-for {
    font-style: italic;
    color: #555;
}

.vt-gift-wrap-row dt {
    color: #EDA12B;
    font-weight: 600;
}

.vt-wrap-checkout-msg {
    display: block;
    color: #666;
    font-style: italic;
    margin-top: 2px;
}

/* =========================================================================
   Modal
   ========================================================================= */
.vt-gift-wrap-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}

.vt-gift-wrap-modal__dialog {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: #FAFAFC !important;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: vtGiftWrapSlideIn 0.2s ease-out;
}

@keyframes vtGiftWrapSlideIn {
    from { transform: translateY(20px); }
    to { transform: translateY(0); }
}

.vt-gift-wrap-modal__content {
    padding: 14px 20px 6px;
    background: #FAFAFC !important;
    border-radius: 10px;
}

.vt-gift-wrap-modal__close {
    position: absolute;
    top: 0px;
    right: 0px;
    border: none;
    background: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    z-index: 2;
    padding: 4px 8px;
}

.vt-gift-wrap-modal__close:hover {
    color: #333;
}

/* Header */
.vt-gift-wrap-modal__header {
    text-align: center;
    margin-bottom: 8px;
}

/* Hero: product thumbnail left, text right */
.vt-gift-wrap-modal__hero {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.vt-gift-wrap-modal__product-thumb {
    flex: 0 0 108px;
    width: 108px;
}

.vt-gift-wrap-modal__product-thumb img {
    width: 108px;
    height: 108px;
    object-fit: cover;
    border-radius: 10px;
    cursor: help;
}

.vt-gift-wrap-modal__hero-text {
    flex: 1;
    min-width: 0;
}

.vt-gift-wrap-modal__hero-text p {
    margin: 0;
    font-size: 13px;
    color: #333;
    line-height: 1.55;
}

/* Gift wrap image (small) */
.vt-gift-wrap-modal__image {
    text-align: center;
    margin: 6px 0;
}

.vt-gift-wrap-modal__image img {
    border-radius: 10px;
    max-width: 200px;
    height: auto;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.15));
}

/* Message */
.vt-gift-wrap-modal__message-section {
    margin-bottom: 6px;
}

.vt-gift-wrap-modal__message-section label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.vt-gift-wrap-modal__message-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 65px;
    background: #fff;
}

.vt-gift-wrap-modal__message-input:focus {
    border-color: #8266ba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(130, 102, 186, 0.15);
}

.vt-gift-wrap-modal__char-count {
    display: block;
    text-align: right;
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

/* Bottom row: qty + total inline, never wrap */
.vt-gift-wrap-modal__bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 7px;
    flex-wrap: nowrap;
}

.vt-gift-wrap-modal__bottom-row.vt-hidden {
    display: none;
}

.vt-gift-wrap-modal__qty-section {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.vt-gift-wrap-modal__qty-section label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

.vt-gift-wrap-modal__qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    overflow: hidden;
    height: 24px;
}

.vt-gift-wrap-modal__qty-minus,
.vt-gift-wrap-modal__qty-plus {
    width: 24px !important;
    height: 24px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: none !important;
    background: #f5f5f5 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #555 !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.vt-gift-wrap-modal__qty-minus:hover,
.vt-gift-wrap-modal__qty-plus:hover {
    background: #eee !important;
}

.vt-gift-wrap-modal__qty-minus {
    border-radius: 0 !important;
    border-right: 1px solid #ddd !important;
}

.vt-gift-wrap-modal__qty-plus {
    border-radius: 0 !important;
    border-left: 1px solid #ddd !important;
}

.vt-gift-wrap-modal__qty-input {
    width: 28px !important;
    height: 24px !important;
    text-align: center !important;
    border: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
}

.vt-gift-wrap-modal__qty-input::-webkit-outer-spin-button,
.vt-gift-wrap-modal__qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.vt-gift-wrap-modal__qty-hint {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    margin-left: 4px;
}

.vt-gift-wrap-modal__total-section {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    flex: 0 0 auto;
    text-align: right;
}

.vt-gift-wrap-modal__total-price {
    color: #EDA12B;
    font-size: 15px;
}

/* Footer */
.vt-gift-wrap-modal__footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 4px 0 2px;
}

.vt-gift-wrap-modal__remove {
    border: 1.5px solid #c44 !important;
    color: #c44 !important;
    background: transparent !important;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    padding: 4px 14px;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.vt-gift-wrap-modal__remove:hover {
    background: rgba(204, 68, 68, 0.08) !important;
}

.vt-gift-wrap-modal__cancel {
    border: 1.5px solid rgba(130, 102, 186, 0.7) !important;
    color: rgba(130, 102, 186, 0.85) !important;
    background: transparent !important;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    padding: 4px 14px;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.vt-gift-wrap-modal__cancel:hover {
    background: rgba(130, 102, 186, 0.08) !important;
}

.vt-gift-wrap-modal__submit {
    background-color: #EDA12B !important;
    border: 1.5px solid #EDA12B !important;
    color: #fff !important;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    padding: 4px 14px;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.vt-gift-wrap-modal__submit:hover {
    background-color: #d4900f !important;
    border-color: #d4900f !important;
}

.vt-gift-wrap-modal__submit.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .vt-gift-wrap-modal__dialog {
        width: 95%;
        max-width: none;
    }

    .vt-gift-wrap-modal__content {
        padding: 12px 14px 4px;
    }

    .vt-gift-wrap-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .vt-gift-wrap-price {
        display: none;
    }

    .vt-wrap-item-label,
    .vt-wrap-item-for {
        font-size: 13px;
    }

    .vt-wrap-item-for {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }

    .vt-gift-wrap-modal__hero {
        gap: 10px;
    }

    .vt-gift-wrap-modal__product-thumb {
        flex: 0 0 84px;
        width: 84px;
    }

    .vt-gift-wrap-modal__product-thumb img {
        width: 84px;
        height: 84px;
    }

    .vt-gift-wrap-modal__hero-text p {
        font-size: 12px;
    }

    .vt-gift-wrap-modal__bottom-row {
        flex-wrap: nowrap;
    }

    .vt-gift-wrap-modal__total-section {
        font-size: 13px;
    }
}
