/**
 * SS Equipment — Frontend Styles
 *
 * Bootstrap 5 compatible. Uses CSS custom properties from the theme's
 * style.css so colors stay consistent without redefining them.
 *
 * Theme variables available:
 *   --color-primary:    #1e6fab  (logo blue)
 *   --color-accent:     #e07b1a  (logo orange)
 *   --color-bg:         #f0f2f5
 *   --color-bg-card:    #ffffff
 *   --color-text:       #1a1a2e
 *   --color-text-muted: #555566
 *   --color-border:     rgba(0,0,0,0.08)
 *
 * Do NOT import Bootstrap here — the theme loads it from CDN.
 *
 * Per-type overrides:
 *   Default styles are on .ss-equipment-card. Override for a specific
 *   type by targeting its slug class:
 *     .ss-type-scissor-lift .ss-equipment-card { border-top-color: #e07b1a; }
 *   New types added by the client inherit defaults automatically.
 *
 * @package SS_Equipment
 */

/* ======================================================================
   Shared Utilities
   ====================================================================== */

.ss-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    line-height: 1.4;
}

.ss-btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

/* Primary CTA — orange, high contrast */
.ss-btn-cta {
    background-color: var(--color-accent, #e07b1a);
    color: #fff;
    border-color: var(--color-accent, #e07b1a);
}

.ss-btn-cta:hover,
.ss-btn-cta:focus {
    background-color: #c9691a;
    border-color: #c9691a;
    color: #fff;
    text-decoration: none;
}

/* Solid blue primary button */
.ss-btn-primary {
    background-color: var(--color-primary, #1e6fab);
    color: #fff;
    border-color: var(--color-primary, #1e6fab);
}

.ss-btn-primary:hover,
.ss-btn-primary:focus {
    background-color: #185f97;
    border-color: #185f97;
    color: #fff;
    text-decoration: none;
}

/* Outline button */
.ss-btn-outline {
    background-color: transparent;
    color: var(--color-primary, #1e6fab);
    border-color: var(--color-primary, #1e6fab);
}

.ss-btn-outline:hover,
.ss-btn-outline:focus {
    background-color: var(--color-primary, #1e6fab);
    color: #fff;
    text-decoration: none;
}

/* ======================================================================
   Badges
   ====================================================================== */

.ss-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 3px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
}

/* Type badge — blue by default */
.ss-type-badge {
    background-color: var(--color-primary, #1e6fab);
    color: #fff;
}

/* Condition badges */
.ss-badge-new {
    background-color: #198754;  /* Bootstrap success green */
    color: #fff;
}

.ss-badge-used {
    background-color: #6c757d;  /* Bootstrap secondary grey */
    color: #fff;
}

/* Featured badge */
.ss-badge-featured {
    background-color: var(--color-accent, #e07b1a);
    color: #fff;
}

/* ======================================================================
   Filter Bar
   ====================================================================== */

.ss-filter-bar {
    background: #fff;
    border: 1px solid var(--color-border, rgba(0,0,0,0.1));
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ss-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.ss-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 160px;
    min-width: 130px;
}

.ss-filter-keyword-group {
    flex: 2 1 220px;
}

.ss-filter-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted, #555);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0;
}

.ss-filter-select,
.ss-filter-input {
    padding: 0.45rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--color-text, #1a1a2e);
    background-color: #fff;
    width: 100%;
    transition: border-color 0.15s ease;
}

.ss-filter-select:focus,
.ss-filter-input:focus {
    border-color: var(--color-primary, #1e6fab);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 111, 171, 0.2);
}

.ss-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-shrink: 0;
}

/* ======================================================================
   Filter Summary Bar (active filter feedback)
   ====================================================================== */

.ss-filter-summary {
    font-size: 0.88rem;
    color: var(--color-text-muted, #555);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.ss-filter-summary .ss-result-count {
    color: #888;
}

.ss-filter-clear-link {
    color: var(--color-primary, #1e6fab);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.25rem;
}

.ss-filter-clear-link:hover {
    text-decoration: underline;
}

/* ======================================================================
   Equipment Grid
   ====================================================================== */

.ss-equipment-grid {
    margin-bottom: 2rem;
}

/* ======================================================================
   Equipment Card
   All types inherit these styles. Per-type overrides use slug classes.
   ====================================================================== */

.ss-equipment-card {
    background-color: var(--color-bg-card, #fff);
    border: 1px solid var(--color-border, rgba(0,0,0,0.08));
    border-top: 3px solid var(--color-primary, #1e6fab);  /* Default: blue top border */
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ss-equipment-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.13);
    transform: translateY(-2px);
}

/* Card image */
.ss-card-image-link {
    display: block;
    overflow: hidden;
    background: #f5f5f5;
}

.ss-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ss-equipment-card:hover .ss-card-image {
    transform: scale(1.03);
}

.ss-card-image-placeholder {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaeaea;
    color: #bbb;
}

.ss-card-image-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

/* Card body */
.ss-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ss-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.ss-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    line-height: 1.3;
    color: var(--color-text, #1a1a2e);
}

.ss-card-title a {
    color: inherit;
    text-decoration: none;
}

.ss-card-title a:hover {
    color: var(--color-primary, #1e6fab);
}

.ss-card-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted, #555);
    margin: 0 0 0.5rem;
}

.ss-card-excerpt {
    font-size: 0.875rem;
    color: var(--color-text-muted, #555);
    margin: 0 0 0.75rem;
    flex: 1;
    line-height: 1.5;
}

.ss-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary, #1e6fab);
    margin: 0 0 0.5rem;
}

.ss-card-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border, rgba(0,0,0,0.08));
    display: flex;
    gap: 0.5rem;
}

/* Each button takes equal width in the two-button footer */
.ss-card-footer .ss-btn {
    flex: 1;
    font-size: 0.82rem;
    padding: 0.5rem 0.5rem;
    text-align: center;
}

/* ======================================================================
   Per-Type Overrides
   Scissor lifts get orange accent; add more types as needed.
   The client can add more here without touching PHP code.
   ====================================================================== */

/* Scissor Lift — orange accent */
.ss-type-scissor-lift .ss-equipment-card {
    border-top-color: var(--color-accent, #e07b1a);
}
.ss-type-scissor-lift .ss-type-badge {
    background-color: var(--color-accent, #e07b1a);
}

/* Forklift — green accent (matches --color-forklift in theme style.css) */
.ss-type-forklift .ss-equipment-card {
    border-top-color: var(--color-forklift, #2a7d4f);
}
.ss-type-forklift .ss-type-badge {
    background-color: var(--color-forklift, #2a7d4f);
}

/* Telehandler — teal accent (matches --color-telehandler in theme style.css) */
.ss-type-telehandler .ss-equipment-card {
    border-top-color: var(--color-telehandler, #1a7d7d);
}
.ss-type-telehandler .ss-type-badge {
    background-color: var(--color-telehandler, #1a7d7d);
}

/* ======================================================================
   No Results State
   ====================================================================== */

.ss-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted, #555);
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--color-border, rgba(0,0,0,0.08));
    margin-bottom: 2rem;
}

.ss-no-results p {
    margin-bottom: 0.75rem;
}

/* ======================================================================
   Bottom CTA Banner (catalog page)
   ====================================================================== */

.ss-catalog-cta-banner {
    background: var(--color-primary, #1e6fab);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-top: 1rem;
}

.ss-cta-banner-text {
    color: rgba(255,255,255,0.9);
    font-size: 1.05rem;
    margin: 0 0 1rem;
}

/* ======================================================================
   Single Listing Page
   ====================================================================== */

.ss-single-listing-wrap {
    background-color: var(--color-bg, #f0f2f5);
    padding-bottom: 3rem;
}

/* Breadcrumb */
.ss-breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Listing header */
.ss-listing-header {
    margin-bottom: 1.5rem;
}

.ss-listing-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text, #1a1a2e);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.ss-listing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.ss-listing-subtitle {
    color: var(--color-text-muted, #555);
    font-size: 1rem;
    margin: 0;
}

/* Carousel */
.ss-gallery-carousel {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    background: #111;
}

.ss-gallery-slide {
    max-height: 480px;
    object-fit: contain;
    background: #111;
}

/* No photo placeholder */
.ss-no-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #eaeaea;
    border-radius: 8px;
    color: #bbb;
    text-align: center;
}

.ss-no-photo-placeholder .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
}

/* Sidebar CTA box */
.ss-listing-sidebar {
    position: sticky;
    top: 20px;
}

.ss-cta-box {
    background: #fff;
    border: 1px solid var(--color-border, rgba(0,0,0,0.1));
    border-top: 4px solid var(--color-accent, #e07b1a);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.ss-cta-label {
    font-size: 0.95rem;
    color: var(--color-text-muted, #555);
    margin-bottom: 0.75rem;
}

.ss-listing-msrp {
    font-size: 0.875rem;
    color: var(--color-text-muted, #555);
    margin: 0 0 0.25rem;
}

.ss-listing-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary, #1e6fab);
    margin: 0 0 1rem;
}

.ss-cta-phone {
    margin: 0.75rem 0 0;
    font-size: 1.2rem;
    color: var(--color-text, #1a1a2e);
}

/* Quick specs overview */
.ss-quick-specs {
    background: #fff;
    border: 1px solid var(--color-border, rgba(0,0,0,0.08));
    border-radius: 8px;
    padding: 1.25rem;
}

.ss-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text, #1a1a2e);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary, #1e6fab);
}

.ss-overview-table {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
}

.ss-overview-table th,
.ss-overview-table td {
    padding: 0.4rem 0.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.ss-overview-table th {
    color: var(--color-text-muted, #555);
    font-weight: 600;
    width: 40%;
}

/* Content sections */
.ss-content-section {
    background: #fff;
    border: 1px solid var(--color-border, rgba(0,0,0,0.08));
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

/* Spec table */
.ss-spec-table {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.ss-spec-table th {
    width: 50%;
    font-weight: 600;
    color: var(--color-text-muted, #555);
    background: #f9f9f9;
}

/* Bottom CTA */
.ss-listing-bottom-cta {
    text-align: center;
}

.ss-listing-back-link {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.ss-listing-back-link a {
    color: var(--color-primary, #1e6fab);
    text-decoration: none;
}

.ss-listing-back-link a:hover {
    text-decoration: underline;
}

/* ======================================================================
   Responsive Adjustments
   ====================================================================== */

@media (max-width: 767px) {

    .ss-filter-grid {
        flex-direction: column;
    }

    .ss-filter-group {
        flex: 1 1 100%;
    }

    .ss-filter-actions {
        flex-direction: row;
    }

    .ss-gallery-slide {
        max-height: 260px;
    }

    .ss-listing-title {
        font-size: 1.35rem;
    }

    .ss-listing-sidebar {
        position: static;
    }
}
