/* ==========================================================================
   Katalog Fiyat Tablosu - Frontend Styles
   ========================================================================== */

.kft-price-module {
    margin: 20px 0;
    font-family: inherit;
}

/* ==========================================================================
   Sidebar yakınlaştırma: Sol kategori listesini ürünlere yakınlaştır
   ========================================================================== */

/* WooCommerce sidebar'ı ürünlere yakınlaştır - margin-right'i azalt */
.woocommerce-page .widget-area,
.woocommerce-page .sidebar,
.woocommerce-page .woocommerce-sidebar,
.woocommerce-page aside.widget-area,
.woocommerce-page .secondary,
.woocommerce-page #secondary {
    margin-right: 15px !important;
    padding-right: 0 !important;
}

/* Sidebar genişliğini optimize et (gerekirse) */
.woocommerce-page .widget-area,
.woocommerce-page .sidebar {
    max-width: 280px !important;
    flex-shrink: 0;
}

/* Ürün grid'i yerinden oynatmadan, sadece sidebar'ı yakınlaştır */
.woocommerce-page .content-area,
.woocommerce-page .site-main,
.woocommerce-page .products-wrapper,
.woocommerce-page #primary,
.woocommerce-page .main-content {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Flexbox layout varsa (modern temalar) */
.woocommerce-page .site-content,
.woocommerce-page .content-wrapper,
.woocommerce-page .container > .row {
    gap: 15px !important;
}

/* Responsive: mobilde sidebar'ı normal konumuna döndür */
@media (max-width: 768px) {
    .woocommerce-page .widget-area,
    .woocommerce-page .sidebar,
    .woocommerce-page .woocommerce-sidebar {
        margin-right: 0 !important;
        margin-bottom: 20px !important;
        max-width: 100% !important;
    }
    
    .woocommerce-page .site-content,
    .woocommerce-page .content-wrapper {
        gap: 0 !important;
    }
}

/* ---------- Card Layout (Modern Tasarım) ---------- */

.kft-price-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
    overflow: hidden;
    max-width: 100%;
    margin: 0 auto;
}

/* ---------- Category Label ---------- */

.kft-category-label {
    display: inline-block;
    padding: 6px 16px;
    background: #2d7a7a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    margin: 16px 16px 12px;
}

/* ---------- Progress Bar ---------- */

.kft-progress-bar {
    width: 100%;
    height: 4px;
    background: #a8d5d5;
    position: relative;
    margin-bottom: 16px;
}

.kft-progress-fill {
    height: 100%;
    background: #2d7a7a;
    transition: width 0.3s ease;
}

/* ---------- Product Image ---------- */

.kft-product-image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
    padding: 0 16px;
}

.kft-product-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}

.kft-image-overlay {
    position: absolute;
    bottom: 8px;
    left: 24px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
}

/* ---------- Product Info ---------- */

.kft-product-info {
    padding: 0 16px 16px;
}

.kft-product-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.3;
}

.kft-product-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ---------- Price Options Grid ---------- */

.kft-price-card-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 16px 16px;
}

.kft-price-card-footer {
    padding: 0 16px 20px;
    text-align: center;
}

/* ---------- Seçenek Butonları (Adet | Fiyat) ---------- */

.kft-price-card .kft-price-row {
    display: flex;
}

.kft-price-card .kft-price-row.kft-hidden {
    display: none;
}

.kft-price-card .kft-price-row.kft-visible {
    display: flex;
}

.kft-option-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 24px;
    border: 1.5px solid #3498db;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: inherit;
    overflow: hidden;
}

.kft-option-btn:hover {
    border-color: #2980b9;
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.15);
}

.kft-option-btn.kft-selected {
    border-color: #ff6a2a;
    background: #ff6a2a;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 106, 42, 0.3);
}

.kft-option-btn.kft-added,
.kft-option-btn.kft-loading {
    border-color: #ff6a2a;
    background: #ff6a2a;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 106, 42, 0.3);
}

.kft-option-btn.kft-added:hover,
.kft-option-btn.kft-loading:hover {
    background: #f25a18;
    border-color: #f25a18;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 106, 42, 0.4);
}

.kft-option-quantity {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.kft-option-btn.kft-selected .kft-option-quantity,
.kft-option-btn.kft-added .kft-option-quantity,
.kft-option-btn.kft-loading .kft-option-quantity {
    color: #ffffff;
}

.kft-option-price {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.kft-option-btn.kft-selected .kft-option-price,
.kft-option-btn.kft-added .kft-option-price,
.kft-option-btn.kft-loading .kft-option-price {
    color: #ffffff;
}

.kft-option-separator {
    margin: 0 6px;
    color: #2c3e50;
    font-weight: 400;
}

.kft-option-btn.kft-selected .kft-option-separator,
.kft-option-btn.kft-added .kft-option-separator,
.kft-option-btn.kft-loading .kft-option-separator {
    color: #ffffff;
}

.kft-option-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    flex-wrap: wrap;          /* Uzun metinler için satır kaydır */
    text-align: center;
    white-space: normal;      /* Tek satırda sıkışmasın */
}

.kft-option-shipping {
    margin-top: 4px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
}

.kft-option-btn.kft-added .kft-option-shipping,
.kft-option-btn.kft-loading .kft-option-shipping {
    color: rgba(255, 255, 255, 0.9);
}

/* ---------- Quote Button (Teklif Al) ---------- */

.kft-quote-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: #ff6a2a;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 106, 42, 0.3);
}

