/**
 * Ignite Plow Fitment - Build Your System Styles
 * Version 1.4.0 - Supports standalone page with finder
 */

/* === Page Layout === */
.ipf-build-system-page { padding: 40px 20px; background: #f5f5f5; min-height: 100vh; }
.ipf-build-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 350px; gap: 30px; }
.ipf-build-container.ipf-mode-select .ipf-build-header { grid-column: 1 / -1; }

/* === Header === */
.ipf-build-header { grid-column: 1 / -1; text-align: center; margin-bottom: 20px; }
.ipf-build-header h1 { margin: 0 0 10px; font-size: 32px; font-weight: 700; color: #1a1a1a; }
.ipf-vehicle-name { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; color: #555; }
.ipf-vehicle-placeholder { color: #888; font-style: italic; }
.ipf-type-badge { display: inline-block; padding: 4px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; border-radius: 4px; }
.ipf-badge-atv { background: #e3f2fd; color: #1565c0; }
.ipf-badge-utv { background: #e8f5e9; color: #2e7d32; }

/* === Finder Section (standalone mode) === */
.ipf-build-finder { grid-column: 1 / -1; background: #fff; border-radius: 12px; padding: 25px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
.ipf-build-finder .ipf-finder-form { display: flex; flex-wrap: wrap; gap: 15px; margin: 0; }
.ipf-build-finder .ipf-finder-field { flex: 1 1 200px; min-width: 150px; }
.ipf-build-finder .ipf-finder-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: #333; }
.ipf-build-finder .ipf-select { width: 100%; height: 48px; padding: 0 40px 0 15px; font-size: 16px; color: #333; background-color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; background-size: 12px; border: 2px solid #ddd; border-radius: 6px; appearance: none; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.ipf-build-finder .ipf-select:hover { border-color: #bbb; }
.ipf-build-finder .ipf-select:focus { outline: none; border-color: #0066cc; box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15); }
.ipf-build-finder .ipf-select:disabled { background-color: #f5f5f5; color: #999; cursor: not-allowed; }

/* === Build Steps === */
.ipf-build-content { display: flex; flex-direction: column; gap: 20px; }
.ipf-build-step { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); overflow: hidden; }
.ipf-step-header { display: flex; align-items: center; gap: 15px; padding: 20px 25px; background: #f8f9fa; border-bottom: 1px solid #eee; }
.ipf-step-number { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; font-size: 16px; font-weight: 700; color: #fff; background: #0066cc; border-radius: 50%; }
.ipf-step-waiting .ipf-step-number { background: #ccc; }
.ipf-step-complete .ipf-step-number { background: #2e7d32; }
.ipf-step-active .ipf-step-number { background: #0066cc; }
.ipf-step-header h2 { margin: 0; flex: 1; font-size: 18px; font-weight: 600; color: #333; }
.ipf-step-waiting .ipf-step-header h2 { color: #888; }
.ipf-step-status { font-size: 13px; font-weight: 600; color: #2e7d32; }
.ipf-step-status.ipf-optional { color: #888; }
.ipf-step-content { padding: 25px; }
.ipf-step-desc { margin: 0 0 20px; font-size: 14px; color: #666; }
.ipf-step-placeholder { margin: 0; font-size: 14px; color: #999; font-style: italic; text-align: center; padding: 20px 0; }

/* === Selected Product (Mount display) === */
.ipf-selected-product { display: flex; gap: 20px; align-items: center; }
.ipf-selected-product .ipf-product-thumb { flex: 0 0 120px; }
.ipf-selected-product .ipf-product-thumb img { width: 100%; height: auto; border-radius: 8px; border: 1px solid #eee; }
.ipf-selected-product .ipf-product-details h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; color: #1a1a1a; }
.ipf-selected-product .ipf-sku { margin: 0 0 8px; font-size: 13px; color: #888; }
.ipf-selected-product .ipf-price { margin: 0; font-size: 20px; font-weight: 700; color: #1a1a1a; }

/* === Mount Options (for standalone mode) === */
.ipf-mount-options { display: flex; flex-direction: column; gap: 12px; }

/* === Product Options (Push Tube, Blades, Mounts) === */
.ipf-blade-options { display: flex; flex-direction: column; gap: 12px; }
.ipf-product-option { border: 2px solid #e0e0e0; border-radius: 10px; transition: border-color 0.2s, box-shadow 0.2s; }
.ipf-product-option:hover { border-color: #bbb; }
.ipf-product-option.ipf-option-selected { border-color: #0066cc; box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1); }
.ipf-option-label { display: block; cursor: pointer; }
.ipf-option-label input[type="radio"], .ipf-option-label input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.ipf-option-content { display: flex; align-items: center; gap: 15px; padding: 15px 20px; position: relative; }
.ipf-option-content .ipf-product-thumb { flex: 0 0 80px; }
.ipf-option-content .ipf-product-thumb img { width: 100%; height: auto; border-radius: 6px; }
.ipf-option-content .ipf-product-details { flex: 1; }
.ipf-option-content .ipf-product-details h4 { margin: 0 0 5px; font-size: 15px; font-weight: 600; color: #333; }
.ipf-option-content .ipf-sku { margin: 0 0 5px; font-size: 12px; color: #888; }
.ipf-option-content .ipf-price { margin: 0; font-size: 16px; font-weight: 700; color: #1a1a1a; }
.ipf-option-content .ipf-fitment-badge { display: inline-block; padding: 2px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; border-radius: 3px; margin-bottom: 5px; }
.ipf-badge-model-specific { background: #e8f5e9; color: #2e7d32; }
.ipf-badge-universal { background: #fff3e0; color: #e65100; }

/* === Checkmark === */
.ipf-checkmark { flex: 0 0 24px; width: 24px; height: 24px; border: 2px solid #ddd; border-radius: 50%; position: relative; transition: all 0.2s; }
.ipf-product-option.ipf-option-selected .ipf-checkmark { background: #0066cc; border-color: #0066cc; }
.ipf-product-option.ipf-option-selected .ipf-checkmark::after { content: ''; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* === No Blade Option === */
.ipf-no-blade-option { background: #f9f9f9; }
.ipf-no-blade-icon { flex: 0 0 80px; height: 60px; display: flex; align-items: center; justify-content: center; background: #eee; border-radius: 6px; }
.ipf-no-blade-icon .dashicons { font-size: 30px; color: #999; }

/* === Order Summary Sidebar === */
.ipf-build-sidebar { position: sticky; top: 30px; align-self: start; }
.ipf-order-summary { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); padding: 25px; }
.ipf-order-summary h3 { margin: 0 0 20px; font-size: 18px; font-weight: 700; color: #1a1a1a; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.ipf-summary-items { margin-bottom: 20px; }
.ipf-summary-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.ipf-summary-item:last-child { border-bottom: none; }
.ipf-item-name { font-size: 14px; color: #555; }
.ipf-item-price { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.ipf-summary-item.ipf-item-removed .ipf-item-name, .ipf-summary-item.ipf-item-removed .ipf-item-price { text-decoration: line-through; color: #bbb; }
.ipf-summary-item.ipf-summary-empty .ipf-item-name { color: #999; }
.ipf-summary-item.ipf-summary-empty .ipf-item-price { color: #ccc; }
.ipf-summary-total { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; margin-bottom: 20px; border-top: 2px solid #eee; }
.ipf-total-label { font-size: 16px; font-weight: 600; color: #333; }
.ipf-total-price { font-size: 24px; font-weight: 700; color: #1a1a1a; }

/* === Add to Cart Button === */
.ipf-add-all-btn { display: block; width: 100%; padding: 16px 24px; font-size: 16px; font-weight: 700; color: #fff; background: #0066cc; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.2s, transform 0.1s; }
.ipf-add-all-btn:hover { background: #0052a3; }
.ipf-add-all-btn:active { transform: scale(0.98); }
.ipf-add-all-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }
.ipf-add-all-btn .ipf-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: ipf-spin 0.8s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes ipf-spin { to { transform: rotate(360deg); } }

.ipf-back-link { margin: 20px 0 0; text-align: center; }
.ipf-back-link a { font-size: 14px; color: #666; text-decoration: none; }
.ipf-back-link a:hover { color: #0066cc; text-decoration: underline; }
.ipf-summary-note { margin: 15px 0 0; text-align: center; font-size: 13px; color: #888; font-style: italic; }

/* === Muted text === */
.ipf-muted { color: #888; font-style: italic; }

/* === Responsive === */
@media (max-width: 900px) {
    .ipf-build-container { grid-template-columns: 1fr; }
    .ipf-build-finder { grid-column: 1; }
    .ipf-build-sidebar { position: static; order: -1; }
    .ipf-order-summary { position: fixed; bottom: 0; left: 0; right: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15); z-index: 100; padding: 20px; }
    .ipf-order-summary h3, .ipf-summary-items { display: none; }
    .ipf-summary-total { margin-bottom: 15px; padding-top: 0; border-top: none; }
    .ipf-back-link, .ipf-summary-note { display: none; }
    .ipf-build-content { padding-bottom: 150px; }
}

@media (max-width: 768px) {
    .ipf-build-finder .ipf-finder-form { flex-direction: column; }
    .ipf-build-finder .ipf-finder-field { flex: 1 1 100%; }
}

@media (max-width: 600px) {
    .ipf-build-system-page { padding: 20px 15px; }
    .ipf-build-header h1 { font-size: 24px; }
    .ipf-vehicle-name { flex-direction: column; gap: 8px; }
    .ipf-selected-product { flex-direction: column; text-align: center; }
    .ipf-option-content { flex-wrap: wrap; }
    .ipf-option-content .ipf-product-thumb { flex: 0 0 60px; }
    .ipf-option-content .ipf-product-details { flex: 1 1 calc(100% - 100px); }
}
