/* ==============================================================
   1. BUTTON OVERLAYS 
============================================================== */
.product .glwe-archive-btn-wrap,
.woocommerce-product-gallery .glwe-single-btn-wrap {
    position: absolute;
    top: 10px; 
    right: 10px; 
    z-index: 9999 !important;
}

.garo-wishlist-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    border-radius: 50%;
}

.garo-wishlist-btn .garo-heart-icon {
    width: 18px; 
    height: 18px;
    stroke-width: 1.2; 
    fill: rgba(0, 0, 0, 0.01);
    stroke: #ffffff;
    filter: drop-shadow(0px 1px 3px rgba(0,0,0,0.7)); 
    transition: transform 0.2s ease, fill 0.2s ease;
}

.woocommerce-product-gallery .glwe-single-btn-wrap .garo-heart-icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.garo-wishlist-btn:hover .garo-heart-icon { transform: scale(1.15); }
.garo-wishlist-btn.is-active .garo-heart-icon {
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

/* ==============================================================
   2. HEADER COUNTER (Native Blocksy Alignment)
============================================================== */
.glwe-header-counter-wrap {
    position: relative;
    display: inline-flex; /* Prevents stretching to full height */
    align-items: center;
    justify-content: center;
    color: #b9a16b;
    text-decoration: none;
    transition: transform 0.2s ease;
    margin: 0 !important; /* Strips all margins */
    padding: 5px; /* Minimal breathing room */
    height: auto; /* Let Blocksy determine the height */
    line-height: 1;
}

.glwe-header-counter-wrap:hover { transform: scale(1.05); }

/* The Mobile Text (Hidden by Default) */
.glwe-header-text {
    display: none;
    margin-right: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--theme-palette-color-1, #111111);
}

/* The structural wrapper that fixes vertical alignment */
.glwe-icon-badge-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.glwe-counter-icon { stroke: currentColor; fill: none; transition: fill 0.3s ease; display: block; }
.glwe-header-counter-wrap:hover .glwe-counter-icon { fill: var(--theme-palette-color-8, #f5f5f5); }

.glwe-counter-badge { 
    position: absolute; 
    top: -6px; 
    right: -8px; 
    background: #B8860B; 
    color: #ffffff; 
    font-size: 9px; 
    font-weight: 500; 
    width: 16px; 
    height: 16px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; 
    border: 2px solid #ffffff; 
    line-height: 1;
    box-sizing: content-box; 
}

/* ==============================================================
   3. DESKTOP WISHLIST TABLE
============================================================== */
.glwe-wishlist-container { padding: 20px 0; }
.glwe-wishlist-table { border: none !important; width: 100%; }
.glwe-wishlist-table th { background: transparent; border-bottom: 2px solid var(--theme-palette-color-7, #e5e5e5); text-transform: uppercase; font-size: 14px; text-align: left; padding-bottom: 10px; }
.glwe-wishlist-table td { border-bottom: 1px solid var(--theme-palette-color-8, #f5f5f5); vertical-align: middle; padding: 15px 0; }
.product-thumbnail img { max-width: 70px; height: auto; border-radius: 3px; }
.glwe-remove-item { font-size: 24px; color: #cc0000; text-decoration: none !important; line-height: 1; }
.glwe-remove-item:hover { color: #ff0000; }
.glwe-item-row { transition: opacity 0.3s ease; }
.glwe-in-stock { color: green; font-weight: 500; }
.glwe-out-of-stock { color: red; font-weight: 500; }

/* ==============================================================
   4. MOBILE RESPONSIVE WISHLIST CARDS
============================================================== */
@media screen and (max-width: 768px) {
    .product .glwe-archive-btn-wrap { top: 8px; right: 8px; }
    
    .glwe-wishlist-table thead { display: none; }
    .glwe-wishlist-table, .glwe-wishlist-table tbody { display: block; width: 100%; }
    
    .glwe-wishlist-table tr { 
        display: grid !important; 
        grid-template-columns: 80px 1fr; 
        grid-template-rows: auto auto auto;
        grid-template-areas: "image title" "image price" "action action";
        gap: 5px 15px; 
        margin-bottom: 20px; 
        border: 1px solid var(--theme-palette-color-7, #eee); 
        border-radius: 8px; 
        padding: 15px; 
        position: relative; 
    }
    
    .glwe-wishlist-table td { padding: 0 !important; border: none !important; text-align: left !important; }
    
    .glwe-wishlist-table td.product-thumbnail { grid-area: image; text-align: left; }
    .glwe-wishlist-table td.product-thumbnail img { display: block; width: 100%; max-width: 100%; border-radius: 3px; }
    
    .glwe-wishlist-table td.product-name { grid-area: title; align-self: end; padding-right: 25px !important; } 
    .glwe-wishlist-table td.product-price { grid-area: price; align-self: start; font-weight: bold; }
    
    .glwe-wishlist-table td.product-add-to-cart { grid-area: action; margin-top: 15px; }
    .glwe-wishlist-table td.product-add-to-cart .button { width: 100%; display: block; text-align: center; }
    
    .glwe-wishlist-table td.product-remove { position: absolute; top: 10px; right: 15px; z-index: 2; }
    .glwe-wishlist-table td.product-stock-status { display: none !important; }
}

/* ==============================================================
   5. BOTTOM CONTROL PANEL (Rename & Share Columns)
============================================================== */
.glwe-controls-panel {
    margin-top: 40px;
    border: 1px solid var(--theme-palette-color-7, #eee);
    border-radius: 8px;
    background: var(--theme-palette-color-8, #fafafa);
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 Equal Columns on Desktop */
    gap: 40px;
}

.glwe-control-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.glwe-control-label {
    font-family: var(--theme-headings-font);
    font-size: 16px;
    color: var(--theme-palette-color-1, #111);
}

.glwe-input-field {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #555;
    background: #fff;
    font-size: 14px;
}

.glwe-input-field[readonly] { cursor: copy; background: #f9f9f9; }

.glwe-save-title-btn {
    background-color: var(--theme-palette-color-1, #111) !important;
    color: #fff !important;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
}

.glwe-share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.glwe-copy-btn {
    background-color: var(--theme-palette-color-1, #111) !important;
    color: #fff !important;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 600;
}

.glwe-social-btn {
    padding: 10px 15px;
    border-radius: 4px;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    border: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.glwe-social-btn.whatsapp { background-color: #25D366; }
.glwe-social-btn.facebook { background-color: #1877F2; }

/* Mobile styling for the 2 columns */
@media screen and (max-width: 768px) {
    .glwe-controls-panel {
        grid-template-columns: 1fr; /* Stack the columns on mobile */
        gap: 30px;
        padding: 20px;
    }
    
    .glwe-save-title-btn { width: 100%; }
    
    .glwe-share-buttons { flex-direction: column; }
    .glwe-share-buttons .button { width: 100%; display: block; }
}

/* Shared Public Page specific fixes */
.glwe-shared-layout { padding: 40px 0; }
.glwe-shared-header { text-align: center; margin-bottom: 30px; }
.glwe-shared-title { font-family: var(--theme-headings-font); margin-bottom: 10px; font-size: 32px; }

/* ==============================================================
   6. HEADER ACTIONS (Added Spacing)
============================================================== */
.glwe-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px; /* Added beautiful 25px breathing room */
}
.glwe-page-title, .glwe-shared-title {
    margin-bottom: 0 !important;
    font-size: 28px;
}
.glwe-shared-subtitle {
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

.glwe-bulk-trigger-btn {
    background: transparent !important;
    border: 1px solid var(--theme-palette-color-1, #111) !important;
    color: var(--theme-palette-color-1, #111) !important;
    padding: 6px 15px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
}
.glwe-bulk-trigger-btn:hover { background: var(--theme-palette-color-8, #fafafa) !important; }

/* ==============================================================
   7. VARIATION DISPLAY & HIDDEN CHECKBOXES
============================================================== */
.glwe-variation-meta { font-size: 12px; color: #777; margin-top: 4px; background: var(--theme-palette-color-8, #fafafa); display: inline-block; padding: 3px 8px; border-radius: 4px; border: 1px solid #eee; }

/* Hide checkboxes by default */
.product-cb { display: none !important; }
.glwe-wishlist-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--theme-palette-color-1, #111); }

/* Show checkboxes ONLY when is-bulk-mode is triggered (Applies to both pages now) */
.is-bulk-mode .product-cb { display: table-cell !important; width: 30px; text-align: center; }
.is-bulk-mode .product-remove { display: none !important; } /* Hide 'X' button to prevent misclicks */

/* ==============================================================
   8. BULK ACTIONS TOOLBAR (Floating UI)
============================================================== */
.glwe-bulk-actions-bar {
    display: none; /* Hidden by default */
    justify-content: space-between;
    align-items: center;
    background: var(--theme-palette-color-8, #f5f5f5);
    border: 1px solid var(--theme-palette-color-7, #ddd);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.is-bulk-mode .glwe-bulk-actions-bar {
    display: flex;
}

.glwe-bulk-left { display: flex; align-items: center; gap: 15px; }
.glwe-select-all-label { display: flex; align-items: center; gap: 5px; font-weight: bold; cursor: pointer; }
.glwe-bulk-count { font-size: 14px; color: var(--theme-palette-color-1, #111); }

.glwe-bulk-buttons { display: flex; gap: 10px; }
.glwe-bulk-add-btn { background-color: var(--theme-palette-color-1, #111) !important; color: #fff !important; border: none; padding: 8px 15px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.glwe-bulk-remove-btn { background-color: transparent !important; color: #cc0000 !important; border: 1px solid #cc0000 !important; padding: 8px 15px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.glwe-bulk-remove-btn:hover { background-color: #ffe6e6 !important; }
.glwe-bulk-cancel-btn { background-color: #ddd !important; color: #111 !important; border: none; padding: 8px 15px; border-radius: 4px; font-size: 13px; cursor: pointer; }

/* ==============================================================
   9. MOBILE RESPONSIVE WISHLIST CARDS
============================================================== */
@media screen and (max-width: 768px) {
    .glwe-wishlist-table thead { display: none; }
    .glwe-wishlist-table, .glwe-wishlist-table tbody { display: block; width: 100%; }
    
    /* Show Header Text ONLY on Mobile */
    .glwe-header-text {
        display: block;
    }
    
    /* Standard Mobile Card Layout */
    .glwe-wishlist-table tr { 
        display: grid !important; 
        grid-template-columns: 80px 1fr; 
        grid-template-rows: auto auto auto;
        grid-template-areas: "image title" "image price" "action action";
        gap: 5px 15px; 
        margin-bottom: 20px; 
        border: 1px solid var(--theme-palette-color-7, #eee); 
        border-radius: 8px; 
        padding: 15px; 
        position: relative; 
    }
    
    /* BULK MODE Mobile Card Layout (Injects checkbox area for both pages) */
    .is-bulk-mode .glwe-wishlist-table tr {
        grid-template-columns: 30px 70px 1fr;
        grid-template-areas: "check image title" "check image price" "action action action";
    }
    .is-bulk-mode .product-cb { display: flex !important; align-items: center; justify-content: center; grid-area: check; }
    
    .glwe-wishlist-table td { padding: 0 !important; border: none !important; text-align: left !important; }
    
    .glwe-wishlist-table td.product-thumbnail { grid-area: image; text-align: left; }
    .glwe-wishlist-table td.product-thumbnail img { display: block; width: 100%; max-width: 100%; border-radius: 4px; }
    
    .glwe-wishlist-table td.product-name { grid-area: title; align-self: end; padding-right: 25px !important; } 
    .glwe-wishlist-table td.product-price { grid-area: price; align-self: start; font-weight: bold; }
    
    .glwe-wishlist-table td.product-add-to-cart { grid-area: action; margin-top: 15px; }
    .glwe-wishlist-table td.product-add-to-cart .button { width: 100%; display: block; text-align: center; }
    
    .glwe-wishlist-table td.product-remove { position: absolute; top: 10px; right: 15px; z-index: 2; }
    .glwe-wishlist-table td.product-stock-status { display: none !important; }

    /* Stack Bulk Actions Bar on Mobile */
    .glwe-bulk-actions-bar { flex-direction: column; gap: 15px; align-items: flex-start; }
    .glwe-bulk-buttons { width: 100%; display: flex; flex-wrap: wrap; gap: 10px; }
    .glwe-bulk-buttons button { flex: 1 1 45%; padding: 10px 5px; font-size: 12px; }
    .glwe-bulk-buttons .glwe-bulk-cancel-btn { flex: 1 1 100%; } /* Cancel spans full width */
}