.kft-quote-btn:hover {
    background: #f25a18;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 106, 42, 0.4);
}

.kft-quote-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 106, 42, 0.3);
}

/* ---------- Eski tablo yapısı için genel stiller (gerekirse) ---------- */

.kft-price-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.kft-price-table thead th {
    background: #f7f7f7;
    padding: 14px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.kft-price-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.15s ease;
}

.kft-price-table tbody tr:last-child {
    border-bottom: none;
}

.kft-price-table tbody tr:hover {
    background: #fafafa;
}

.kft-price-table td {
    padding: 12px 16px;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
}

/* Column widths */
.kft-col-adet {
    width: 20%;
    font-weight: 600;
    color: #222;
}

.kft-col-fiyat {
    width: 35%;
    color: #444;
}

.kft-col-sepet {
    width: 45%;
}

/* ---------- Hidden rows ---------- */

.kft-price-row.kft-hidden {
    display: none;
}

.kft-price-row.kft-visible {
    display: table-row;
}

/* ---------- Add to Cart Button ---------- */

.kft-add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #f39c12;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    line-height: 1;
    white-space: nowrap;
}

.kft-add-to-cart-btn:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

.kft-add-to-cart-btn:active {
    transform: translateY(0);
}

.kft-add-to-cart-btn.kft-loading {
    opacity: 0.7;
    pointer-events: none;
}

.kft-add-to-cart-btn.kft-added {
    background: #27ae60;
}

/* Kart tasarımı içindeki add-to-cart butonları için override */
.kft-price-card .kft-add-to-cart-btn {
    background: transparent !important;
    border-radius: 24px !important;
    border: 1.5px solid #3498db !important;
    padding: 10px 16px !important;
    box-shadow: none !important;
    color: inherit !important;
    width: 100% !important;
    min-height: 48px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
}

.kft-price-card .kft-add-to-cart-btn:hover,
.kft-price-card .kft-add-to-cart-btn:active {
    background: #f8f9fa !important;
    border-color: #2980b9 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.15) !important;
}

.kft-price-card .kft-add-to-cart-btn.kft-selected,
.kft-price-card .kft-add-to-cart-btn.kft-added,
.kft-price-card .kft-add-to-cart-btn.kft-loading {
    background: #ff6a2a !important;
    border-color: #ff6a2a !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(255, 106, 42, 0.3) !important;
}

.kft-cart-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ---------- Show More Button ---------- */

.kft-show-more-wrap {
    text-align: center;
    padding: 12px 0 0;
    margin-top: 8px;
}

.kft-show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    background: transparent;
    color: #6b7280;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: underline;
}

.kft-show-more-btn:hover {
    color: #2c3e50;
    text-decoration: none;
}

.kft-arrow {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.kft-show-more-btn.kft-expanded .kft-arrow {
    transform: rotate(90deg);
}

/* ---------- View Cart Link ---------- */

.kft-view-cart-link {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: #f39c12;
    text-decoration: underline;
}

/* ==========================================================================
   Mobile Responsive - Card Layout
   ========================================================================== */

@media (max-width: 600px) {

    .kft-price-table thead {
        display: none;
    }

    .kft-price-table,
    .kft-price-table tbody,
    .kft-price-table tr,
    .kft-price-table td {
        display: block;
        width: 100%;
    }

    .kft-price-table tbody tr {
        margin-bottom: 12px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 12px 16px;
        background: #fff;
    }

    .kft-price-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .kft-price-table td {
        padding: 6px 0;
        text-align: left;
        border: none;
    }

    .kft-price-table td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #333;
        display: inline;
    }

    .kft-col-sepet {
        text-align: center;
        padding-top: 10px !important;
    }

    .kft-col-sepet::before {
        display: none !important;
    }

    .kft-add-to-cart-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
    }

    .kft-price-row.kft-hidden {
        display: none;
    }

    .kft-price-row.kft-visible {
        display: block;
    }

    .kft-show-more-wrap {
        border: none;
        background: transparent;
    }
}
/* Responsive adjustments */
@media (min-width: 768px) {
    .kft-price-card {
        max-width: 380px;
    }
    
    .kft-price-card-options {
        gap: 10px;
    }
}

/* ==========================================================================
   Single product: smaller card
   ========================================================================== */
.single-product .kft-price-card {
    max-width: 340px;
    border-radius: 16px;
}

.single-product .kft-category-label {
    padding: 4px 10px;
    font-size: 10px;
    margin: 10px 10px 8px;
    border-radius: 14px;
}

