/* TMWC Booking Buttons - Complete Styles */
.tmwc-booking-buttons,
.tmwc-buttons-wrapper .tmwc-booking-buttons,
.tmwc-injected-buttons .tmwc-booking-buttons,
.tmwc-replaced-button .tmwc-booking-buttons {
    display: flex !important;
    gap: 15px;
    align-items: center;
    margin: 20px 0 0 0;
    flex-wrap: wrap;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    align-content: center;
    justify-content: center;
}

/* Button Base Styles */
.tmwc-booking-buttons button {
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 50px;
}

.tmwc-booking-buttons button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button - Book Now */
.tmwc-btn-primary,
.tmwc-book-now {
    background: linear-gradient(135deg, #D4AF37 0%, #F4CF57 100%);
    color: #FFFFFF ;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.tmwc-btn-primary:hover:not(:disabled),
.tmwc-book-now:hover:not(:disabled) {
    background: linear-gradient(135deg, #B8941F 0%, #D4AF37 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Secondary Button - Add to Cart */
.tmwc-btn-secondary,
.tmwc-add-cart {
    background: #9D9D9C;
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(157, 157, 156, 0.2);
}

.tmwc-btn-secondary:hover:not(:disabled),
.tmwc-add-cart:hover:not(:disabled) {
    background: #7A7A79;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 157, 156, 0.3);
}

/* Price Display */
.tmwc-price-display {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 20px;
    font-weight: bold;
    color: #21386B;
}

.tmwc-price-label {
    font-size: 14px;
    font-weight: normal;
    color: #666;
}

/* Messages */
.tmwc-booking-messages {
    margin-top: 15px;
    width: 100%;
}

.tmwc-message {
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.tmwc-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.tmwc-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.tmwc-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Hide ONLY the original Tourmaster booking button - keep all other elements */
.tourmaster-tour-booking-bar-button-wrap,
.tourmaster-tour-booking-proceed-button,
.tourmaster-tour-booking-submit-input,
.tourmaster-tour-booking-bar-button,
.tourmaster-button[value="Proceed Booking"],
.gdlr-core-button[href*="proceed-booking"],
a[href*="proceed-booking"] {
    display: none !important;
}

/* Ensure containers and form fields remain visible */
.tourmaster-tour-booking-bar-outer,
.tourmaster-tour-booking-bar-inner,
.tourmaster-tour-booking-fields,
.tourmaster-tour-booking-date-wrap,
.tourmaster-tour-booking-people-wrap,
.tourmaster-tour-booking-bar-bottom {
    display: block !important;
    min-height: auto !important;
}

/* Prevent duplicate buttons */
.tmwc-booking-buttons ~ .tmwc-booking-buttons {
    display: none !important;
}

/* Show only the first instance of our buttons */
.tmwc-booking-buttons:first-of-type {
    display: flex !important;
}

/* Ensure visibility in all locations */
.tourmaster-tour-content .tmwc-booking-buttons,
.tourmaster-single-header .tmwc-booking-buttons,
.tourmaster-tour-booking-bar .tmwc-booking-buttons,
.tmwc-buttons-wrapper,
.tmwc-injected-buttons,
.tmwc-replaced-button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Wrapper styles */
.tmwc-buttons-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 20px 0;
}

/* Button Icons */
.tmwc-booking-buttons .fa {
    font-size: 18px;
}

.tmwc-booking-buttons .button-text {
    display: inline-block;
}

/* Loading state */
.tmwc-booking-buttons button[disabled] .button-text {
    opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tmwc-booking-buttons {
        flex-direction: column;
        width: 100%;
        padding: 15px;
    }
    
    .tmwc-booking-buttons button {
        width: 100%;
        justify-content: center;
    }
    
    .tmwc-price-display {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 15px;
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Force visibility with high specificity */
body.single-tour .tmwc-booking-buttons,
body.single-tour .tmwc-buttons-wrapper {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100 !important;
}

/* Additional overrides for themes that might interfere */
.tourmaster-page-wrapper .tmwc-booking-buttons {
    display: flex !important;
}

.tourmaster-container .tmwc-booking-buttons {
    display: flex !important;
}

/* Debug visibility */
.tmwc-buttons-wrapper:empty::after {
    content: "TMWC: Buttons container loaded but empty";
    display: block;
    padding: 10px;
    background: #ffeeee;
    color: #cc0000;
    border: 1px solid #ff0000;
}