/**
 * Spumantino Rivenditori – Public Styles
 * No border-radius – matches the site template.
 */

/* ═══════════════════════════════════════════════
 *  Search Form
 * ═══════════════════════════════════════════════ */
.spr-search-form {
    margin-bottom: 30px;
}

.spr-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.spr-field {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spr-field label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.spr-field select,
.spr-field input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.spr-field select {
    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 d='M6 8L1 3h10z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.spr-field select:focus,
.spr-field input[type="text"]:focus {
    border-color: #8B6F47;
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 111, 71, 0.2);
}

.spr-field select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.spr-field-submit {
    flex: 0 0 auto;
}

/* ─── Buttons ─── */
.spr-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.spr-btn-primary {
    background-color: #8B6F47;
    color: #fff;
}

.spr-btn-primary:hover {
    background-color: #73593A;
    color: #fff;
}

.spr-btn-outline {
    background: transparent;
    border: 2px solid #8B6F47;
    color: #8B6F47;
    padding: 8px 20px;
    font-size: 14px;
}

.spr-btn-outline:hover {
    background-color: #8B6F47;
    color: #fff;
}

.spr-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* ═══════════════════════════════════════════════
 *  Dealer Grid
 * ═══════════════════════════════════════════════ */
.spr-dealer-grid {
    display: grid;
    gap: 24px;
}

.spr-cols-2 { grid-template-columns: repeat(2, 1fr); }
.spr-cols-3 { grid-template-columns: repeat(3, 1fr); }
.spr-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .spr-cols-3,
    .spr-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .spr-dealer-grid { grid-template-columns: 1fr; }

    .spr-form-row {
        flex-direction: column;
        gap: 12px;
    }

    .spr-field {
        flex: 0 0 auto;
        width: 100%;
    }

    .spr-field-submit {
        flex: 0 0 auto;
        width: 100%;
    }

    .spr-field-submit .spr-btn {
        width: 100%;
        justify-content: center;
    }

    /* Ensure search form takes full width and doesn't inherit centering */
    .spr-search-form {
        width: 100%;
        text-align: left;
    }

    .spr-form-row {
        align-items: stretch;
    }
}

@media (max-width: 600px) {
    .spr-info-table,
    .spr-info-table tbody,
    .spr-info-table tr,
    .spr-info-table th,
    .spr-info-table td {
        display: block;
    }
    .spr-info-table th {
        width: auto;
        padding-bottom: 4px;
        border-bottom: none;
    }
    .spr-info-table td {
        padding-top: 0;
    }
}

/* ═══════════════════════════════════════════════
 *  Dealer Card
 * ═══════════════════════════════════════════════ */
.spr-dealer-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 0;
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s;
}

.spr-dealer-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.spr-card-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.spr-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.spr-dealer-card:hover .spr-card-thumb img {
    transform: scale(1.05);
}

.spr-card-body {
    padding: 20px;
}

.spr-card-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.3;
}

.spr-card-title a {
    text-decoration: none;
    color: #1a1a1a;
}

.spr-card-title a:hover {
    color: #8B6F47;
}

.spr-card-location,
.spr-card-address,
.spr-card-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0;
    font-size: 14px;
    color: #555;
}

.spr-card-location .dashicons,
.spr-card-phone .dashicons {
    color: #8B6F47;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.spr-card-phone a {
    color: inherit;
    text-decoration: none;
}

.spr-card-phone a:hover {
    color: #8B6F47;
}

.spr-card-actions {
    margin-top: 16px;
}

/* ═══════════════════════════════════════════════
 *  Single Dealer Info Table
 * ═══════════════════════════════════════════════ */
.spr-single-info {
    margin-bottom: 30px;
}

.spr-info-table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}

.spr-info-table tr {
    background: none !important;
    background-color: transparent !important;
}

.spr-info-table tr:nth-child(odd),
.spr-info-table tr:nth-child(even) {
    background: none !important;
    background-color: transparent !important;
}

.spr-info-table th,
.spr-info-table td {
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
    font-size: 15px;
    background: none !important;
    background-color: transparent !important;
    color: #333;
}

.spr-info-table th {
    width: 200px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.spr-info-table th .dashicons {
    color: #8B6F47;
    margin-right: 6px;
    vertical-align: text-top;
}

.spr-info-table td a {
    color: #8B6F47;
    text-decoration: none;
}

.spr-info-table td a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════
 *  Map
 * ═══════════════════════════════════════════════ */
.spr-map {
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 30px;
    background: #f0f0f0;
}

/* ═══════════════════════════════════════════════
 *  Pagination
 * ═══════════════════════════════════════════════ */
.spr-pagination {
    text-align: center;
    padding: 24px 0;
}

.spr-load-more {
    min-width: 200px;
}

/* ═══════════════════════════════════════════════
 *  Contact form wrapper
 * ═══════════════════════════════════════════════ */
.spr-contact-wrap {
    margin-top: 30px;
}

/* ═══════════════════════════════════════════════
 *  Notices
 * ═══════════════════════════════════════════════ */
.spr-notice {
    padding: 16px 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 0;
    color: #856404;
    font-size: 14px;
}

.spr-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════
 *  Loading state
 * ═══════════════════════════════════════════════ */
.spr-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.spr-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #e5e5e5;
    border-top-color: #8B6F47;
    border-radius: 50%;
    animation: spr-spin 0.6s linear infinite;
}

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

/* ═══════════════════════════════════════════════
 *  Single Rivenditore Page
 * ═══════════════════════════════════════════════ */

/* White content bg is handled globally by the child theme. */

/* Thumbnail */
.spr-single-thumbnail {
    margin-bottom: 30px;
}

.spr-single-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content */
.spr-single-content {
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.7;
}

/* Sections */
.spr-single-section {
    margin-bottom: 40px;
}

.spr-single-section h2 {
    font-size: 22px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #8B6F47;
}
