/* =========================================================
   XHUGOY QUICK SIZE POPUP — COMPACT SQUARE PREMIUM UI v1.3.0
   - Left image panel: square, full image visible
   - Right details panel: square, no internal scrolling
   - Size + Color: side by side
========================================================= */

:root {
    --xq-black: #11130f;
    --xq-olive: #252b21;
    --xq-olive-2: #343c2e;
    --xq-khaki: #d6c29a;
    --xq-khaki-light: #eee5d2;
    --xq-text: #f8f5ee;
    --xq-muted: #a9ad9f;
    --xq-line: rgba(255,255,255,.12);
}

body.xhugoy-qsp-open {
    overflow: hidden;
}

.xhugoy-qsp-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.xhugoy-qsp-modal.is-open {
    display: flex;
}

.xhugoy-qsp-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(61,73,52,.28), transparent 34%),
        rgba(6,7,5,.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: xqFade .22s ease both;
}

.xhugoy-qsp-dialog {
    position: relative;
    z-index: 1;
    width: min(960px, calc(100vw - 44px));
    max-height: calc(100vh - 44px);
    overflow: hidden;
    background: var(--xq-black);
    color: var(--xq-text);
    border: 1px solid rgba(214,194,154,.22);
    border-radius: 18px;
    box-shadow: 0 40px 120px rgba(0,0,0,.58);
    animation: xqRise .28s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes xqFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes xqRise {
    from { opacity: 0; transform: translateY(16px) scale(.986); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.xhugoy-qsp-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    background: rgba(17,19,15,.84);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all .2s ease;
    backdrop-filter: blur(8px);
}

.xhugoy-qsp-close:hover {
    background: var(--xq-khaki);
    border-color: var(--xq-khaki);
    color: #111;
}

.xhugoy-qsp-loader {
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--xq-khaki);
}

.xhugoy-qsp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: var(--xq-khaki);
    border-radius: 50%;
    animation: xhugoy-spin .7s linear infinite;
}

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

/* Two equal square panels */
.xhugoy-qsp-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
}

/* LEFT PANEL */
.xhugoy-qsp-media {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(16,18,15,.02), rgba(16,18,15,.08)),
        #e8e3d7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    box-sizing: border-box;
}

.xhugoy-qsp-media::before {
    content: "XHUGOY • BUILT FOR THE TOUGH";
    position: absolute;
    z-index: 3;
    left: 20px;
    bottom: 18px;
    padding: 7px 10px;
    background: rgba(14,16,12,.78);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    font-size: 7px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .15em;
    backdrop-filter: blur(8px);
}

.xhugoy-qsp-media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 49%, rgba(255,255,255,.05) 50%, transparent 51%),
        linear-gradient(0deg, transparent 49%, rgba(255,255,255,.05) 50%, transparent 51%);
    background-size: 40px 40px;
    opacity: .18;
}

.xhugoy-qsp-image,
.xhugoy-qsp-media img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    object-position: center !important;
    display: block;
}

/* RIGHT PANEL — square, compact, NO SCROLL */
.xhugoy-qsp-info {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden !important;
    box-sizing: border-box;
    padding: 34px 34px 26px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.018), transparent 34%),
        var(--xq-black);
    display: flex;
    flex-direction: column;
}

.xhugoy-qsp-info::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--xq-khaki), transparent 72%);
}

.xhugoy-qsp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--xq-khaki);
    font-size: 8px;
    letter-spacing: .17em;
    font-weight: 900;
    flex: 0 0 auto;
}

.xhugoy-qsp-eyebrow::before {
    content: "";
    width: 22px;
    height: 1px;
    background: currentColor;
}

.xhugoy-qsp-title {
    margin: 0 0 8px;
    color: #fff;
    font-size: clamp(22px, 2.7vw, 34px);
    line-height: 1;
    letter-spacing: -.02em;
    text-transform: uppercase;
    font-weight: 900;

    /* Keep long names from breaking the square layout */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 0 0 auto;
}

.xhugoy-qsp-price {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--xq-line);
    color: var(--xq-khaki-light);
    font-size: 16px;
    line-height: 1.2;
    font-weight: 800;
    flex: 0 0 auto;
}

.xhugoy-qsp-price del {
    opacity: .48;
    margin-right: 6px;
}

.xhugoy-qsp-price ins {
    color: var(--xq-khaki);
    text-decoration: none;
}

