/* ==========================================================================
   Bundle King - Instant Popup Styles (Final Polished Version)
   ========================================================================== */

/* The main container that is initially hidden */
#bk-popup-container {
    display: none; 
}

/* The semi-transparent background overlay */
.bk-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* The popup window itself */
.bk-popup {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: bk-popup-fade-in 0.3s ease-out forwards;
}

@keyframes bk-popup-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Popup Header --- */
.bk-popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    position: relative;
    flex-shrink: 0;
}

.bk-popup-header-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border: 1px solid #eee;
    border-radius: 6px;
}
.bk-popup-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.bk-popup-header-text {
    flex-grow: 1;
    padding-top: 5px;
}

.bk-popup-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #333;
    line-height: 1.2;
}

.bk-popup-header p {
    margin: 8px 0 0 0;
    font-size: 0.85rem;
    color: #005a9c;
    background-color: #e7f3ff;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    font-weight: 500;
}


/* Close button */
.bk-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.bk-popup-close:hover {
    color: #000;
}

/* --- Popup Body (Scrollable Area) --- */
.bk-popup-body {
    padding: 10px 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.bk-size-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.bk-size-row:last-child {
    border-bottom: none;
}

.bk-size-label {
    font-weight: 500;
    font-size: 1.1rem;
}


/* [COUNTER MAKEOVER - FINAL & DEFINITIVE FIX] */
/* ===================================================================== */
/*  This is the final, most forceful version to achieve the pill shape
    and guarantee perfect vertical centering of all elements.
/* ===================================================================== */

/* 1. The main container. */
.bk-quantity-control {
    display: flex !important;
    align-items: stretch !important; 
    width: 120px !important;
    height: 36px !important;
    overflow: hidden !important;
    border: 1px solid #cccccc !important;
    border-radius: 50px !important; /* Pill Shape */
}

/* 2. The wrappers for buttons and input. */
.bk-quantity-btn-wrap,
.bk-quantity-input-wrap {
    display: flex !important; 
    align-items: center !important;
    justify-content: center !important;
}
.bk-quantity-btn-wrap {
    width: 40px !important; 
    flex-shrink: 0 !important; 
}
.bk-quantity-input-wrap {
    flex-grow: 1 !important; 
    width: 40px !important; 
}

/* 3. The buttons. */
.bk-quantity-control .bk-quantity-btn {
    background-color: #ffffff !important;
    border: none !important;
    width: 100% !important;
    height: 100% !important;
    font-size: 20px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: background-color 0.2s !important;
    display: block !important; /* Changed from flex to block */
    line-height: 36px !important; /* [THE DEFINITIVE CENTERING FIX] This forces the symbol into the vertical center. */
}

/* Specific color for the PLUS button text */
.bk-quantity-control .bk-quantity-btn.plus {
    color: #3498db !important; /* Blue */
}

/* Specific color for the MINUS button text */
.bk-quantity-control .bk-quantity-btn.minus {
    color: #555555 !important; /* [VISIBLE GREY] Changed from light grey to a visible dark grey */
}

/* Subtle background color on hover */
.bk-quantity-control .bk-quantity-btn:hover {
    background-color: #f7f7f7 !important; 
}

/* Disabled state */
.bk-quantity-control .bk-quantity-btn:disabled {
    background-color: #ffffff !important;
    color: #eeeeee !important;
    cursor: not-allowed !important;
}

/* 4. The input. */
.bk-quantity-control .bk-quantity-input {
    width: 100% !important;
    height: 100% !important;
    line-height: 34px !important; /* Centering for the number */
    background-color: #ffffff !important;
    border: none !important;
    border-left: 1px solid #cccccc !important;
    border-right: 1px solid #cccccc !important;
    text-align: center !important;
    color: #333 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important; 
    -moz-appearance: textfield !important;
}
.bk-quantity-control .bk-quantity-input:focus {
    outline: none !important;
}
.bk-quantity-control .bk-quantity-input::-webkit-outer-spin-button,
.bk-quantity-control .bk-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}


/* --- Popup Footer --- */
.bk-popup-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: #f7f7f7;
    flex-shrink: 0;
}

/* --- Sleeker Confirmation Button --- */
.bk-popup-footer button {
    padding: 8px 22px; 
    border-radius: 99px; /* Pill shape */
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    border: 1px solid transparent;
}

.bk-popup-footer .bk-cancel-btn {
    background-color: #fff;
    color: #555;
    border-color: #ddd;
}
.bk-popup-footer .bk-cancel-btn:hover {
    background-color: #f5f5f5;
}

/* Matching the confirm button to the new counter style */
.bk-popup-footer .bk-confirm-selections-btn {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}
.bk-popup-footer .bk-confirm-selections-btn:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}
.bk-popup-footer .bk-confirm-selections-btn:disabled {
    background-color: #a9cce3;
    border-color: #a9cce3;
    cursor: not-allowed;
}