/* ════════════════════════════════════════════════════════════════
   АГРООФИС — WooCommerce дополнительные стили
════════════════════════════════════════════════════════════════ */

/* ─── Скрываем ненужные стандартные элементы WC ──────────────── */
.woocommerce-result-count,
.woocommerce-ordering,
.woocommerce .woocommerce-breadcrumb + div,
.woocommerce-notices-wrapper:empty { display: none; }

/* ─── WC LOOP ────────────────────────────────────────────────── */
.wc-main-wrapper {
    padding: 60px 0 80px;
}
.woocommerce ul.products { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.woocommerce ul.products li.product { margin: 0; float: none; }

/* ─── WC SINGLE ──────────────────────────────────────────────── */
.woocommerce div.product .woocommerce-tabs ul.tabs { border: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { background: none; border: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs::before { border: none; }
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background: var(--accent-primary) !important;
    color: #fff !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    padding: 12px 28px !important;
    font-size: 15px !important;
    transition: all 0.3s ease !important;
}
.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
    background: var(--accent-green) !important;
    transform: translateY(-2px) !important;
}

/* ─── Уведомления WC ─────────────────────────────────────────── */
.woocommerce-message {
    border-top-color: var(--accent-primary) !important;
}
.woocommerce-info { border-top-color: var(--accent-blue) !important; }
.woocommerce-error { border-top-color: #e74c3c !important; }

/* ─── Цена ───────────────────────────────────────────────────── */
.woocommerce .price,
.woocommerce-Price-amount.amount { color: var(--accent-primary) !important; }

/* ─── Рейтинг ────────────────────────────────────────────────── */
.woocommerce .star-rating span { color: var(--accent-primary) !important; }

/* ─── Корзина ───────────────────────────────────────────────── */
.woocommerce table.shop_table { border-radius: 12px; overflow: hidden; }
.woocommerce table.shop_table th { background: var(--dark-bg); color: #fff; }

/* ─── Форма оформления заказа ────────────────────────────────── */
.woocommerce form .form-row label { font-weight: 600; }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea {
    border-radius: 8px !important;
    border: 2px solid var(--border-color) !important;
    padding: 12px 16px !important;
    transition: border-color 0.3s ease !important;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus { border-color: var(--accent-primary) !important; outline: none !important; }

/* ─── Breadcrumb WC ──────────────────────────────────────────── */
.woocommerce-breadcrumb {
    font-size: 13px;
    color: #666;
}
.woocommerce-breadcrumb a { color: var(--accent-primary); }

/* ═══ Характеристики, FAQ и брендовый placeholder (карточка товара) ═══ */
.block-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 2.5rem 0 1rem;
}
.block-title i { color: var(--accent-primary); }

/* Таблица характеристик */
.single-product-specs { margin-top: 1rem; }
.specs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
}
.specs-table th,
.specs-table td {
    padding: .75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #eee);
    font-size: .98rem;
}
.specs-table tr:last-child th,
.specs-table tr:last-child td { border-bottom: 0; }
.specs-table th {
    width: 42%;
    color: var(--text-muted, #666);
    font-weight: 600;
    background: rgba(0,0,0,.02);
}
.specs-table td { color: var(--text-color, #1a1a1a); font-weight: 600; }

/* FAQ */
.single-product-faq { margin-top: 1rem; }
.faq-item {
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: var(--radius-sm, 6px);
    margin-bottom: .6rem;
    background: var(--card-bg, #fff);
}
.faq-item__q {
    cursor: pointer;
    padding: .9rem 1.1rem;
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-right: 2.5rem;
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q::after {
    content: '+';
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--accent-primary);
    transition: transform var(--transition, .2s);
}
.faq-item[open] .faq-item__q::after { content: '–'; }
.faq-item__a {
    padding: 0 1.1rem 1rem;
    color: var(--text-muted, #555);
    line-height: 1.6;
}

/* Брендовый placeholder вместо фото */
.product-gallery--placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    min-height: 320px;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(0,0,0,.02), rgba(0,0,0,.05));
    border: 1px dashed var(--border-color, #d5d5d5);
    border-radius: var(--radius-md, 8px);
}
.product-gallery--placeholder .ph-logo { width: 180px; height: auto; opacity: .85; }
.product-gallery--placeholder .ph-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #1a1a1a;
    max-width: 90%;
}
.product-gallery--placeholder .ph-cat {
    font-size: .9rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: .35rem;
}
.product-gallery--placeholder .ph-note { font-size: .82rem; color: var(--text-muted, #888); }

/* Placeholder в карточке каталога (сетка) */
.product-card__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    aspect-ratio: 4/3;
    padding: 1.2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(0,0,0,.02), rgba(0,0,0,.05));
    border-radius: var(--radius-md, 8px);
}
.product-card__placeholder .ph-logo { width: 100px; height: auto; opacity: .8; }
.product-card__placeholder .ph-name {
    font-family: var(--font-heading);
    font-size: .85rem;
    color: #1a1a1a;
    max-width: 95%;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card__placeholder .ph-cat {
    font-size: .75rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: .25rem;
}
.product-card__placeholder .ph-note { font-size: .7rem; color: var(--text-muted, #888); }

/* ═══ Модальная форма обратной связи ═══ */
.af-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.af-modal-overlay.is-open { opacity: 1; visibility: visible; }

.af-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,.25);
    transform: translateY(20px) scale(.97);
    transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.af-modal-overlay.is-open .af-modal { transform: translateY(0) scale(1); }

.af-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    transition: color .2s;
}
.af-modal__close:hover { color: #333; }

.af-modal__header { text-align: center; margin-bottom: 20px; }
.af-modal__title { font-size: 1.3rem; font-weight: 700; color: #1a1a1a; display: flex; align-items: center; justify-content: center; gap: 8px; }
.af-modal__title i { color: var(--accent-primary); }
.af-modal__subtitle { color: #888; font-size: .85rem; margin-top: 6px; }

.af-form__product-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(44,183,66,.07);
    border: 1px solid rgba(44,183,66,.2);
    border-radius: 8px;
    font-size: .85rem;
    color: #1a1a1a;
    margin-bottom: 16px;
}
.af-form__product-tag i { color: var(--accent-primary); flex-shrink: 0; }

.af-form__field { margin-bottom: 14px; }
.af-form__field label { display: block; font-size: .82rem; font-weight: 600; color: #555; margin-bottom: 5px; }
.af-optional { font-weight: 400; color: #aaa; }
.af-form__field input,
.af-form__field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .2s;
    background: #fafafa;
}
.af-form__field input:focus,
.af-form__field textarea:focus { border-color: var(--accent-primary); outline: none; background: #fff; }

.af-form__submit { width: 100%; margin-top: 8px; }

@keyframes af-spin { to { transform: rotate(360deg); } }
.af-spin { animation: af-spin .8s linear infinite; display: inline-block; }

.af-modal__success { text-align: center; padding: 24px 0; }
.af-success__icon { font-size: 48px; color: var(--accent-primary); margin-bottom: 12px; }
.af-modal__success h3 { font-size: 1.2rem; color: #1a1a1a; margin-bottom: 8px; }
.af-modal__success p { color: #888; }

.af-modal__error { padding: 10px 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; color: #dc2626; font-size: .85rem; margin-top: 8px; }
.af-modal__error i { margin-right: 4px; }

/* ═══ Встроенная форма заявки (на главных страницах) ═══ */
.inline-contact-form {
    max-width: 680px;
    margin: 2.5rem auto 0;
    padding: 32px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.inline-contact-form__header { text-align: center; margin-bottom: 20px; }
.inline-contact-form__header .block-title { justify-content: center; margin-top: 0; }
.inline-contact-form__subtitle { color: var(--text-muted, #888); font-size: .88rem; margin-top: 4px; }

.af-form--inline__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.af-form__field--wide { grid-column: 1 / -1; }
.af-form--inline .af-form__submit { width: 100%; margin-top: 16px; }

.af-inline-success { text-align: center; padding: 32px 0; }
.af-inline-success .af-success__icon { font-size: 48px; color: var(--accent-primary); margin-bottom: 12px; }
.af-inline-success h3 { font-size: 1.2rem; color: #1a1a1a; margin-bottom: 8px; }
.af-inline-success p { color: #888; }

@media (max-width: 600px) {
    .af-form--inline__fields { grid-template-columns: 1fr; }
    .inline-contact-form { padding: 20px; }
}
