/*
Theme Name: Global Cycle Tours GP Child
Theme URI: https://globalcycletours.com/
Description: GeneratePress child theme for Global Cycle Tours using WooCommerce Products and Cambodia Bike Tours Woo Tour Fields as the single tour data source.
Author: W3SEO
Version: 2.3.33
Template: generatepress
Text Domain: gbb
Requires at least: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Floating Action Button */
#gemini-toggle-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    z-index: 999998;
    transition: transform 0.2s;
}
#gemini-toggle-btn:hover {
    transform: scale(1.08);
}

/* Chat Popup Window */
#gemini-chat-container {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 25px;
    width: 360px;
    max-width: calc(100vw - 40px);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    z-index: 999999;
    border: 1px solid #e2e8f0;
}

.gemini-header {
    background: linear-gradient(135deg, #047857, #10b981);
    color: #ffffff;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#gemini-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

#gemini-messages {
    height: 320px;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f8fafc;
}

.msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
}

.user-msg {
    align-self: flex-end;
    background-color: #059669;
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.bot-msg {
    align-self: flex-start;
    background-color: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 2px;
}

.bot-msg.loading { color: #6b7280; font-style: italic; }
.bot-msg.error { color: #dc2626; background: #fef2f2; border-color: #fecaca; }

.gemini-input-area {
    display: flex;
    padding: 10px;
    gap: 8px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

#gemini-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 13.5px;
    outline: none;
}

#gemini-send-btn {
    background: #059669;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

/* ======================================================
   Tour Details Navigation Tabs & "BOOK NOW" Alignment
   ====================================================== */

/* Prevent flex container from pushing the last item to the right edge */
.tour-tabs, 
.tour-nav-tabs, 
.nav-tabs,
ul.nav-tabs {
    justify-content: flex-start !important;
}

/* Remove auto-margin and right float from the Book Now tab */
.tour-tab-book-now,
.book-now-tab,
a[href*="#book-now"],
a[href*="#booking"],
.nav-tabs li:last-child {
    margin-left: 0 !important;
    float: left !important;
}

/* ======================================================
   Synchronize Tour Card Layout (Archive vs Home Page)
   ====================================================== */

/* 1. Remove list bullet points */
.archive .tour-grid-item ul,
.archive .tour-card ul,
.archive .tour-meta ul,
.archive .woocommerce ul.products li.product ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.archive .tour-grid-item li,
.archive .tour-card li,
.archive .tour-meta li {
    list-style-type: none !important;
    padding: 2px 0 !important;
    margin: 0 !important;
}

/* 2. Set 2-column info grid matching Home page */
.archive .tour-meta-info,
.archive .tour-details-wrapper,
.archive .tour-info-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 12px !important;
    padding: 12px 15px !important;
    font-size: 13px !important;
}

/* 3. Hide extra "VIEW DETAILS" button and "PER PERSON" label */
.archive .badge-guaranteed-departure,
.archive .btn-view-details,
.archive a.button.product_type_simple,
.archive .view-details-btn,
.archive .price-label,
.archive .per-person {
    display: none !important;
}

/* 4. Align Price & Duration display cleanly */
.archive .tour-card .price,
.archive .product .price {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1a202c !important;
    margin: 0 !important;
}

/* 5. Rounded corners for Tour Cards matching Home page */
.archive .tour-card,
.archive .product-inner,
.archive ul.products li.product {
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06) !important;
    border: 1px solid #edf2f7 !important;
}

/* ======================================================
   Deals Page Grid Layout (Centered Fix)
   ====================================================== */

.page-template-page-deals .site-main,
.page-id-deals .site-main,
.gbb-deals-container {
    width: 100% !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-top: 40px;
    padding-bottom: 60px;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

.gbb-deals-header {
    text-align: center;
    margin-bottom: 40px;
}

.gbb-deals-title {
    font-size: 32px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 8px;
}

.gbb-deals-subtitle {
    font-size: 16px;
    color: #4a5568;
}

/* Centered Grid Rules */
.gbb-deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center !important;
    justify-items: center !important;
    width: 100%;
}

/* Deal Card Component */
.gbb-deal-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #edf2f7;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
    width: 100%;
    max-width: 360px;
}

.gbb-deal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Card Thumbnail & Badge */
.gbb-deal-image-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.gbb-deal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gbb-deal-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: #e53e3e;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 2;
    text-transform: uppercase;
}

/* Card Body */
.gbb-deal-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.gbb-deal-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.gbb-deal-card-title a {
    color: #2d3748;
    text-decoration: none;
}

/* Pricing Display */
.gbb-deal-pricing {
    margin-top: auto;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.gbb-price-regular {
    text-decoration: line-through;
    color: #a0aec0;
    font-size: 14px;
}

.gbb-price-sale {
    font-size: 20px;
    font-weight: 800;
    color: #80b435;
}

/* Button */
.gbb-deal-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #80b435;
    color: #ffffff !important;
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.gbb-deal-btn:hover {
    background-color: #6a962b;
}

/* ======================================================
   Tour Tag Archives (Deals) - 3-Column Grid Layout
   ====================================================== */

.tax-tour-tag ul.products,
.archive.tax-tour-tag .site-main ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    list-style: none !important;
}

.tax-tour-tag ul.products li.product,
.archive.tax-tour-tag ul.products li.product {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

@media screen and (max-width: 992px) {
    .tax-tour-tag ul.products,
    .archive.tax-tour-tag .site-main ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

@media screen and (max-width: 576px) {
    .tax-tour-tag ul.products,
    .archive.tax-tour-tag .site-main ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* ======================================================
   Mobile Navigation Fix (Phone & LOG IN Display)
   ====================================================== */
@media screen and (max-width: 768px) {
    /* Show action buttons container on mobile */
    .gbb-header__top .gbb-header__actions {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin-left: auto !important;
        margin-right: 6px !important;
    }

    /* Style Phone and LOG IN tabs for smaller mobile viewports */
    .gbb-header__top .gbb-header__actions > a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 11px !important;
        padding: 6px 10px !important;
        white-space: nowrap !important;
    }

    /* Resize icons inside header actions on mobile */
    .gbb-header__top .gbb-header__actions > a svg,
    .gbb-header__top .gbb-header__actions > a i {
        width: 14px !important;
        height: 14px !important;
    }

    /* On narrow mobile screens (<480px), hide telephone text to keep Phone icon & LOG IN tab aligned */
    @media screen and (max-width: 480px) {
        .gbb-header__top .gbb-header__actions a[href^="tel:"] span {
            display: none !important;
        }
    }
}