/*
Theme Name: FORTAN Child
Theme URI: https://fortan.md/
Author: Oleg Visan
Description: Дочерняя тема FORTAN — кастомизации без вмешательства в родительскую тему.
Template: fortan
Version: 1.0.0
Text Domain: fortan
*/

/* Унификация отступов main на контентных страницах (эталон — .page-content) */
body.archive { padding: 0 !important; }
main.pdp, main.archive, main.catalog-page { padding: 56px 0 80px !important; }

/* Страница Контакты */
main.contacts-page { padding: 56px 0 80px; }
.contacts-page__title { font-size: clamp(28px, 4vw, 44px); margin: 0 0 24px; }
.contacts-page__intro { max-width: 720px; margin: 0 0 40px; color: var(--grey); }
.contacts-page__intro h2 { color: var(--dark); font-size: clamp(20px, 2.5vw, 26px); margin: 0 0 12px; }
.contacts-page__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contacts-page__label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--grey); margin: 24px 0 6px; font-weight: 600; }
.contacts-page__label:first-child { margin-top: 0; }
.contacts-page__info p { margin: 0; }
.contacts-page__info a { color: var(--dark); text-decoration: none; }
.contacts-page__info a:hover { color: var(--red); }
.contacts-page__hours { display: flex; justify-content: space-between; max-width: 320px; gap: 16px; }
.contacts-page__form-hint { font-size: 13px; color: var(--grey); text-transform: uppercase; letter-spacing: 0.4px; margin: 0 0 12px; }
.contacts-page__form .wpcf7-form label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--dark); }
.contacts-page__form input[type=text], .contacts-page__form input[type=email], .contacts-page__form input[type=tel], .contacts-page__form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--grey-border); border-radius: 8px; font: inherit; margin-top: 4px; }
.contacts-page__form textarea { min-height: 120px; resize: vertical; }
.contacts-page__form input[type=submit] { background: var(--red); color: #fff; padding: 12px 28px; border: 0; border-radius: 999px; font-weight: 600; cursor: pointer; font-size: 15px; }
.contacts-page__form input[type=submit]:hover { opacity: 0.9; }
@media (max-width: 768px) { .contacts-page__grid { grid-template-columns: 1fr; gap: 32px; } }

.contacts-page__form { padding: 10%; background-color: #f6f6f6; border: 1px solid #e9e9e9; }
@media (max-width: 1024px) { .contacts-page__form { padding: 32px; } }
@media (max-width: 640px)  { .contacts-page__form { padding: 20px; } }

/* pdp__long inherits archive__seo + cat-faq styles */
.pdp__long { color: #4a4a4a; font-size: 16px; line-height: 1.7; margin-top: 24px; }
.pdp__long h2 { font-size: 24px; line-height: 1.3; margin: 26px 0 12px; color: #161616; }
.pdp__long h3 { font-size: 19px; line-height: 1.3; margin: 22px 0 10px; color: #161616; }
.pdp__long p { margin: 0 0 14px; }
.pdp__long ul, .pdp__long ol { margin: 0 0 14px; padding-left: 20px; }
.pdp__long li { margin-bottom: 6px; }
.pdp__long a { color: var(--red); text-decoration: underline; }
.pdp__long details { border-bottom: 1px solid #e6e6e6; padding: 18px 0; }
.pdp__long details summary { position: relative; padding-right: 34px; font-size: 17px; font-weight: 600; color: #161616; cursor: pointer; list-style: none; }
.pdp__long details summary::-webkit-details-marker { display: none; }
.pdp__long details summary::after { content: '+'; position: absolute; right: 0; top: -2px; font-size: 24px; line-height: 1; color: var(--red); }
.pdp__long details[open] summary::after { content: '\2212'; }
.pdp__long details p { padding-top: 12px; color: #555; font-size: 15px; line-height: 1.7; margin: 0 0 10px; }

/* mobile: title above gallery */
@media (max-width: 768px) {
  .pdp__top { display: flex !important; flex-direction: column; gap: 16px; }
  .pdp__info { display: contents !important; }
  .pdp__title { order: 1; margin-bottom: 4px; }
  .pdp__gallery { order: 2; }
  .pdp__price { order: 3; }
  .pdp__desc { order: 4; }
  .pdp__buy { order: 5; }
  .pdp__info .specs { order: 6; }
  .pdp__long { order: 7; }
}

/* pdp__buy inline on mobile */
@media (max-width: 768px) {
  .pdp__buy { flex-direction: row !important; align-items: center; flex-wrap: wrap; gap: 12px; }
  .pdp__buy .qty { flex: 0 0 auto; }
  .pdp__buy .pdp__add { flex: 1 1 auto; }
}

/* pdp__buy compact qty on mobile */
@media (max-width: 768px) {
  .pdp__buy { flex-wrap: nowrap !important; align-items: stretch; }
  .pdp__buy .qty { width: auto !important; flex: 0 0 130px !important; }
  .pdp__buy .pdp__add { flex: 1 1 0 !important; min-width: 0; }
}

/* pdp__add expand mobile */
@media (max-width: 768px) {
  .pdp__buy .pdp__add,
  .pdp__buy > button { flex: 1 1 auto !important; width: auto !important; justify-content: center; padding-left: 30px !important; padding-right: 30px !important; }
}

/* delivery: white button */

/* section-head: wider title column */
.section-head { gap: 60px; }
.section-head__title { flex: 0 0 33.333%; max-width: 33.333%; }
.section-head__text { flex: 1 1 auto; }
@media (max-width: 850px) {
  .section-head { gap: 24px; }
  .section-head__title, .section-head__text { flex: 1 1 100%; max-width: 100%; }
}

/* page-content: accordion FAQ */
.page-content__body details { border-top: 1px solid #e0e0e0; padding: 16px 0; }
.page-content__body details:last-of-type { border-bottom: 1px solid #e0e0e0; }
.page-content__body summary { cursor: pointer; font-weight: 600; font-size: 16px; list-style: none; padding-right: 40px; position: relative; }
.page-content__body summary::-webkit-details-marker { display: none; }
.page-content__body summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 300; line-height: 1; color: var(--red); }
.page-content__body details[open] summary::after { content: "−"; }
.page-content__body details > p { margin-top: 10px; color: #333; line-height: 1.55; }
.page-content__body h2 { margin-top: 32px; font-size: 24px; font-weight: 700; }
.page-content__body h3 { margin-top: 24px; font-size: 18px; font-weight: 600; }
.page-content__body ul, .page-content__body ol { margin: 12px 0 16px 20px; }
.page-content__body li { margin-bottom: 6px; line-height: 1.55; }

/* page-content: interactive tables */
.page-content__body .post-table-wrap {
    overflow-x: auto;
    margin: 28px 0 40px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}
.page-content__body .post-table-wrap table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    min-width: 480px;
}
.page-content__body .post-table-wrap thead th {
    background: var(--red);
    color: #fff;
    padding: 14px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.page-content__body .post-table-wrap td {
    padding: 14px 20px;
    border-top: 1px solid #eee;
    font-size: 15px;
    line-height: 1.5;
    vertical-align: top;
    background: #fff;
}
.page-content__body .post-table-wrap tbody tr:nth-child(even) td {
    background: #f8f8f8;
}
.page-content__body .post-table-wrap tbody td:first-child {
    font-weight: 600;
    color: #222;
}

/* Sticky first column on mobile */
@media (max-width: 700px) {
    .page-content__body .post-table-wrap thead th:first-child,
    .page-content__body .post-table-wrap td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        box-shadow: 4px 0 6px -2px rgba(0,0,0,0.08);
    }
    .page-content__body .post-table-wrap thead th:first-child {
        background: var(--red);
    }
    .page-content__body .post-table-wrap tbody tr:nth-child(odd) td:first-child {
        background: #fff;
    }
    .page-content__body .post-table-wrap tbody tr:nth-child(even) td:first-child {
        background: #f8f8f8;
    }
    .page-content__body .post-table-wrap th,
    .page-content__body .post-table-wrap td {
        min-width: 140px;
    }
}

/* post-single: narrow 800px centered */
.post-single .container--narrow,
.page-content--narrow .container--narrow {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: content-box;
}
@media (max-width: 840px) {
    .post-single .container--narrow,
.page-content--narrow .container--narrow {
        box-sizing: border-box;
        max-width: 100%;
    }
}

/* contacts-page: form layout */
.contacts-page__grid { align-items: start; }
.contacts-page__form .cf-row-2 > p {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
    margin: 0 0 16px;
}
.contacts-page__form .cf-row-2 > p > br { display: none; }
.contacts-page__form .cf-row-2 > p > label { margin: 0; }
@media (max-width: 640px) {
    .contacts-page__form .cf-row-2 > p { grid-template-columns: 1fr; gap: 8px; }
}

/* blog-seo block */
.blog .blog-seo {
    max-width: 900px;
    margin: 80px auto 0;
    padding-top: 40px;
    border-top: 1px solid #eee;
}
@media (max-width: 900px) {
    .blog .blog-seo { margin-top: 48px; padding-top: 24px; }
}

/* partners: unified logo height */
.partners__logo img {
    height: 70px;
    width: auto;
    max-width: 75%;
    max-height: 70px;
    object-fit: contain;
}
@media (max-width: 600px) {
    .partners__logo img { height: 50px; max-height: 50px; max-width: 80%; }
}

/* modal form: header + labels */
.fortan-modal .modal-form-header { margin-bottom: 20px; }
.fortan-modal .modal-form-title { font-size: 24px; font-weight: 800; text-transform: uppercase; margin: 0 0 8px; letter-spacing: 0.5px; }
.fortan-modal .modal-form-sub { color: #7a7a7a; font-size: 14px; margin: 0 0 8px; line-height: 1.5; }
.fortan-modal .modal-form-label { display: block; text-transform: uppercase; font-weight: 700; font-size: 12px; letter-spacing: 0.6px; color: #1a1a1a; margin: 14px 0 6px; }

/* modal form: tighten spacing */
.fortan-modal .wpcf7-form p { margin: 0 0 12px; }
.fortan-modal .wpcf7-form br { display: none; }
.fortan-modal .modal-form-label { margin: 0 0 6px !important; padding-top: 8px; }
.fortan-modal .modal-form-header { margin-bottom: 16px; }
.fortan-modal .modal-form-header + p { margin-top: 0; }
.fortan-modal .wpcf7-form input[type="text"],
.fortan-modal .wpcf7-form input[type="tel"],
.fortan-modal .wpcf7-form input[type="email"],
.fortan-modal .wpcf7-form select,
.fortan-modal .wpcf7-form textarea { margin: 0; }

/* Theme generates each track twice (for seamless marquee).
   Without animation we only need to show the first copy. */

/* partners: horizontal center */
.partners__logo picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.partners__logo img {
    display: block;
    margin: 0 auto;
}

/* contacts page form: no border-radius */
.contacts-page__form input[type="text"],
.contacts-page__form input[type="tel"],
.contacts-page__form input[type="email"],
.contacts-page__form select,
.contacts-page__form textarea,
.contacts-page__form .wpcf7-submit {
    border-radius: 0 !important;
}


/* hero slider price/CTA: proportional padding */
/* Match Delivery button proportions (padding ratio ~1:2 vs font-size). */
.hero__price { font-size: 30px; padding: 25px 50px; }
@media (max-width: 1024px) {
    .hero__price { padding: 22px 44px; }
}
@media (max-width: 600px) {
    .hero__price { padding: 16px 32px; }
}


/* hero slide link: clickable overlay */
/* Parent theme renders slide link as empty <a> without CSS — give it real size
   and let the whole slide trigger tel:. Dots and any explicit CTA stay on top. */
.hero__slide { position: relative; }
.hero__slide-link {
    position: absolute;
    inset: 0;
    z-index: 5;
    text-decoration: none;
    display: block;
}
.hero__price {
    position: relative;
    z-index: 3;
    cursor: pointer;
}
.hero__dots {
    z-index: 10; /* keep parent position: absolute */
}


/* catalog-seo block */
.catalog-seo.page-content__body { max-width: none; margin: 32px 0 0; padding-top: 32px; padding-bottom: 40px; border-top: 1px solid #eee; }
@media (max-width: 900px) {
    .catalog-seo { margin-top: 24px; padding-top: 20px; }
}


/* archive full: 4-column products grid */
.archive__main--full .products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 26px;
}
@media (max-width: 1200px) {
    .archive__main--full .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .archive__main--full .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 600px) {
    .archive__main--full .products { grid-template-columns: 1fr; }
}
