/* Gun Builder Styles */
.gun-builder-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gun-builder-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Progress Bar */
.progress-container {
    background: linear-gradient(135deg, #c70a0e 0%, #1f2937 100%);
    padding: 20px;
    color: white;
}

.progress-bar {
    background: rgba(255,255,255,0.2);
    height: 4px;
    border-radius: 2px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    background: #fff;
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.progress-steps .step {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.progress-steps .step.active,
.progress-steps .step.completed {
    opacity: 1;
    font-weight: 600;
}

/* Builder Steps */
.builder-step {
    display: none;
    padding: 40px;
    min-height: 500px;
}

.builder-step.active {
    display: block;
}

.step-header {
    text-align: center;
    margin-bottom: 40px;
}

.step-header h3 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.step-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Budget Inputs */
.budget-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 600px;
    margin: 0 auto 40px;
}

.budget-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.budget-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    color: #000;
}

.budget-group input:focus {
    outline: none;
    border-color: #999;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Option Grid */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.option-grid.two-column {
    grid-template-columns: 1fr 1fr;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.option-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-card:hover {
    border-color: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.option-card.selected {
    border-color: #1f2937;
    background: linear-gradient(135deg, #1f2937 0%, #283547 100%);
    color: white;
}

.option-card.selected h4,
.option-card.selected p{
    color: #fff;
}

.option-card .option-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.option-card h4 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.option-card p {
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
    color: #333;
}

/* Step Actions */
.step-actions {
    text-align: center;
    margin-top: 40px;
}

.step-actions .btn,
.summary-actions .btn{
    height: 43px;
    margin: 0 10px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 400;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.summary-actions .btn.btn-primary{
    margin-left: 0;
}

.btn-primary {
    height: 43px;
    border: 0;
    background-color: #c70a0e;
    padding: 0 24px;
    font-size: 15px;
    color: #fff;
    text-transform: uppercase;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #000;
}

.btn-success {
    background: #28a745;
    color: #fff;
    height: 43px;
    border: 0;
    padding: 0 24px;
    font-size: 15px;
    border-radius: 5px;
}

.btn-info{
    color: #000;
    height: 43px;
    border: 0;
    padding: 0 24px;
    font-size: 15px;
    border-radius: 5px;
    margin-right: 10px;
}

/* Results Styles */
.results-summary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 30px;
    margin-bottom: 30px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 20px 20px 10px;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.out-of-stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 17px;
    line-height: 1.3;
    font-weight: normal;
    font-family: "Lato",sans-serif;
    min-height: 42px;
    margin: 0 0 20px;
}

.product-name a {
    color: #000;
    text-decoration: none;
}

.product-name a:hover {
    color: #1f2937;
}

.product-category {
    color: #666;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.product-price {
    margin-bottom: 20px;
}

.product-price .price {
    font-size: 20px;
    font-weight: 700;
    color: #c70a0e;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    height: auto;
    text-transform: uppercase;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.no-results h4 {
    margin-bottom: 10px;
    color: #333;
}

.no-results p {
    color: #666;
    margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gun-builder-page {
        padding: 10px;
    }
    
    .builder-step {
        padding: 20px;
    }
    
    .budget-inputs {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .option-grid.two-column {
        grid-template-columns: 1fr;
    }
    
    .progress-steps {
        font-size: 12px;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Updated Budget Inputs Grid */
.budget-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto 40px;
}

.budget-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.budget-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    text-align: center;
}

.budget-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.budget-group {
    display: flex;
    flex-direction: column;
}

.budget-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.budget-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.budget-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Mechanism Images */
.option-icon-img {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.mechanism-image {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

/* Final Options Styles */
.final-options-content {
    margin-bottom: 30px;
}

.final-options-content h4 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 20px;
}

.info-box {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.info-box p {
    font-size: 16px;
    color: #155724;
    margin-bottom: 10px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* Accessories Section in Results */
.accessories-section {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.accessories-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.accessory-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.accessory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.accessory-card img {
    max-width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 15px;
}

.accessory-card h5 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.accessory-card .accessory-price {
    font-size: 20px;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 10px;
}

.accessory-card .accessory-quantity {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.accessory-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Total Price Summary */
.total-price-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin: 30px 0;
}

.total-price-summary h3 {
    font-size: 28px;
    margin-bottom: 20px;
}

.price-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto 20px;
}

.price-item {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
}

.price-item label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.price-item .price-value {
    font-size: 24px;
    font-weight: 700;
}

.final-total {
    border-top: 2px solid rgba(255,255,255,0.3);
    padding-top: 20px;
    margin-top: 20px;
}

.final-total .price-value {
    font-size: 36px;
    font-weight: 900;
}

/* Progress Steps Update */
.progress-steps {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    flex-wrap: wrap;
    gap: 5px;
}

.progress-steps .step {
    flex: 1;
    min-width: 60px;
    text-align: center;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .budget-inputs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .budget-row {
        grid-template-columns: 1fr;
    }
    
    .price-breakdown {
        grid-template-columns: 1fr;
    }
    
    .accessories-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-steps {
        font-size: 10px;
    }
    
    .progress-steps .step {
        min-width: 40px;
    }
}

/* Skip Option Button */
.skip-option-btn {
    background: transparent;
    border: 2px dashed #6c757d;
    color: #6c757d;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.skip-option-btn:hover {
    border-color: #495057;
    color: #495057;
    background: rgba(108, 117, 125, 0.05);
}

/* Loading State for Images */
.mechanism-image {
    background: transparent;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Enhanced Option Cards for Final Step */
#final-options-title {
    text-align: center;
}

#final-options-description {
    text-align: center;
}

.final-options-content .option-card {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gun-builder-container .option-icon img{
    max-height: 100px;
}

.selections-summary { 
    margin-top: 40px; 
    border: 1px solid #c70a0e; 
    padding: 16px; 
    border-radius: 8px; 
}

.selections-summary h3{
    color: #c70a0e;
    font-size: 25px;
    margin-bottom: 20px;
}

.summary-list { 
    list-style: none; 
    padding-left: 0; 
    margin-bottom: 20px; 
    color: #333;
}
.summary-list li { margin-bottom: 6px; }

.summary-change { 
    margin-left: 8px; 
    font-size: 0.9em;
    color: #c70a0e;
    border-bottom: 1px solid; 
}

.summary-actions { display: flex; gap: 12px; align-items: center; }
.budget-warning { background:#fff3cd; color:#664d03; padding:8px 10px; border-radius:6px; }

.builder-header-actions{
    margin: 20px 0;
    text-align: right;
}