/*
 Theme Name:   GG Astra Child
 Template:     astra
 Description:  Global Gifts child theme for Astra
 Version:      1.0.0
*/

:root {
    --gg-primary: #00A1E1;
    --gg-dark: #1E1E1C;
    --gg-white: #fafafa;
}

/* ===== ThePlusAddons Product Listing — override Astra product grid CSS ===== */
/* Astra adds ast-grid-common-col / ast-width-md-4 to product <article> elements,
   which constrains them to a fraction of the TP grid column instead of 100%. */
.product-list article.product,
.elementor-widget-tp-product-listout article.product {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    float: none !important;
}

.product-list .product-list-content,
.product-list .product-content-image {
    width: 100%;
}

.product-list .product-content-image img {
    width: 100%;
    height: auto;
}

/* ===== TI Wishlist button in product cards — icon-only, top-right overlay ===== */

/* Position wishlist shortcode widget as overlay on the product card image */
.gg-wishlist-overlay {
    position: absolute !important;
    top: 12px;
    right: 12px;
    z-index: 10;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}

/* Hide helper elements */
.tinv-wraper .tinv-wishlist-clear,
.tinv-wraper .tinvwl-tooltip {
    display: none;
}

/* Style the button as a circular icon */
.tinvwl_add_to_wishlist_button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    text-decoration: none !important;
    color: #999 !important;
    font-size: 0 !important;
    line-height: 1;
    padding: 0 !important;
}

