/**
 * Custom Category Templates — Özel Kategori Şablon Stilleri
 *
 * Yalnızca is_product_category() true olduğunda yüklenir.
 *
 * @package Electro
 * @subpackage CustomCategoryTemplates
 */

/* Kategori başlık alanı */
.cct-category-header {
    margin-bottom: 1.5em;
}

.cct-category-header .page-title {
    margin-bottom: 0.25em;
}

/* Alt başlık — turuncu kenarlıklı badge/tag */
.cct-subtitle {
    display: inline-block;
    font-size: 14px;
    color: #333;
    border: 1px solid #f89a1f;
    border-radius: 20px;
    padding: 6px 16px;
    margin: 10px 0 0 0;
    background: transparent;
    line-height: 1.4;
}

/* Alt başlık altındaki turuncu çizgi */
.cct-subtitle-separator {
    border-top: 2px solid #f89a1f;
    margin: 15px 0 20px 0;
}

/* Bölümler arası turuncu ayırıcı */
.cct-section-separator {
    border-top: 2px solid #f89a1f;
    margin: 2em 0;
}

/* Bölüm üst görseli — navigasyon kartları */
.cct-nav-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 2em;
}

.cct-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 12px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 90px;
    text-align: center;
}

.cct-nav-card:hover {
    border-color: #f89a1f;
    box-shadow: 0 2px 8px rgba(248, 154, 31, 0.15);
}

.cct-nav-card img {
    max-width: 60px;
    max-height: 60px;
    height: auto;
    margin-bottom: 6px;
}

.cct-nav-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.cct-nav-card:hover .cct-nav-label {
    color: #f89a1f;
}

/* Bölüm anchor — scroll offset için */
.cct-section-anchor {
    scroll-margin-top: 80px;
}

/* Güç navigasyon butonları (servo) */
.cct-power-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5em;
}

.cct-power-btn {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #f89a1f;
    border: 1px solid #f89a1f;
    border-radius: 20px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.cct-power-btn:hover {
    background-color: #f89a1f;
    color: #fff;
}

/* Devamını Gör butonu — dolu */
.cct-power-more {
    display: none;
    background-color: #f89a1f;
    color: #fff;
    border-color: #f89a1f;
    cursor: pointer;
}

.cct-power-more:hover {
    background-color: #e55b00;
    border-color: #e55b00;
}

@media (max-width: 767px) {
    .cct-power-nav {
        gap: 6px;
        position: relative;
    }

    .cct-power-btn {
        padding: 5px 12px;
        font-size: 12px;
    }

    /* Gizlenecek butonlar — JS ile .cct-power-hidden class'ı eklenir */
    .cct-power-nav:not(.cct-power-expanded) .cct-power-hidden {
        display: none;
    }

    .cct-power-more {
        display: inline-block;
    }

    .cct-power-expanded .cct-power-more {
        display: none;
    }
}

/* SEO anchor — menü linkleri için */
.cct-seo-anchor {
    display: block;
    position: relative;
    top: -80px;
    visibility: hidden;
    height: 0;
}

@media (max-width: 767px) {
    .cct-nav-cards {
        gap: 10px;
    }

    .cct-nav-card {
        padding: 8px 10px;
        min-width: 70px;
    }

    .cct-nav-card img {
        max-width: 45px;
        max-height: 45px;
    }

    .cct-nav-label {
        font-size: 11px;
    }
}

/* ===== SEO İçerik Alanı ===== */
.cct-seo-content {
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #ebebeb;
    line-height: 1.6;
}

/* Devamını Oku butonu — turuncu kenarlıklı badge */
.cct-read-more-btn {
    display: inline-block;
    background: transparent;
    border: 1px solid #f89a1f;
    border-radius: 20px;
    color: #f89a1f;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 18px;
    margin-top: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cct-read-more-btn:hover {
    background-color: #f89a1f;
    color: #fff;
}

/* Sidebar olmadığında tam genişlik */
#primary.content-area.cct-full-width {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
}

/* ===== Özel Ürün Kartı ===== */

/* Grid düzeni — 5 sütun */
.cct-product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

/* Ürün kartı */
.cct-product-card {
    list-style: none;
    padding: 15px;
    border: 1px solid #ebebeb;
    border-radius: 4px;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.cct-product-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cct-product-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ürün başlığı — üstte, ortalı */
.cct-product-title {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0 0 10px 0;
    min-height: 36px;
    text-align: center;
}

.cct-product-title a {
    color: #333;
    text-decoration: none;
}

.cct-product-title a:hover {
    color: #f89a1f;
}

/* Ürün görseli */
.cct-product-image {
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.cct-product-image img {
    max-width: 100%;
    height: auto;
}

/* Fiyat — ortalı */
.cct-product-price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.cct-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 13px;
}

.cct-product-price ins {
    text-decoration: none;
}

/* Sepete Ekle butonu */
.cct-product-action {
    text-align: center;
}

.cct-product-action .cct-btn-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #f89a1f;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
    min-height: 32px;
    position: relative;
}
.cct-product-action .cct-btn-cart:hover {
    background-color: #e55b00;
    color: #fff;
}

/* Spinner — gizli, loading'de görünür */
.cct-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cct-spin 0.6s linear infinite;
}

