/**
 * Frontend styles for Minimalna Količina plugin
 */

/* Unit name styling in price */
.itb-unit-name {
    font-size: 0.9em;
    opacity: 0.8;
    margin-left: 4px;
}

/* Package price styling */
.itb-package-price {
    font-size: 0.85em;
    margin-top: 5px;
    opacity: 0.8;
}

/* Enhanced quantity inputs */
.itb-quantity-inputs {
    margin: 20px 0;
    background: #f8f8f9;
    padding:15px;
}

/* Revert to Flexbox Layout */
.itb-quantity-fields-wrapper {
    display: flex; /* Revert to Flex */
    justify-content: center;
    align-items: center; /* Vertically center items */
    gap: 15px;
    flex-wrap: nowrap; /* Keep single row */
    width: 100%;
    box-sizing: border-box;
}

/* Styles for each quantity section (unit and package) - Flex Item */
.itb-quantity-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 1 auto; /* Re-add flex item properties */
    box-sizing: border-box;
}

/* Style for the change icon - Flex Item */
.itb-quantity-change-icon {
    display: inline-flex; /* Use inline-flex */
    align-items: center;
    justify-content: center;
    flex: 0 0 auto; /* Re-add flex item properties */
    height: 30px; /* Match button/input height */
    box-sizing: border-box;
    vertical-align: middle; /* Add vertical align */
}

.itb-quantity-change-icon img {
    display: block; /* Ensure it's treated as a block element */
    width: 24px; 
    height: 24px;
    opacity: 0.7;
    cursor: pointer; /* Optional: if it becomes interactive */
    transition: opacity 0.2s ease;
}

.itb-quantity-change-icon img:hover {
    opacity: 1;
}


/* Remove old label style */
/* .itb-quantity-label { ... } */

/* Adjust quantity field container */
.itb-quantity-field {
     /* Removed flex properties, alignment handled by section */
     width: auto; /* Allow natural width */
}

/* MODIFIED Input Wrapper Styles */
.itb-quantity-input-wrapper {
    display: inline-flex; /* Keep inline-flex */
    align-items: center; /* Vertically center items inside */
    vertical-align: middle; /* Add vertical align */
    gap: 5px;
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
    height: 30px; /* Match new button/input height */
    box-sizing: border-box; /* Ensure consistent sizing */
}

/* MODIFIED Unit Label Styles */
.itb-unit-label {
    /* margin-left: 8px; */ /* Removed */
    margin-top: 5px; /* Add space above */
    font-size: 0.9em;
    opacity: 0.8;
    white-space: nowrap;
    /* line-height: 40px; */ /* Removed */
    /* vertical-align: middle; */ /* Removed */
    display: block; /* Make it a block element */
    text-align: center; /* Center the text */
    width: 100%; /* Take full width of its container */
}

/* MODIFIED Input styles */
.itb-quantity-input-wrapper input[type="text"],
.itb-quantity-input-wrapper input[type="number"] {
    width: 55px; /* Specified width */
    height: 30px; /* Specified height */
    text-align: center;
    border: 1px solid #ddd !important;
    background-color: #f5f5f5 !important;
    padding: 0 5px;
    margin: 0;
    box-sizing: border-box; /* Ensure consistent sizing */
    font-size: 1em;
    /* line-height: 38px; */ 
    color: #333;
    outline: none;
    box-shadow: none !important;
    border-radius: 0 !important;
    /* vertical-align: middle; */ /* Remove, rely on flex wrapper */
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

.itb-quantity-input-wrapper input[type="number"]::-webkit-outer-spin-button,
.itb-quantity-input-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* MODIFIED Button styles - Target Look with !important and increased specificity */
/* Targeting buttons specifically within the wrapper */
.itb-quantity-input-wrapper .itb-qty-btn { 
    background: #fff !important; /* White background */
    color: #1F92FF !important; /* Orange symbol */
    width: 30px !important; /* Specified width */
    height: 30px !important; /* Specified height (match width for circle) */
    display: flex !important; /* Use flex for internal centering */
    align-items: center !important; /* Center symbol vertically */
    justify-content: center !important; /* Center symbol horizontally */
    cursor: pointer !important;
    font-size: 1.6em !important;
    font-weight: normal !important;
    line-height: 1 !important; /* Re-add line-height 1 */
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border: 1px solid #1F92FF !important; /* Orange border */
    border-radius: 50% !important; /* Ensure circular */
    transition: background-color 0.2s ease, color 0.2s ease !important;
}

/* Remove specific borders used for separators */
/* .itb-quantity-input-wrapper .minus { border-right: ... } */
/* .itb-quantity-input-wrapper .plus { border-left: ... } */


.itb-qty-btn:hover {
    background: #1F92FF; /* Orange background on hover */
    color: #fff; /* White symbol on hover */
    border-color: #1F92FF !important; /* Darker orange border */
}

/* Hide the original WooCommerce quantity input when our enhanced one is active */
.itb-quantity-inputs + .quantity {
    display: none !important;
}

/* MODIFIED Responsive styles */
@media (max-width: 768px) {
    /* Keep flex direction row for wrapper, but allow wrap */
    .itb-quantity-fields-wrapper {
        /* flex-direction: column; */ /* Remove this if you want side-by-side as long as possible */
        /* align-items: center; */
        gap: 15px;
    }
    
    /* Adjust section width if needed */
    .itb-quantity-section {
         /* width: 100%; */ /* Uncomment if you want full width stacking */
         margin-bottom: 15px;
    }

    /* Remove old label style */
    /* .itb-quantity-label { ... } */
    
    /* Remove old field style */
    /* .itb-quantity-field { ... } */
}

/* Elementor compatibility */
.elementor-add-to-cart .quantity {
    display: none !important;
}

/* Debug box styling */
.itb-debug-box {
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 15px 0;
    font-family: monospace;
    font-size: 12px;
}

/* Center explanation text */
.itb-quantity-explanation {
    text-align: center;
    margin-top: 10px;
    clear: both; /* Ensure it appears below floated/flex items if any */
    width: 100%;
    font-size: 0.9em;
    opacity: 0.8;
}