.tinvwl_add_to_wishlist_button:hover {
    background: #fff !important;
    color: var(--gg-primary, #00A1E1) !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    transform: scale(1.1);
}

/* Red heart when already in wishlist */
.tinvwl_add_to_wishlist_button.tinvwl-product-in-list {
    color: #e74c3c !important;
}

/* Hide "Add to Wishlist" text — icon only */
.tinvwl_add_to_wishlist_button .tinvwl_add_to_wishlist-text {
    display: none !important;
}

/* Ensure the heart icon from tinvwl-webfont renders at correct size */
.tinvwl_add_to_wishlist_button.tinvwl-icon-heart::before {
    font-size: 18px !important;
}

/* ===== Archive product card swatches + cart icon ===== */
/* ===== Equal-height product cards: stretch inner content to fill min-height ===== */
.post-inner-loop article.product {
    display: flex;
    flex-direction: column;
}

.post-inner-loop article.product > .product-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-inner-loop article.product .product-list-content > .elementor {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-inner-loop article.product .product-list-content .elementor > .e-flex {
    flex: 1;
}

.gg-archive-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 6px 0;
    overflow: hidden;
    position: relative;
    align-content: flex-start;
}

.gg-archive-swatch {
    display: inline-block;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.gg-archive-swatch:hover,
.gg-archive-swatch.active {
    border-color: var(--gg-primary, #00A1E1);
    transform: scale(1.08);
}

.gg-archive-swatch.active {
    box-shadow: 0 0 0 1px var(--gg-primary, #00A1E1);
}

.gg-archive-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Cart icon button — overlay bottom-right */
.gg-archive-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #999;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.gg-archive-cart-btn:hover {
    background: #fff;
    color: var(--gg-primary, #00A1E1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    transform: scale(1.1);
}

.gg-archive-cart-btn svg {
    width: 18px;
    height: 18px;
}

/* Position cart shortcode widget as bottom-right overlay */
.gg-cart-overlay {
    position: absolute !important;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}

/* ===== Archive template — remove Astra's ast-container max-width constraint ===== */
body.archive.woocommerce-page .ast-container,
body.post-type-archive-product .ast-container,
body.tax-product_cat .ast-container,
body.single-product .ast-container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Gallery: prevent Firefox flex min-width:auto from blowing out the container */
.woocommerce-product-gallery {
    min-width: 0;
    max-width: 100%;
}

.woocommerce-product-gallery__image img {
    max-width: 100%;
    height: auto;
}

/* ===== HEADER — minimal fixes only (Elementor settings are the source of truth) ===== */

/* Icon-list: force horizontal — Elementor's "traditional" layout defaults to block */
[data-elementor-type="header"] .elementor-icon-list--layout-traditional .elementor-icon-list-items {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 20px;
}

[data-elementor-type="header"] .elementor-icon-list--layout-traditional .elementor-icon-list-items .elementor-icon-list-item {
    margin: 0 !important;
    flex-shrink: 0;
}

[data-elementor-type="header"] .elementor-icon-list--layout-traditional .elementor-icon-list-item:after {
    display: none !important;
}

/* Category nav: prevent wrapping to second line (all instances including sticky duplicate) */
[data-elementor-type="header"] ul.elementor-nav-menu {
    flex-wrap: nowrap !important;
}

[data-elementor-type="header"] ul.elementor-nav-menu > li > a {
    white-space: nowrap;
}

/* Cart button: remove default border/bg */
[data-elementor-type="header"] .elementor-menu-cart__toggle .elementor-button {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* FiboSearch: shortcode widget + search wrapper must fill their container */
[data-elementor-type="header"] .elementor-widget-shortcode {
    width: 100% !important;
}

[data-elementor-type="header"] .dgwt-wcas-search-wrapp {
    width: 100% !important;
}

/* Category nav: active/current menu item shows blue hover background */
[data-elementor-type="header"] .elementor-nav-menu > li.current-menu-item > a,
[data-elementor-type="header"] .elementor-nav-menu > li.current-menu-ancestor > a,
[data-elementor-type="header"] .elementor-nav-menu > li.current-menu-parent > a {
    color: #ffffff !important;
    background-color: var(--gg-primary, #00A1E1) !important;
}

/* Category dropdown: smooth hover transition */
[data-elementor-type="header"] .elementor-nav-menu--dropdown li a {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ===== MOBILE RESPONSIVE HEADER ===== */

/* Mobile: <= 767px */
@media (max-width: 767px) {
    /* Top bar: smaller text to fit */
    [data-elementor-type="header"] .elementor-icon-list--layout-traditional .elementor-icon-list-items {
        gap: 10px;
    }

    [data-elementor-type="header"] .elementor-icon-list--layout-traditional .elementor-icon-list-text {
        font-size: 11px !important;
    }

    /* Hide cart text, show only icon + badge */
    [data-elementor-type="header"] .elementor-menu-cart__toggle .elementor-button-text {
        display: none !important;
    }
}

/* ===== Related products — fix wishlist + cart overlay positioning ===== */
/* Elementor scoped CSS for template 1431 doesn't apply inside ThePlusAddons related products */
.product-list-content .elementor-element-a649bf8 {
    position: relative !important;
}

.product-list-content .elementor-element-2d88242 {
    position: absolute !important;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.product-list-content .elementor-element-b674d7a {
    position: absolute !important;
    bottom: 12px;
    right: 12px;
    z-index: 10;
}

/* ===== Remove short description bottom margin ===== */
.single-product .woocommerce-product-details__short-description p {
    margin-bottom: 0;
}

/* ===== Single product: wishlist button inline with add-to-cart ===== */
.single-product .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.single-product .woocommerce-variation-add-to-cart > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.single-product .woocommerce-variation-add-to-cart .tinv-wraper {
    padding: 0 !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.single-product .woocommerce-variation-add-to-cart .tinvwl_add_to_wishlist_button {
    margin: 0 !important;
}

/* ===== Remove top border from product meta ===== */
.woocommerce-js div.product .product_meta {
    border-top: none;
}

/* ===== Hide Reviews tab from ThePlusAddons Woo Single Tabs ===== */
.tp-woo-single-tabs .tp-tab-review,
.tp-woo-single-tabs .tp-tab-c-review,
.tp-woo-single-tabs .woocommerce-Tabs-panel--reviews,
.tp-woo-single-tabs label[for*="chck3"] {
    display: none !important;
}

/* ===== Fix ThePlusAddons pink hover on tab labels ===== */
.tp-woo-single-tabs.layout-2 .tp-tab-label:hover,
.tp-woo-single-tabs.layout-3 .tp-tab-label:hover {
    background: #cecece !important;
}

