* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo img {
    height: 60px;
    width: auto;
}

.logo-text {
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: #c0c0c0;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

nav a:hover {
    color: #ff6600;
    background: rgba(255, 102, 0, 0.1);
    transform: translateY(-2px);
}

.quote-hero {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.quote-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.quote-hero p {
    font-size: 1.1rem;
    color: #c0c0c0;
    max-width: 600px;
    margin: 0 auto;
}

.quote-section, .quote-view-section {
    padding: 4rem 0;
    background: white;
}

.quote-container {
    max-width: 800px;
    margin: 0 auto;
}

.quote-form {
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 5px solid #ff6600;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    color: #1a1a1a;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid #ff6600;
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

input[type="text"], input[type="email"], textarea, select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #ff6600;
}

.service-section {
    margin-bottom: 2rem;
}

.section-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    user-select: none;
}

.section-header:hover {
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
}

.section-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.section-toggle {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.section-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.section-content.collapsed {
    max-height: 0;
}

.section-content.expanded {
    max-height: 4000px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.service-item {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.service-item:hover {
    border-color: #ff6600;
    background: #fff5f0;
}

.service-item.selected {
    border-color: #ff6600;
    background: #fff5f0;
}

.service-info {
    flex: 1;
    /* Allow this side to shrink so a long name wraps instead of pushing the
       quantity controls out of the card. */
    min-width: 0;
}

.service-name {
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
    overflow-wrap: break-word;
}

.service-price {
    color: #ff6600;
    font-weight: bold;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Never let the controls collapse to make room for the name. */
    flex-shrink: 0;
}

.quantity-btn {
    background: #ff6600;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
    font-size: 1rem;
    line-height: 1;
    /* Keep the circles perfectly round; don't let flex squish them. */
    flex-shrink: 0;
}

.quantity-btn:hover { background: #e55500; }
.quantity-btn:disabled { background: #ccc; cursor: not-allowed; }

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    display: inline-block;
}

.quote-summary {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.quote-summary h3 {
    margin-bottom: 1rem;
    color: #ff6600;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #444;
    gap: 1rem;
}

.summary-line:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.2rem;
    color: #ff6600;
}

.btn-primary {
    background: linear-gradient(45deg, #ff6600, #ff8533);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
    width: 100%;
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.4);
    background: linear-gradient(45deg, #ff8533, #ffaa66);
}

.btn-primary:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #2d2d2d;
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-secondary:hover { background: #1a1a1a; }

.form-error {
    background: #fee;
    border: 1px solid #f99;
    color: #900;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.hidden { display: none; }

.site-footer {
    background: #1a1a1a;
    color: #c0c0c0;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Quote view page */

.quote-document {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.quote-doc-header {
    border-bottom: 3px solid #ff6600;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.quote-doc-header h1 {
    color: #1a1a1a;
    font-size: 2rem;
    margin: 0;
}

.quote-meta {
    text-align: right;
    font-size: 0.95rem;
    color: #555;
}

.quote-meta-line { margin-bottom: 0.25rem; }

.quote-doc-section {
    margin-bottom: 2rem;
}

.quote-doc-section h3 {
    color: #1a1a1a;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.4rem;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

.quote-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.quote-table th, .quote-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}

.quote-table th {
    background: #f5f5f5;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.quote-table .num {
    text-align: right;
    white-space: nowrap;
}

.quote-table tfoot .total-row td {
    font-weight: bold;
    font-size: 1.1rem;
    color: #ff6600;
    border-top: 2px solid #1a1a1a;
    border-bottom: none;
    padding-top: 1rem;
}

.unit-note {
    color: #777;
    font-size: 0.85rem;
}

.notes {
    white-space: pre-wrap;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #ff6600;
}

.quote-doc-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 0.85rem;
    text-align: center;
}

.quote-doc-footer p { margin-bottom: 0.4rem; }

.quote-actions {
    max-width: 800px;
    margin: 1.5rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-link-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f5f5f5;
    padding: 0.75rem;
    border-radius: 6px;
}

.share-link-row label {
    margin: 0;
    white-space: nowrap;
}

.share-link-row input {
    flex: 1;
    background: white;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    .logo img { height: 50px; }
    .logo-text { font-size: 1.5rem; }
    nav ul { flex-direction: column; text-align: center; gap: 1rem; }
    .quote-hero h1 { font-size: 2rem; }
    .service-grid { grid-template-columns: 1fr; }
    .quote-document { padding: 1.5rem; }
    .quote-doc-header { flex-direction: column; }
    .quote-meta { text-align: left; }
}

@media print {
    body {
        background: white;
        color: #000;
    }
    .site-header, .site-footer, .no-print {
        display: none !important;
    }
    .quote-view-section {
        padding: 0;
    }
    .quote-document {
        box-shadow: none;
        border: none;
        padding: 0;
        max-width: 100%;
    }
    a { color: #000; text-decoration: none; }
}