/* Let the form use the remaining square height */
.xhugoy-qsp-info form.variations_form {
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* SIZE + COLOR SIDE BY SIDE */
.xhugoy-qsp-info table.variations {
    width: 100%;
    margin: 0 0 8px !important;
    border: 0 !important;
    flex: 0 0 auto;
}

.xhugoy-qsp-info table.variations tbody {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.xhugoy-qsp-info table.variations tr {
    display: block !important;
    width: 100%;
    min-width: 0;
}

.xhugoy-qsp-info table.variations th,
.xhugoy-qsp-info table.variations td {
    display: block !important;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-sizing: border-box;
}

.xhugoy-qsp-info table.variations th {
    margin: 0 0 5px;
}

.xhugoy-qsp-info table.variations label {
    display: block;
    color: #d8dcd1;
    font-size: 8px;
    line-height: 1;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 900;
}

.xhugoy-qsp-info table.variations select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 34px 0 11px;
    border: 1px solid rgba(214,194,154,.28);
    border-radius: 7px;
    outline: 0;
    background:
        linear-gradient(45deg, transparent 50%, var(--xq-khaki) 50%) calc(100% - 16px) 18px/5px 5px no-repeat,
        linear-gradient(135deg, var(--xq-khaki) 50%, transparent 50%) calc(100% - 13px) 18px/5px 5px no-repeat,
        #1b1f18;
    color: #fff;
    font-size: 12px;
    line-height: 44px;
    font-weight: 700;
    cursor: pointer;
}

.xhugoy-qsp-info table.variations select:hover,
.xhugoy-qsp-info table.variations select:focus {
    border-color: var(--xq-khaki);
    box-shadow: 0 0 0 3px rgba(214,194,154,.07);
}

.xhugoy-qsp-info table.variations select option {
    background: #1b1f18;
    color: #fff;
}

/* Hide Reset link to keep the compact square cleaner */
.xhugoy-qsp-info .reset_variations {
    display: none !important;
}

.xhugoy-qsp-info .single_variation_wrap {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Keep variation content compact */
.xhugoy-qsp-info .single_variation {
    min-height: 0 !important;
    flex: 0 0 auto;
}

.xhugoy-qsp-info .woocommerce-variation-description {
    display: none !important;
}

.xhugoy-qsp-info .woocommerce-variation-price {
    margin: 0 0 5px;
    color: #fff;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 800;
}

.xhugoy-qsp-info .woocommerce-variation-availability {
    margin: 0 0 6px;
    color: #b8c5ae;
    font-size: 9px;
    line-height: 1.15;
}

/* Buttons sit cleanly at the bottom area */
.xhugoy-qsp-info .woocommerce-variation-add-to-cart {
    display: grid !important;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: auto !important;
    align-items: stretch;
}

.xhugoy-qsp-info .quantity {
    margin: 0 !important;
    width: 58px;
}

.xhugoy-qsp-info .quantity .qty {
    width: 58px;
    height: 46px;
    min-height: 46px;
    padding: 0 4px;
    border: 1px solid rgba(214,194,154,.28);
    border-radius: 7px;
    background: #1b1f18;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    box-sizing: border-box;
}

.xhugoy-qsp-info .single_add_to_cart_button,
.xhugoy-qsp-info .xhugoy-buy-now {
    min-height: 46px !important;
    height: 46px !important;
    width: 100%;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    padding: 0 12px !important;
    font-size: 9px !important;
    line-height: 46px !important;
    font-weight: 900 !important;
    letter-spacing: .09em !important;
    text-transform: uppercase !important;
    cursor: pointer;
    transition: all .2s ease !important;
    box-sizing: border-box;
    white-space: nowrap;
}

.xhugoy-qsp-info .single_add_to_cart_button {
    background: var(--xq-olive-2) !important;
    color: #fff !important;
}

.xhugoy-qsp-info .single_add_to_cart_button:hover {
    background: #46513e !important;
}

.xhugoy-qsp-info .xhugoy-buy-now {
    grid-column: 1 / -1;
    margin: 0 !important;
    background: var(--xq-khaki) !important;
    color: #111 !important;
}

.xhugoy-qsp-info .xhugoy-buy-now:hover {
    background: var(--xq-khaki-light) !important;
}

/* View Full Product stays compact */
.xhugoy-qsp-full-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    color: var(--xq-khaki) !important;
    font-size: 8px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .13em;
    text-decoration: none !important;
    flex: 0 0 auto;
}

.xhugoy-qsp-full-link:hover {
    color: #fff !important;
}

/* Premium archive button */
.woocommerce ul.products li.product a.button.product_type_variable,
.woocommerce ul.products li.product a.xhugoy-quick-size-trigger {
    background: var(--xq-olive) !important;
    border: 1px solid var(--xq-olive) !important;
    color: #fff !important;
    min-height: 50px;
    border-radius: 7px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: .13em !important;
    text-transform: uppercase;
    transition: all .22s ease !important;
}

.woocommerce ul.products li.product a.button.product_type_variable:hover,
.woocommerce ul.products li.product a.xhugoy-quick-size-trigger:hover {
    background: var(--xq-khaki) !important;
    border-color: var(--xq-khaki) !important;
    color: #111 !important;
    transform: translateY(-2px);
    box-shadow: 0 9px 22px rgba(37,43,33,.16);
}

/* Tablet */
@media (max-width: 900px) and (min-width: 701px) {
    .xhugoy-qsp-dialog {
        width: min(860px, calc(100vw - 30px));
    }

    .xhugoy-qsp-info {
        padding: 28px 26px 22px;
    }

    .xhugoy-qsp-title {
        font-size: 25px;
    }

    .xhugoy-qsp-info table.variations select {
        height: 41px;
        min-height: 41px;
        line-height: 41px;
    }

    .xhugoy-qsp-info .single_add_to_cart_button,
    .xhugoy-qsp-info .xhugoy-buy-now,
    .xhugoy-qsp-info .quantity .qty {
        height: 43px !important;
        min-height: 43px !important;
        line-height: 43px !important;
    }
}

/* Mobile: stack panels; each remains square */
@media (max-width: 700px) {
    .xhugoy-qsp-modal {
        padding: 6px;
        align-items: flex-end;
    }

    .xhugoy-qsp-dialog {
        width: 100%;
        max-height: 96vh;
        overflow-y: auto;
        border-radius: 16px 16px 6px 6px;
    }

    .xhugoy-qsp-product {
        grid-template-columns: 1fr;
    }

    .xhugoy-qsp-media,
    .xhugoy-qsp-info {
        aspect-ratio: 1 / 1;
        width: 100%;
    }

    .xhugoy-qsp-media {
        padding: 16px;
    }

    .xhugoy-qsp-info {
        overflow: hidden !important;
        padding: 24px 18px 18px;
    }

    .xhugoy-qsp-title {
        font-size: 24px;
        margin-bottom: 7px;
    }

    .xhugoy-qsp-price {
        font-size: 15px;
        margin-bottom: 11px;
        padding-bottom: 9px;
    }

    .xhugoy-qsp-info table.variations tbody {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .xhugoy-qsp-info table.variations select {
        height: 40px;
        min-height: 40px;
        font-size: 11px;
    }

    .xhugoy-qsp-info .single_add_to_cart_button,
    .xhugoy-qsp-info .xhugoy-buy-now,
    .xhugoy-qsp-info .quantity .qty {
        height: 42px !important;
        min-height: 42px !important;
        line-height: 42px !important;
    }

    .xhugoy-qsp-info .woocommerce-variation-add-to-cart {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .xhugoy-qsp-info .quantity,
    .xhugoy-qsp-info .quantity .qty {
        width: 54px;
    }

    .xhugoy-qsp-full-link {
        margin-top: 8px;
    }
}

@media (max-width: 390px) {
    .xhugoy-qsp-info {
        padding: 20px 14px 15px;
    }

    .xhugoy-qsp-eyebrow {
        margin-bottom: 6px;
    }

    .xhugoy-qsp-title {
        font-size: 21px;
    }

    .xhugoy-qsp-info table.variations tbody {
        gap: 6px;
    }

    .xhugoy-qsp-info table.variations select {
        padding-left: 9px;
        font-size: 10px;
    }
}


/* v1.4 sharp tactical button geometry — colors unchanged */
.woocommerce ul.products li.product a.button.product_type_variable,
.woocommerce ul.products li.product a.xhugoy-quick-size-trigger,
#xhugoy-qsp-modal .single_add_to_cart_button,
#xhugoy-qsp-modal .xhugoy-buy-now{border-radius:0!important;}


/* v1.4.1 archive CHOOSE SIZE alignment fix */
.woocommerce ul.products li.product a.button.product_type_variable,
.woocommerce ul.products li.product a.xhugoy-quick-size-trigger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 18px !important;
    line-height: 1 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
}

.woocommerce ul.products li.product a.button.product_type_variable::before,
.woocommerce ul.products li.product a.button.product_type_variable::after,
.woocommerce ul.products li.product a.xhugoy-quick-size-trigger::before,
.woocommerce ul.products li.product a.xhugoy-quick-size-trigger::after {
    line-height: 1 !important;
}


/* v1.4.2 popup button alignment + darker khaki color fix */
#xhugoy-qsp-modal .single_add_to_cart_button,
#xhugoy-qsp-modal .xhugoy-buy-now {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
}

#xhugoy-qsp-modal .single_add_to_cart_button::before,
#xhugoy-qsp-modal .single_add_to_cart_button::after,
#xhugoy-qsp-modal .xhugoy-buy-now::before,
#xhugoy-qsp-modal .xhugoy-buy-now::after {
    line-height: 1 !important;
}

#xhugoy-qsp-modal .xhugoy-buy-now {
    background: #A88F63 !important;
    color: #111111 !important;
    border-color: #A88F63 !important;
}

#xhugoy-qsp-modal .xhugoy-buy-now:hover,
#xhugoy-qsp-modal .xhugoy-buy-now:focus {
    background: #8F774F !important;
    color: #111111 !important;
    border-color: #8F774F !important;
}

#xhugoy-qsp-modal .single_add_to_cart_button:hover,
#xhugoy-qsp-modal .single_add_to_cart_button:focus {
    color: #ffffff !important;
}