.single-product .kft-progress-bar {
    height: 3px;
    margin-bottom: 10px;
}

.single-product .kft-product-image-wrapper {
    padding: 0 10px;
    margin-bottom: 10px;
}

.single-product .kft-product-info {
    padding: 0 10px 10px;
}

.single-product .kft-product-title {
    font-size: 16px;
    margin: 0 0 4px;
}

.single-product .kft-product-description {
    font-size: 12px;
}

.single-product .kft-price-card-options {
    gap: 6px;
    padding: 0 10px 10px;
}

.single-product .kft-option-btn {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 18px;
}

.single-product .kft-price-card-footer {
    padding: 0 10px 12px;
}

.single-product .kft-quote-btn {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 10px;
}

/* ==========================================================================
   Loop / category: compact card (kft-loop-card) – smaller
   ========================================================================== */
.kft-loop-card,
.kft-loop-item-inner .kft-loop-card {
    margin: 0;
    height: 100%;
}

.kft-loop-card .kft-price-card,
.kft-loop-item-inner .kft-price-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    padding: 0;
    max-width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.kft-loop-card .kft-category-label,
.kft-loop-item-inner .kft-category-label {
    padding: 3px 8px;
    font-size: 9px;
    margin: 6px 6px 4px;
    border-radius: 10px;
}

.kft-loop-card .kft-progress-bar,
.kft-loop-item-inner .kft-progress-bar {
    height: 2px;
    margin-bottom: 6px;
}

.kft-loop-card .kft-product-image-wrapper,
.kft-loop-item-inner .kft-product-image-wrapper {
    padding: 0 6px;
    margin-bottom: 6px;
}

.kft-loop-card .kft-product-image,
.kft-loop-item-inner .kft-product-image {
    border-radius: 8px;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.kft-loop-card .kft-image-overlay,
.kft-loop-item-inner .kft-image-overlay {
    bottom: 4px;
    left: 12px;
    padding: 3px 6px;
    font-size: 9px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.kft-loop-card .kft-image-overlay-title,
.kft-loop-item-inner .kft-image-overlay-title {
    font-weight: 600;
    font-size: 10px;
}

.kft-loop-card .kft-demo-label,
.kft-loop-item-inner .kft-demo-label {
    font-size: 8px;
    opacity: 0.9;
}

.kft-loop-card .kft-product-info,
.kft-loop-item-inner .kft-product-info {
    padding: 0 6px 6px;
}

.kft-loop-card .kft-product-title,
.kft-loop-item-inner .kft-product-title {
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 2px;
}

.kft-loop-card .kft-product-title a,
.kft-loop-item-inner .kft-product-title a {
    color: inherit;
    text-decoration: none;
}

.kft-loop-card .kft-product-title a:hover,
.kft-loop-item-inner .kft-product-title a:hover {
    color: #2d7a7a;
}

.kft-loop-card .kft-product-description,
.kft-loop-item-inner .kft-product-description {
    font-size: 11px;
    margin: 0;
    line-height: 1.35;
}

.kft-loop-card .kft-price-card-options,
.kft-loop-item-inner .kft-price-card-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 0 6px 6px;
}

.kft-loop-card .kft-option-btn,
.kft-loop-item-inner .kft-option-btn {
    min-height: 32px;
    padding: 4px 8px;
    border-radius: 14px;
    font-size: 10px;
}

.kft-loop-card .kft-option-quantity,
.kft-loop-card .kft-option-price,
.kft-loop-item-inner .kft-option-quantity,
.kft-loop-item-inner .kft-option-price {
    font-size: 10px;
}

.kft-loop-card .kft-show-more-wrap,
.kft-loop-item-inner .kft-show-more-wrap {
    padding: 4px 0 0;
    margin-top: 2px;
}

.kft-loop-card .kft-show-more-btn,
.kft-loop-item-inner .kft-show-more-btn {
    font-size: 11px;
    color: #3498db;
    text-decoration: none;
}

.kft-loop-card .kft-show-more-btn:hover,
.kft-loop-item-inner .kft-show-more-btn:hover {
    color: #2980b9;
    text-decoration: underline;
}

.kft-loop-card .kft-price-card-footer,
.kft-loop-item-inner .kft-price-card-footer {
    padding: 0 6px 8px;
    margin-top: auto;
}

.kft-loop-card .kft-quote-btn,
.kft-loop-item-inner .kft-quote-btn {
    display: block;
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: #ff6a2a;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(255, 106, 42, 0.3);
}

.kft-loop-card .kft-quote-btn:hover,
.kft-loop-item-inner .kft-quote-btn:hover {
    background: #f25a18;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 106, 42, 0.4);
}

/* Products grid: make loop cards equal height */
ul.products li.product.kft-loop-product,
ul.products li.product .kft-loop-item-inner {
    display: flex;
}

ul.products li.product.kft-loop-product .kft-price-module,
ul.products li.product .kft-loop-item-inner .kft-price-module {
    width: 100%;
}

.kft-product-image-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
