/**
 * BDW Product Catalog - Public Styles
 *
 * Minimal styling - theme should handle most styling
 */

/* Quote Cart Widget */
.bdw-quote-cart-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.bdw-quote-cart-widget .bdw-quote-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0F925E;
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.bdw-quote-cart-widget .bdw-quote-button:hover {
    background: #0d7a4e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.bdw-cart-count {
    background: white;
    color: #0F925E;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Quote Preview Panel */
.bdw-quote-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bdw-quote-preview.active {
    pointer-events: all;
    opacity: 1;
}

.quote-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bdw-quote-preview.active .quote-preview-overlay {
    opacity: 1;
}

.quote-preview-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 440px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.bdw-quote-preview.active .quote-preview-panel {
    transform: translateX(0);
}

/* Preview Header */
.preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 24px;
    background: var(--pd-dark, #1a1a2e);
    border-bottom: none;
    flex-shrink: 0;
}

.preview-title {
    flex: 1;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
}

.preview-count-badge {
    background: var(--pd-green, #0F925E);
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 8px;
    min-width: 24px;
    text-align: center;
}

.preview-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
    border-radius: 0;
}

.preview-close:hover {
    color: #fff;
    background: none;
}

/* Preview Body */
.preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.preview-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.preview-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 0;
    border-bottom: 1px solid var(--pd-border, #e8e8e8);
}

.preview-item:first-child {
    padding-top: 0;
}

.preview-item-info {
    flex: 1;
}

.preview-item-name {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--pd-dark, #1a1a2e);
    margin: 0 0 6px 0;
}

.preview-item-config {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.config-tag {
    display: inline-block;
    padding: 3px 8px;
    background: transparent;
    border: 1px solid var(--pd-border, #e8e8e8);
    font-size: 11px;
    color: var(--pd-mid, #666);
    letter-spacing: 0.02em;
}

.preview-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-quantity-control .qty-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--pd-mid, #888);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

.preview-qty-input {
    width: 56px;
    padding: 5px 8px;
    border: 1px solid var(--pd-border, #ddd);
    border-radius: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--pd-dark, #1a1a2e);
    background: #fff;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.preview-qty-input::-webkit-inner-spin-button,
.preview-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.preview-qty-input:focus {
    outline: none;
    border-color: var(--pd-green, #0F925E);
}

.preview-item-remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--pd-mid, #888);
    text-decoration: underline;
    text-underline-offset: 2px;
    letter-spacing: 0.02em;
    transition: color 0.2s;
    white-space: nowrap;
}

.preview-item-remove:hover {
    color: #c0392b;
    background: none;
    transform: none;
}

/* Preview Empty State */
.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 12px;
}

.preview-empty svg {
    opacity: 0.25;
    color: var(--pd-dark, #1a1a2e);
}

.preview-empty p {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pd-mid, #888);
    margin: 0;
}

/* Preview Footer */
.preview-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--pd-border, #e8e8e8);
    background: #fff;
    flex-shrink: 0;
}

.preview-continue {
    width: 100%;
    border-radius: 0;
    border: none;
    overflow: hidden;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .quote-preview-panel {
        max-width: 100%;
    }

    .preview-header {
        padding: 16px 20px;
    }

    .preview-body {
        padding: 16px 20px;
    }

    .preview-footer {
        padding: 14px 20px;
    }
}

/* Product Grid (basic fallback) */
.bdw-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Toast Notifications */
.bdw-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--pd-dark, #1a1a2e);
    color: #fff;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    border-radius: 0;
    max-width: 320px;
}

.bdw-toast--show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.bdw-toast--error {
    background: #c0392b;
}

.bdw-toast__icon {
    flex-shrink: 0;
    color: var(--pd-green, #0F925E);
}

/* Quote Form */
.bdw-quote-form {
    max-width: 800px;
    margin: 2rem auto;
}

.bdw-quote-form .form-row {
    margin-bottom: 1.5rem;
}

.bdw-quote-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.bdw-quote-form input[type="text"],
.bdw-quote-form input[type="email"],
.bdw-quote-form input[type="tel"],
.bdw-quote-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bdw-quote-form textarea {
    min-height: 120px;
}

/* Quote Items Table */
.bdw-quote-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.bdw-quote-items-table th,
.bdw-quote-items-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.bdw-quote-items-table th {
    background: #f9f9f9;
    font-weight: 600;
}

/* Loading Spinner */
.bdw-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: bdw-spin 1s ease-in-out infinite;
}

@keyframes bdw-spin {
    to { transform: rotate(360deg); }
}

/* Configuration Details in Quote Overview */
.bdw-configuration-details {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-left: 3px solid #0F925E;
    border-radius: 4px;
}

.bdw-configuration-details .config-detail {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.bdw-configuration-details .config-detail:last-child {
    margin-bottom: 0;
}

.bdw-configuration-details .config-label {
    font-weight: 600;
    color: #555;
}

.bdw-configuration-details .config-value {
    color: #333;
}

/* =========================== Quote Overview Page =========================== */

/* Page Header */
.bdw-quote-overview {
    padding: 2rem 0;
}

.quote-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.quote-header .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 0.5rem 0;
}

.quote-header .page-subtitle {
    font-size: 1.125rem;
    color: #666;
    margin: 0;
}

/* Quote Sections */
.quote-section {
    margin-bottom: 3rem;
}

.quote-section .section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #0F925E;
}

.quote-section .section-description {
    color: #666;
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
}

/* Quote Items Wrapper */
.quote-items-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quote-item-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.quote-item-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

.item-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.item-info {
    flex: 1;
}

.item-info .item-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.75rem 0;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quantity-control label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    margin: 0;
}

.quantity-control .quantity-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.quantity-control .quantity-input:focus {
    outline: none;
    border-color: #0F925E;
}

.btn-remove {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-remove:hover {
    background: #e74c3c;
    color: #fff;
}

.btn-remove .remove-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* Form Section */
.quote-form-section {
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
}

.bdw-quote-form {
    max-width: none;
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9375rem;
}

.form-group .required {
    color: #e74c3c;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #0F925E;
}

.form-control::placeholder {
    color: #999;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
}

.btn-submit {
    min-width: 250px;
}

/* Empty Cart State */
.bdw-empty-cart {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-cart-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.75rem 0;
}

.empty-cart-text {
    font-size: 1.125rem;
    color: #666;
    margin: 0 0 2rem 0;
}

/* Delivery Section */
.delivery-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.delivery-section > label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.delivery-options {
    display: flex;
    gap: 1rem;
}

.delivery-radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.delivery-radio-label:hover {
    border-color: #0F925E;
    background: #f8f9fa;
}

.delivery-radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
}

.delivery-radio-label input[type="radio"]:checked ~ span {
    font-weight: 600;
    color: #0F925E;
}

.delivery-radio-label input[type="radio"]:checked {
    accent-color: #0F925E;
}

.delivery-radio-label span {
    font-size: 1rem;
    color: #333;
    transition: all 0.2s ease;
}

/* Delivery Address Fields */
.delivery-address-fields {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f0f8f4;
    border: 1px solid #0F925E;
    border-radius: 6px;
}

.subsection-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0F925E;
    margin: 0 0 1.25rem 0;
}

.form-group-street {
    grid-column: span 2;
}

.form-group-number {
    grid-column: span 1;
}

.form-group-zip {
    grid-column: span 1;
}

.form-group-city {
    grid-column: span 2;
}

/* Green Submit Button */
.btn-green {
    background: #0F925E !important;
}

.btn-green:hover {
    background: #0d7a4e !important;
}

/* Responsive */
@media (max-width: 768px) {
    .quote-header .page-title {
        font-size: 2rem;
    }

    .quote-section .section-title {
        font-size: 1.5rem;
    }

    .item-main {
        flex-direction: column;
        gap: 1rem;
    }

    .item-controls {
        width: 100%;
        justify-content: space-between;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .quote-form-section {
        padding: 1.5rem;
    }

    .btn-submit {
        width: 100%;
    }

    .btn-remove .remove-text {
        display: none;
    }

    .delivery-options {
        flex-direction: column;
    }

    .form-group-street,
    .form-group-number,
    .form-group-zip,
    .form-group-city {
        grid-column: span 1;
    }
}
