/**
 * Main Stylesheet
 *
 * @package Construction_Catalog_Theme
 */

/* Reset and Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

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

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 0;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
}

.site-title a {
    text-decoration: none;
    color: #333;
}

.main-navigation {
    flex: 1;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.main-navigation a:hover {
    color: #2c5aa0;
}

/* Language Switcher */
.cct-language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.cct-language-switcher ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.cct-language-switcher li {
    margin: 0;
    padding: 0;
}

.cct-language-switcher a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: #333;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.cct-language-switcher a:hover {
    background-color: #f0f0f0;
}

.cct-language-switcher .lang-item-current a {
    font-weight: 600;
    color: #2c5aa0;
}

.cct-language-switcher img {
    width: 18px;
    height: auto;
    display: block;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #2c5aa0 0%, #1a3d6f 100%);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #2c5aa0;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.button:hover {
    background: #1a3d6f;
}

.button-primary {
    background: #2c5aa0;
}

.button-primary:hover {
    background: #1a3d6f;
}

.button-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.button-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Sections */
section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.section-footer {
    text-align: center;
    margin-top: 2rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1.5rem;
    text-align: center;
    transition: box-shadow 0.3s;
}

.category-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-card a {
    text-decoration: none;
    color: #333;
}

.category-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.category-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Machines Grid */
.machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Machine Card */
.machine-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.3s;
    background: #fff;
}

.machine-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.machine-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.machine-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    /* Prevent layout shift */
    position: relative;
}

.machine-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Prevent layout shift - explicit dimensions prevent CLS */
    display: block;
}

.machine-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.machine-card-content {
    padding: 1.5rem;
}

.machine-card-brand {
    font-size: 0.9rem;
    color: #2c5aa0;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.machine-card-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.machine-card-model {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.machine-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.machine-card-location {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.machine-card-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2c5aa0;
    margin-bottom: 1rem;
}

.machine-card-footer {
    text-align: center;
}

/* How it Works */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: #2c5aa0;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step h3 {
    margin-bottom: 0.5rem;
}

/* SEO Section */
.seo-section {
    background: #f9f9f9;
    padding: 2rem 0;
}

.seo-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Archive Page */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.archive-description {
    color: #666;
}

/* Active Filters */
.active-filters {
    background: #e8f4f8;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid #2c5aa0;
}

.active-filters .clear-filters {
    margin-left: 1rem;
    color: #2c5aa0;
    text-decoration: none;
    font-weight: 600;
}

.active-filters .clear-filters:hover {
    text-decoration: underline;
}

/* Filter Form */
.catalog-filters {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

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

.filter-section:last-of-type {
    margin-bottom: 1rem;
}

.filter-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

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

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-inputs input {
    flex: 1;
}

.range-inputs span {
    color: #666;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.filter-actions .button {
    flex: 1;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.no-results p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #666;
}

/* Single Machine */
.machine-single {
    max-width: 1200px;
    margin: 0 auto;
}

.entry-header {
    margin-bottom: 2rem;
}

.entry-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.machine-summary-box {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.machine-summary-box h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.summary-table {
    width: 100%;
}

.summary-table th {
    text-align: left;
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    width: 40%;
}

.summary-table td {
    padding: 0.75rem 0.5rem;
}

.machine-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c5aa0;
}

.machine-media {
    margin-bottom: 2rem;
}

.machine-featured-image {
    margin-bottom: 2rem;
    /* Prevent layout shift */
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2; /* Maintain 1200x800 ratio approximately */
    overflow: hidden;
}

.machine-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.machine-video {
    margin-top: 2rem;
}

.machine-video iframe {
    width: 100%;
    max-width: 800px;
    height: 450px;
    border-radius: 4px;
}

.machine-description {
    margin-bottom: 2rem;
}

.machine-description h2 {
    margin-bottom: 1rem;
}

.machine-specifications {
    margin-bottom: 2rem;
}

.machine-specifications h2 {
    margin-bottom: 1rem;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table th {
    background: #f9f9f9;
    text-align: left;
    padding: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    width: 40%;
}

.specs-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.specs-table tr:last-child th,
.specs-table tr:last-child td {
    border-bottom: none;
}

.machine-documents {
    margin-bottom: 2rem;
}

.machine-documents h2 {
    margin-bottom: 1rem;
}

.documents-list {
    list-style: none;
}

.documents-list li {
    margin-bottom: 0.5rem;
}

.documents-list a {
    color: #2c5aa0;
    text-decoration: none;
}

.documents-list a:hover {
    text-decoration: underline;
}

.machine-request-quote {
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 2rem;
}

.machine-request-quote h2 {
    margin-bottom: 1.5rem;
}

/* Form Styles */
.cc-request-quote-form,
.cc-contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.cc-form-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.cc-form-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cc-form-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cc-form-error ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cc-form-error li {
    margin-bottom: 0.5rem;
}

.cc-quote-form,
.cc-contact-form-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.cc-form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

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

.cc-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.cc-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.cc-checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.required {
    color: #d00;
}

.cc-form-group button[type="submit"] {
    align-self: flex-start;
}

/* Footer */
.site-footer {
    background: #333;
    color: #fff;
    padding: 2rem 0;
    margin-top: 4rem;
}

.site-footer-content {
    text-align: center;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.site-info {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Pagination */
.pagination {
    margin: 2rem 0;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.pagination a:hover {
    background: #f9f9f9;
}

.pagination .current {
    background: #2c5aa0;
    color: #fff;
    border-color: #2c5aa0;
}

/* Alerts & Messages */
.cct-alert {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.cct-alert--success {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.cct-alert--error {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.cct-alert--info {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.cct-alert p {
    margin: 0;
}

.cct-alert ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

/* Empty States */
.cct-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    margin: 2rem 0;
}

.cct-empty-state h2 {
    margin-bottom: 1rem;
    color: #666;
}

.cct-empty-state p {
    color: #999;
    margin-bottom: 1.5rem;
}

.cct-empty-state .button {
    margin: 0.5rem;
}

/* Form Field Errors */
.cct-field--error input,
.cct-field--error textarea,
.cct-field--error select {
    border-color: #f44336;
}

.cct-field-error {
    color: #f44336;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* Badges */
.cct-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cct-badge--available {
    background: #4caf50;
    color: #fff;
}

.cct-badge--reserved {
    background: #ff9800;
    color: #fff;
}

.cct-badge--sold {
    background: #757575;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

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

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

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