/* 
 * Стили плагина "Аренда инструментов"
 * Версия: 1.0.0
 */

/* Базовые стили */
.rental-tool-item,
.rental-tools-container,
.rental-tool-specifications,
.rental-tool-request-form,
.tool-gallery-section {
    box-sizing: border-box;
}

.rental-tool-item * {
    box-sizing: inherit;
}

/* Контейнер */
.rental-tools-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Сетка инструментов */
.rental-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

/* Карточка инструмента */
.rental-tool-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #eaeaea;
}

.rental-tool-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #28a745;
}

/* Изображение */
.tool-thumbnail {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f5f5f5;
}

.tool-thumbnail-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.tool-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tool-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 167, 69, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.tool-thumbnail:hover .tool-overlay {
    background: rgba(40, 167, 69, 0.8);
}

.tool-thumbnail:hover .tool-image {
    transform: scale(1.05);
}

.view-details {
    color: white;
    padding: 10px 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.tool-thumbnail:hover .view-details {
    opacity: 1;
    transform: translateY(0);
}

/* Информация об инструменте */
.tool-info {
    padding: 25px;
}

.tool-title {
    margin: 0 0 12px 0;
    font-size: 1.3em;
    line-height: 1.4;
    font-weight: 600;
}

.tool-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tool-title a:hover {
    color: #28a745;
}

.tool-excerpt {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 0.95em;
    min-height: 48px;
}

/* Характеристики в карточке */
.tool-specs-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tool-spec {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8em;
    color: #555;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.tool-spec.type {
    background: #e7f3ff;
    border-color: #b3d7ff;
}

.tool-spec.power {
    background: #fff8e1;
    border-color: #ffe082;
}

.tool-spec.condition {
    background: #f3e5f5;
    border-color: #e1bee7;
}

.spec-icon {
    font-size: 1.1em;
}

/* Цена в карточке */
.tool-price {
    margin-bottom: 20px;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #28a745;
    text-align: center;
}

.price-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.price-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.price-amount {
    font-size: 1.5em;
    font-weight: 700;
    color: #28a745;
}

.price-period {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

/* Кнопки в карточке */
.tool-actions {
    display: flex;
    gap: 10px;
}

.tool-actions .button {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.tool-details-btn {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.tool-details-btn:hover {
    background: #e9ecef;
    border-color: #28a745;
    color: #28a745;
}

.telegram-btn {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: 2px solid #28a745;
    text-decoration: none;
}

.telegram-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.telegram-icon {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Пагинация */
.rental-tools-pagination {
    margin: 40px 0;
    text-align: center;
}

.rental-tools-pagination .page-numbers {
    display: inline-flex;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.rental-tools-pagination .page-numbers li {
    display: inline-block;
}

.rental-tools-pagination .page-numbers a,
.rental-tools-pagination .page-numbers span {
    display: inline-block;
    padding: 10px 16px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.rental-tools-pagination .page-numbers a:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.rental-tools-pagination .page-numbers .current {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

/* Нет результатов */
.rental-tools-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    color: #666;
    font-size: 1.1em;
}

/* Страница инструмента */
.rental-tool-specifications {
    margin: 50px 0;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #eaeaea;
}

.specs-title {
    margin: 0 0 30px 0;
    color: #333;
    font-size: 1.8em;
    padding-bottom: 15px;
    border-bottom: 2px solid #28a745;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* Таблица характеристик */
.specs-details {
    padding-right: 20px;
}

.specs-details h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3em;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.specs-table tr {
    border-bottom: 1px solid #e9ecef;
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table th,
.specs-table td {
    padding: 15px 20px;
    text-align: left;
}

.specs-table th {
    width: 40%;
    font-weight: 600;
    color: #555;
    background: #f1f3f4;
    border-right: 1px solid #e9ecef;
}

.specs-table td {
    color: #333;
    font-weight: 500;
}

/* Блок с ценой на странице */
.specs-price {
    display: flex;
    align-items: flex-start;
}

.price-card {
    width: 100%;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #28a745;
    box-shadow: 0 6px 20px rgba(40,167,69,0.1);
}

.price-card h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3em;
    text-align: center;
}

.price-main {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.price-label-large {
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
    margin-bottom: 5px;
}

.price-amount-large {
    font-size: 2.2em;
    font-weight: 700;
    color: #28a745;
    line-height: 1.2;
}

.price-period-large {
    font-size: 1em;
    color: #666;
    font-weight: 500;
    margin-top: 5px;
}

/* Форма заявки */
.rental-tool-request-form {
    margin: 40px 0;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #eaeaea;
}

.rental-tool-request-form h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
}

.request-for-tool {
    background: #f0fff0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #28a745;
}

.request-for-tool p {
    margin: 0;
    color: #333;
    font-size: 1.1em;
}

.request-for-tool strong {
    color: #28a745;
}

/* Элементы формы */
.rental-tool-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.form-label:after {
    content: ' *';
    color: #dc3545;
    opacity: 0.8;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #28a745;
    background: white;
    box-shadow: 0 0 0 3px rgba(40,167,69,0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Кнопка отправки формы */
.form-submit {
    margin-top: 30px;
}

.submit-request-btn {
    width: 100%;
    padding: 16px 30px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-request-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.3);
}

.submit-request-btn:active {
    transform: translateY(0);
}

/* Сообщения формы */
.form-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Альтернатива - Telegram */
.contact-alternative {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px dashed #eaeaea;
    text-align: center;
}

.alternative-title {
    margin-bottom: 20px;
}

.alternative-title span {
    font-size: 1.1em;
    color: #555;
    font-weight: 600;
    display: inline-block;
    padding: 0 15px;
    background: white;
    position: relative;
    top: -15px;
}

.telegram-alternative-btn {
    display: inline-block;
    padding: 14px 30px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1em;
    border: 2px solid #28a745;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.telegram-alternative-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40,167,69,0.3);
}

.telegram-info {
    margin-top: 10px;
}

.telegram-info p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

/* Уведомление формы */
.form-notice {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eaeaea;
    font-size: 0.85em;
    color: #666;
    line-height: 1.5;
}

/* Галерея */
.tool-gallery-section {
    margin: 30px 0 40px 0;
    position: relative;
}

.triple-gallery-thumbs {
    width: 100%;
    margin: 30px 0;
}

.triple-thumbs-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.triple-gallery-thumb {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.triple-gallery-thumb:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-color: #28a745;
}

.triple-gallery-thumb:hover .thumb-overlay {
    background: rgba(0,0,0,0.4);
}

.triple-gallery-thumb .thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.triple-gallery-thumb .zoom-icon {
    color: white;
    font-size: 24px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.triple-gallery-thumb:hover .zoom-icon {
    opacity: 1;
    transform: scale(1);
}

.more-images-count {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
    transition: all 0.3s ease;
}

.more-images-count:hover {
    background: linear-gradient(135deg, #e0e0e0 0%, #ccc 100%);
    border-color: #28a745;
    transform: translateY(-5px);
}

.more-images-count span {
    font-size: 2em;
    font-weight: 700;
    color: #28a745;
    background: rgba(255,255,255,0.9);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(40,167,69,0.2);
}

.triple-gallery-thumb.active {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40,167,69,0.3);
}

.triple-gallery-thumb.active .thumb-overlay {
    background: rgba(40,167,69,0.3);
}

/* Модальное окно галереи */
.tool-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tool-gallery-modal.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(5px);
    z-index: 1;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 2;
    background: transparent;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 15px 20px;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
}

.modal-close:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.2);
}

.close-icon {
    font-size: 28px;
    line-height: 1;
}

.image-counter {
    color: white;
    font-size: 16px;
    font-weight: 500;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 4px;
}

.current-index {
    color: #28a745;
    font-weight: 700;
}

.total-count {
    color: #999;
}

.modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
    position: relative;
}

.modal-image-container {
    width: 100%;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-full-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 4;
}

.modal-prev,
.modal-next {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Адаптивность */
@media (min-width: 992px) {
    .specs-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .rental-tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .rental-tool-specifications,
    .rental-tool-request-form {
        padding: 25px;
    }
    
    .tool-actions {
        flex-direction: column;
    }
    
    .specs-table th,
    .specs-table td {
        padding: 12px 15px;
        font-size: 0.95em;
    }
    
    .price-amount-large {
        font-size: 1.8em;
    }
    
    .telegram-alternative-btn {
        padding: 12px 25px;
        font-size: 1em;
    }
    
    .triple-thumbs-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .triple-gallery-thumb,
    .more-images-count {
        height: 200px;
    }
    
    .modal-header {
        padding: 10px 15px;
    }
    
    .modal-close {
        font-size: 24px;
        width: 36px;
        height: 36px;
    }
    
    .close-icon {
        font-size: 22px;
    }
    
    .modal-body {
        padding: 50px 10px 10px;
    }
    
    .modal-prev,
    .modal-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .rental-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .triple-thumbs-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .triple-gallery-thumb,
    .more-images-count {
        height: 180px;
    }
    
    .more-images-count span {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .rental-tool-specifications,
    .rental-tool-request-form {
        padding: 20px;
    }
    
    .tool-thumbnail {
        height: 200px;
    }
    
    .tool-info {
        padding: 20px;
    }
    
    .specs-title {
        font-size: 1.5em;
    }
    
    .price-card {
        padding: 20px;
    }
    
    .alternative-title span {
        font-size: 1em;
        top: -12px;
    }
}