/* Check icon — gizli, added'da görünür */
.cct-btn-check {
    display: none;
    width: 16px;
    height: 16px;
}

/* WooCommerce AJAX loading state */
.cct-btn-cart.loading .cct-btn-text {
    visibility: hidden;
}

.cct-btn-cart.loading .cct-btn-spinner {
    display: inline-block;
    position: absolute;
}

/* WooCommerce AJAX added state */
.cct-btn-cart.added .cct-btn-spinner {
    display: none;
}

.cct-btn-cart.added .cct-btn-text {
    visibility: hidden;
}

.cct-btn-cart.added .cct-btn-check {
    display: inline-block;
    position: absolute;
}

.cct-btn-cart.added {
    background-color: #4caf50;
    pointer-events: none;
}

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

.cct-product-action .cct-btn-outofstock {
    background-color: #999;
}

.cct-product-action .cct-btn-outofstock:hover {
    background-color: #777;
}

/* ===== Servo Info Panel ===== */
.cct-servo-card .cct-product-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.cct-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.cct-info-btn:hover,
.cct-info-btn[aria-expanded="true"] {
    color: #f89a1f;
    border-color: #f89a1f;
}

.cct-info-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 12px;
    z-index: 10;
}

.cct-info-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fff;
}

.cct-info-popover::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #e2e2e2;
}

.cct-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.cct-info-table th,
.cct-info-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.cct-info-table th {
    color: #666;
    font-weight: 500;
    width: 40%;
}

.cct-info-table td {
    color: #333;
}

.cct-info-table tr:last-child th,
.cct-info-table tr:last-child td {
    border-bottom: none;
}

/* "Sepetim" / "View Cart" linkini gizle */
.cct-product-card .added_to_cart {
    display: none !important;
}

/* WooCommerce BlockUI overlay'ini bizim kartlarda gizle */
.cct-product-card .blockUI,
.cct-product-card .blockOverlay,
.cct-product-card .blockMsg,
.cct-product-card .loader,
.cct-product-grid .blockUI,
.cct-product-grid .blockOverlay,
.cct-product-grid .blockMsg,
.cct-product-grid .loader,
.cct-product-action .blockUI,
.cct-product-action .blockOverlay,
.cct-product-action .blockMsg {
    display: none !important;
}

/* Responsive */
@media (max-width: 1199px) {
    .cct-product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .cct-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .cct-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 479px) {
    .cct-product-grid {
        gap: 8px;
    }
}

/* ===== SSS (FAQ) Akordiyon ===== */
.cct-faq-section {
    margin: 2.5em 0 0;
    border-radius: 16px;
}

.cct-faq-title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin: 0 0 20px;
}

.cct-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cct-faq-item {
    border-radius: 12px;
    overflow: hidden;
}

.cct-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    text-align: left;
    line-height: 1.45;
}

.cct-faq-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #222;
    transition: transform 0.3s ease, color 0.2s ease;
}

.cct-faq-question[aria-expanded="true"] .cct-faq-icon {
    color: #f89a1f;
    transform: rotate(45deg);
}

.cct-faq-answer {
    overflow: hidden;
}

.cct-faq-answer[hidden] {
    display: none;
}

.cct-faq-answer:not([hidden]) {
    padding: 20px;
}

.cct-faq-answer p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

@media (max-width: 767px) {
    .cct-faq-section {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .cct-faq-list {
        gap: 8px;
    }

    .cct-faq-question {
        padding: 16px 18px;
        font-size: 14px;
    }

    .cct-faq-answer:not([hidden]) {
        padding: 16px;
    }
}

/* ===== Özel Sidebar ===== */
.cct-sidebar {
    flex: 0 0 25%;
    max-width: 25%;
    padding-left: 30px;
}

.cct-sidebar-widget {
    border: 1px solid #ebebeb;
    border-radius: 4px;
    padding: 20px;
}

.cct-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f89a1f;
}

.cct-sidebar-categories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cct-sidebar-categories li {
    border-bottom: 1px solid #f5f5f5;
}

.cct-sidebar-categories li:last-child {
    border-bottom: none;
}

.cct-sidebar-categories a {
    display: block;
    padding: 8px 0;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cct-sidebar-categories a:hover {
    color: #f89a1f;
}

.cct-sidebar-current a {
    color: #f89a1f;
    font-weight: 600;
}

/* Sidebar varken primary genişliği */
#primary.content-area:not(.cct-full-width) {
    flex: 0 0 75%;
    max-width: 75%;
}

@media (max-width: 991px) {
    .site-content-inner.row {
        flex-wrap: wrap;
    }

    .cct-sidebar {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 0;
        margin-top: 2em;
        order: 99;
    }

    #primary.content-area:not(.cct-full-width) {
        flex: 0 0 100%;
        max-width: 100%;
        order: 1;
    }
}
