.tier-pricing-table {
    margin: 2em 0;
    padding: 1em;
    background: #f8f8f8;
    border-radius: 4px;
}

.tier-pricing-table h4 {
    margin: 0 0 1em;
    padding: 0;
    font-size: 1.1em;
    color: #333;
}

.tier-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.tier-table th,
.tier-table td {
    padding: 0.5em;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tier-table th {
    font-weight: 600;
    color: #333;
}

.tier-table tr:last-child td {
    border-bottom: none;
}

.from-text {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-top: 0.5em;
}

/* Highlight active tier in cart */
.cart tr.cart_item.active-tier {
    background: #f0f8ff;
}

/* Responsive table */
@media screen and (max-width: 500px) {
    .tier-table {
        font-size: 0.9em;
    }
    
    .tier-table th,
    .tier-table td {
        padding: 0.4em;
    }
}

.tier-selector-wrapper {
    margin: 2em 0;
    width: 100%;
}

.tier-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 -5px 20px;
    max-width: 100%; /* Ensure it doesn't overflow on mobile */
    flex-wrap: nowrap; /* Don't wrap by default (only in mobile) */
}

/* Base tier option styles */
.tier-option {
    flex: 1;
    text-align: center;
    cursor: pointer;
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: transparent;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    padding: 10px;
}

/* Hover state for all tiers */
.tier-option:hover,
.tier-option.selected {
    border-color: #4a90e2;
    box-shadow: none;
    background: transparent;
}

/* Tier content styles */
.tier-option .quantity {
    font-size: 18px;
    font-weight: bold;
    margin-top: 3px;
    color: #333;
}

/* Price and unit display */
.tier-option .price {
    font-size: 16px;
    color: #333;
    margin-top: 5px;
    word-break: break-word; /* Allow breaking on small screens */
    hyphens: auto;
}

/* Remove the automatic unit display */
.tier-option .price:after {
    display: none;
}

/* Label styles */
.recommended-label,
.best-value-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.recommended-label {
    background-color: #ffa726;
    color: #fff;
    max-width: 100%; /* Prevent overflow */
    overflow: hidden;
    text-overflow: ellipsis;
}

.best-value-label {
    background-color: #ff4444;
    color: #fff;
    max-width: 100%; /* Prevent overflow */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ensure hover and selection states work for all tiers */
.tier-option.recommended:hover,
.tier-option.best-value:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
    transform: translateY(-2px);
}

.tier-option.recommended.selected,
.tier-option.best-value.selected {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

/* Responsive styles */
@media (max-width: 768px) {
    .tier-options {
        flex-direction: row; /* Changed from column to row to display horizontally */
        flex-wrap: wrap; /* Allow wrapping if needed */
        gap: 8px; /* Reduced gap for mobile */
        justify-content: center; /* Center items */
    }
    
    .tier-option {
        flex: 0 0 calc(33.333% - 10px); /* Set width to roughly 1/3 minus gap */
        min-width: 85px; /* Ensure minimum width */
        margin: 0;
        padding: 8px 5px; /* Smaller padding for mobile */
    }
    
    .tier-option .quantity {
        font-size: 16px; /* Slightly smaller font for mobile */
    }
    
    .tier-option .price {
        font-size: 14px; /* Slightly smaller font for mobile */
    }
    
    /* Add better handling for long labels */
    .recommended-label,
    .best-value-label {
        font-size: 9px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 90%;
    }
}

/* Extra adjustments for very small screens */
@media (max-width: 480px) {
    .tier-options {
        gap: 5px; /* Even smaller gap */
    }
    
    .tier-option {
        padding: 6px 3px; /* Tighter padding */
    }
    
    .tier-option .quantity {
        font-size: 14px;
        margin-top: 2px;
    }
    
    .tier-option .price {
        font-size: 12px;
        margin-top: 3px;
    }
}

/* Update cart button styling */
.single_add_to_cart_button {
    color: #FFFFFF;
    font: 18px "Libre Baskerville";
    background: #40723B;
    margin: 0px 0px 0px 40px;
    padding: 0px 25.4835px;
    float: left;
    width: calc(100% - 90px);
    height: 52px;
    border-radius: 4px;
    text-align: center;
    line-height: 52px;
    transition: all .25s;
    border: none;
}

.single_add_to_cart_button:hover {
    background: #389630 !important;
}

/* Remove the price from button text */
.single_add_to_cart_button::after {
    display: none !important;
}

/* Ensure proper spacing in cart form */
.cart {
    margin-bottom: 0 !important;
} 