/* ============================================
   Основной CSS для сайта "Ремонт стиральных машин"
   ============================================ */

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

:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 5px;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    background: #fff;
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: #0052a3;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-large {
    padding: 15px 40px;
    font-size: 16px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Навигация */
.navbar {
    background: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.navbar-brand h1 {
    font-size: 24px;
    margin: 0;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    opacity: 0.8;
}

/* Герой-секция */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0052a3 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 48px;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Основной контент */
main {
    min-height: calc(100vh - 60px);
    flex: 1;
}

section {
    padding: 60px 0;
}

section h2 {
    font-size: 36px;
    margin-bottom: 30px;
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--secondary-color);
    font-size: 16px;
    margin-bottom: 30px;
}

/* Информационные карточки */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.info-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.info-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.info-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* Каталог машин */
.machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.machine-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.machine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.machine-image {
    width: 100%;
    height: 200px;
    background: var(--light-color);
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.machine-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.machine-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.image-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: bold;
}

.machine-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.machine-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.machine-description {
    color: var(--secondary-color);
    font-size: 14px;
    margin-bottom: 15px;
    flex-grow: 1;
}

.machine-price {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: bold;
}

/* Бейдж продавца и действия */
.seller-badge {
    display: inline-block;
    background: linear-gradient(90deg, #ffd54a, #ffc107);
    color: #2b2b2b;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.machine-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-buy {
    background: linear-gradient(90deg, #28a745, #1e7e34);
    color: #fff;
}

/* Как это работает */
.how-it-works .steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.step {
    text-align: center;
}

.step-number {
    display: inline-block;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    line-height: 60px;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.step h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.step p {
    color: var(--secondary-color);
}

/* Форма заявки */
.order-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-top: 40px;
}

.order-sidebar {
    order: 2;
}

.order-form-wrapper {
    order: 1;
}

.machine-summary {
    background: #f8f9fa;
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.summary-image {
    width: 100%;
    height: 200px;
    background: var(--light-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.summary-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.machine-summary h4 {
    font-size: 20px;
    margin-bottom: 15px;
}

.machine-summary p {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
}

/* Форма */
.admin-form,
.order-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--secondary-color);
    font-size: 12px;
}

.form-disclaimer {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 15px;
}

/* Сообщения */
.error-message,
.success-message {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

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

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    display: inline-block;
    width: 60px;
    height: 60px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    line-height: 60px;
    font-size: 32px;
    margin-bottom: 20px;
}

.success-message h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Контакты */
.contact-info {
    text-align: center;
    background: #f8f9fa;
    padding: 40px;
    border-radius: var(--radius);
}

.contact-info p {
    font-size: 18px;
    margin-bottom: 15px;
}

.contact-info a {
    font-weight: bold;
}

/* Подвал */
footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: auto;
}

footer a {
    color: #fff;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--secondary-color);
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-menu {
        gap: 15px;
    }

    .hero-content h2 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }

    section h2 {
        font-size: 28px;
    }

    .order-wrapper {
        grid-template-columns: 1fr;
    }

    .order-sidebar,
    .order-form-wrapper {
        order: initial;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .navbar-brand h1 {
        font-size: 18px;
    }

    .navbar-menu {
        flex-direction: column;
        gap: 10px;
    }

    .hero {
        padding: 50px 0;
    }

    .hero-content h2 {
        font-size: 24px;
    }

    .hero-content p {
        font-size: 14px;
    }

    .btn-large {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }

    section {
        padding: 30px 0;
    }

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

    .info-grid {
        gap: 15px;
    }

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

/* Галерея — модальное окно */
.gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1200;
    align-items: center;
    justify-content: center;
}
.gallery-modal.active { display: flex; }

#galleryClose {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    z-index: 10;
}

#galleryClose:hover {
    background: rgba(0,0,0,0.8);
}

.gallery-dialog {
    position: relative;
    width: 100%;
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    outline: none;
}

.gallery-nav {
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 12px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transition: background 0.2s;
    flex: 0 0 auto;
}

.gallery-nav:hover {
    background: rgba(0,0,0,0.7);
}

.gallery-image-container {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    margin: 0 15px;
}

.gallery-image-container img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    image-orientation: from-image;
}

.gallery-counter {
    color: #fff;
    font-size: 13px;
    text-align: center;
    position: absolute;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.8;
}

.gallery-info {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.gallery-machine-name {
    font-weight: 600;
    font-size: 18px;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.gallery-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-price {
    font-size: 20px;
    font-weight: 700;
    color: #4da6ff;
}

.gallery-phone {
    display: inline-block;
    color: #fff;
    background: rgba(77, 166, 255, 0.2);
    border: 1px solid rgba(77, 166, 255, 0.4);
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.gallery-phone:hover {
    background: rgba(77, 166, 255, 0.3);
    border-color: rgba(77, 166, 255, 0.6);
    color: #66b3ff;
}

@media (max-width: 768px) {
    .gallery-dialog {
        height: 80vh;
        gap: 10px;
    }
    .gallery-nav {
        padding: 10px 12px;
        font-size: 24px;
    }
    #galleryClose {
        padding: 6px 12px;
        font-size: 20px;
    }
    .gallery-info {
        width: 95%;
        padding: 12px 16px;
    }
    .gallery-machine-name {
        font-size: 16px;
    }
    .gallery-price {
        font-size: 18px;
    }
    .gallery-phone {
        font-size: 14px;
        padding: 6px 14px;
    }
}

@media (max-width: 600px) {
    .gallery-dialog {
        height: 75vh;
        gap: 8px;
    }
    .gallery-nav {
        padding: 8px 10px;
        font-size: 20px;
    }
    #galleryClose {
        padding: 5px 10px;
        font-size: 18px;
    }
    .gallery-info {
        width: 95%;
        padding: 10px 12px;
    }
    .gallery-machine-name {
        font-size: 14px;
        margin-bottom: 8px;
    }
    .gallery-price {
        font-size: 16px;
    }
    .gallery-phone {
        font-size: 13px;
        padding: 5px 12px;
    }
}



