/* Index Page Specific Styles */

/* Pricing Rules Section */
.pricing-rules {
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
}

.pricing-rules h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-rules h3:before {
    content: "🏷️";
    font-size: 1.2em;
}

/* Price Section - Redesigned for same line with same font size */
.price-section {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f6f9fc 0%, #e6f0f9 100%);
    border-radius: 12px;
}

.price-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.price-header h3 {
    color: #333;
    font-size: 1.7em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.price-header h3:before {
    content: "💰";
    font-size: 1.2em;
}

.current-price {
    font-size: 1.7em;
    font-weight: bold;
    color: #28a745;
    line-height: 1.2;
}

.price-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-left: auto;
}

.original-price {
    font-size: 1.3em;
    color: #999;
    text-decoration: line-through;
}

.original-price:before {
    content: "Was: ";
    font-size: 0.8em;
    color: #999;
    font-weight: normal;
    text-decoration: none;
    margin-right: 5px;
}

.discount-badge {
    background: #ff6b6b;
    color: white;
    padding: 5px 15px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap;
}

/* Rule Grid */
.rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.rule-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.rule-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.rule-card.selected {
    border-color: #28a745;
    background: #f0fff0;
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.15);
}

.rule-card .quantity-range {
    font-size: 1.2em;
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
}

.rule-card .offer-badge {
    background: #ff6b6b;
    color: white;
    padding: 5px 15px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    display: inline-block;
    margin: 10px 0;
    animation: pulse 2s infinite;
}

.rule-card .free-units {
    color: #333;
    font-weight: normal;
    font-size: 1em;
    margin: 10px 0;
    line-height: 1.5;
}

.rule-card .get-pieces {
    color: #28a745;
    font-weight: bold;
    font-size: 1.2em;
    margin: 5px 0;
    display: block;
}

.rule-card .price-info {
    color: #666;
    font-size: 1em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dee2e6;
}

.rule-card .price-info strong {
    color: #28a745;
    font-size: 1.2em;
    font-weight: bold;
}

.rule-card .savings {
    color: #28a745;
    font-weight: bold;
    margin-top: 8px;
    font-size: 0.95em;
    background: #e8f5e9;
    padding: 5px;
    border-radius: 15px;
}

/* Special styling for single piece rule */
.rule-card:first-child .free-units {
    color: #28a745;
    font-weight: bold;
    font-size: 1.3em;
}

/* Quantity Input Group */
.quantity-input-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quantity-input-group label {
    font-weight: bold;
    color: #495057;
    font-size: 1.1em;
}

.quantity-input-group input {
    width: 100px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1em;
    text-align: center;
    font-weight: bold;
}

.quantity-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.quantity-input-group .stock-info {
    color: #6c757d;
    font-size: 0.95em;
    margin-left: auto;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 20px;
}

/* Stock Warning */
.stock-warning {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #ffeeba;
}

/* Offer Details Display */
.offer-details {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border: 1px solid #90caf9;
}

.offer-details .offer-text {
    font-size: 1.2em;
    color: #0d47a1;
    font-weight: bold;
}

.offer-details .free-badge-large {
    background: #28a745;
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

/* Free Items Display */
.free-items-display {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
}

.free-items-display span {
    color: #28a745;
    font-size: 1.3em;
    margin: 0 5px;
}

/* Notification styles */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease-out;
}

.notification-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .rule-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quantity-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quantity-input-group .stock-info {
        margin-left: 0;
        text-align: center;
    }
    
    .offer-details {
        flex-direction: column;
        text-align: center;
    }
    
    .price-header {
        flex-wrap: wrap;
    }
}

@media screen and (max-width: 480px) {
    .rule-grid {
        grid-template-columns: 1fr;
    }
    
    .price-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .price-header h3 {
        font-size: 1.5em;
    }
    
    .current-price {
        font-size: 1.5em;
    }
    
    .price-details {
        margin-left: 0;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .discount-badge {
        align-self: flex-start;
    }
    
    .rule-card .free-units {
        font-size: 0.95em;
    }
    
    .rule-card .get-pieces {
        font-size: 1.1em;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rule-card {
    animation: slideIn 0.3s ease-out;
}