/* =========================================================
   Custom Product Katalog - Frontend Styles
   Tüm classlar cpk- önekiyle, tema CSS'lerinden izole.
   Renkler ve görsel ayarları :root değişkenleri ile
   Ayarlar sayfasından kontrol edilir (bkz. FrontendAssets::generate_css_variables).
   ========================================================= */

:root {
    --cpk-primary: #6366f1;
    --cpk-primary-dark: #4338ca;
    --cpk-secondary: #ec4899;
    --cpk-accent: #06b6d4;
    --cpk-text: #1e1b2e;
    --cpk-text-light: #6b6478;
    --cpk-bg: #ffffff;
    --cpk-card-bg: #ffffff;
    --cpk-border: #ece9f3;
    --cpk-price: #1e1b2e;
    --cpk-price-bg: #fef3f2;
    --cpk-whatsapp: #25D366;
    --cpk-whatsapp-hover: #1ebe5b;
    --cpk-image-fit: cover;
    --cpk-image-bg: #f6f5fb;
    --cpk-padding-top: 56px;
    --cpk-padding-bottom: 56px;
    --cpk-gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
}

.cpk-wrapper,
.cpk-wrapper * {
    box-sizing: border-box;
}

.cpk-wrapper {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--cpk-text);
    background: transparent;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.cpk-wrapper a,
.cpk-wrapper button,
.cpk-wrapper select,
.cpk-wrapper input {
    touch-action: manipulation;
    pointer-events: auto !important;
    cursor: pointer;
}

.cpk-wrapper *,
.cpk-wrapper *::before,
.cpk-wrapper *::after {
    font-family: inherit;
}

.cpk-wrapper a {
    cursor: pointer;
    pointer-events: auto;
    position: relative;
}

.cpk-wrapper a * {
    pointer-events: none;
}

.cpk-wrapper button {
    cursor: pointer;
    pointer-events: auto;
    font: inherit;
}

.cpk-no-image {
    pointer-events: none;
}

.cpk-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: var(--cpk-padding-top) 20px var(--cpk-padding-bottom);
    width: 100%;
    position: relative;
    z-index: 1;
    background: var(--cpk-bg);
}

/* =========================================================
   Breadcrumb
   ========================================================= */

.cpk-breadcrumb {
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--cpk-text-light);
    line-height: 1.6;
}

.cpk-breadcrumb a {
    color: var(--cpk-text-light);
    text-decoration: none;
    transition: color 0.15s ease;
}

.cpk-breadcrumb a:hover {
    color: var(--cpk-primary);
    text-decoration: underline;
}

.cpk-breadcrumb p,
.cpk-breadcrumb #breadcrumbs {
    margin: 0;
}

.cpk-breadcrumb-fallback {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.cpk-breadcrumb-fallback .cpk-breadcrumb-sep {
    color: var(--cpk-border);
}

.cpk-breadcrumb-fallback .cpk-breadcrumb-current {
    color: var(--cpk-text);
    font-weight: 600;
}



.cpk-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
    align-items: center;
    justify-content: space-between;
}

.cpk-search-box {
    display: flex;
    gap: 8px;
    flex: 1 1 280px;
}

.cpk-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--cpk-border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--cpk-text);
    background: var(--cpk-card-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cpk-search-input:focus {
    outline: none;
    border-color: var(--cpk-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.cpk-category-filter {
    flex: 0 0 230px;
}

.cpk-category-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--cpk-border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--cpk-card-bg);
    color: var(--cpk-text);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.cpk-category-select:focus {
    outline: none;
    border-color: var(--cpk-primary);
}

/* =========================================================
   Loading Spinner
   ========================================================= */

.cpk-loading {
    display: flex;
    justify-content: center;
    padding: 36px 0;
}

.cpk-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--cpk-border);
    border-top-color: var(--cpk-primary);
    border-radius: 50%;
    display: inline-block;
    animation: cpk-spin 0.8s linear infinite;
}

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

/* =========================================================
   Grid & Card
   ========================================================= */

.cpk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    transition: opacity 0.2s ease;
}

.cpk-grid.cpk-grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.cpk-grid.cpk-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cpk-grid.cpk-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.cpk-grid.cpk-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.cpk-grid.cpk-grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.cpk-grid.cpk-grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

.cpk-grid.cpk-grid-loading {
    opacity: 0.4;
    pointer-events: none;
}

.cpk-card {
    background: var(--cpk-card-bg);
    border: 1px solid var(--cpk-border);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.cpk-card:hover {
    box-shadow: 0 12px 32px -8px rgba(99, 102, 241, 0.35);
    transform: translateY(-4px);
    border-color: transparent;
}

.cpk-card.cpk-animated {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.cpk-card.cpk-animated.cpk-visible {
    opacity: 1;
    transform: translateY(0);
}

.cpk-card.cpk-animated.cpk-visible:hover {
    transform: translateY(-4px);
}

.cpk-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 1;
    flex: 1;
}

.cpk-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #ffffff !important;
    display: block;
    position: relative;
}

.cpk-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.cpk-image {
    width: 100%;
    height: 100%;
    object-fit: var(--cpk-image-fit);
    display: block;
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.cpk-card:hover .cpk-card-image .cpk-image {
    transform: scale(1.04);
}

.cpk-image.cpk-lazy {
    opacity: 0;
}

.cpk-image.cpk-loaded {
    opacity: 1;
}

.cpk-no-image {
    width: 100%;
    height: 100%;
    background: var(--cpk-image-bg);
    background-image:
        linear-gradient(135deg, transparent 45%, rgba(99,102,241,0.06) 45%, rgba(99,102,241,0.06) 55%, transparent 55%);
}

.cpk-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cpk-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--cpk-text);
    line-height: 1.35;
    flex: 1;
    padding-bottom: 12px;
}

.cpk-short-desc {
    font-size: 13px;
    color: var(--cpk-text-light);
    margin: 0 0 8px;
    line-height: 1.5;
}

.cpk-card-bottom {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-top: 1px solid var(--cpk-border);
    padding-top: 0;
}

.cpk-card-price-area {
    height: 44px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cpk-card-bottom .cpk-button {
    margin-top: 8px;
    flex-shrink: 0;
}

.cpk-card-content > .cpk-button {
    margin-top: 8px;
    flex-shrink: 0;
}

/* =========================================================
   Price badge
   ========================================================= */

.cpk-price {
    display: inline-block;
    font-size: 17px;
    font-weight: 700;
    color: var(--cpk-price);
    margin-top: 2px;
}

.cpk-price-button {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border-radius: 10px;
    background: var(--cpk-price-bg);
    color: var(--cpk-price);
    border: none;
    font-size: 16px;
    font-weight: 800;
    width: fit-content;
    letter-spacing: 0.01em;
}

.cpk-single-price.cpk-price-button {
    font-size: 26px;
    padding: 14px 26px;
    background: var(--cpk-gradient);
    color: var(--cpk-on-gradient);
    box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.5);
}

/* =========================================================
   Buttons
   ========================================================= */

.cpk-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 11px 20px;
    margin-top: 4px;
    border-radius: 10px;
    background: var(--cpk-gradient);
    color: var(--cpk-on-gradient);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.55);
    letter-spacing: 0.01em;
}

.cpk-button:hover {
    color: var(--cpk-on-gradient);
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 10px 22px -6px rgba(99, 102, 241, 0.6);
}

.cpk-search-button {
    flex-shrink: 0;
    padding: 12px 22px;
    margin-top: 0;
}

/* =========================================================
   WhatsApp Button (card overlay - on top of product image)
   ========================================================= */

.cpk-whatsapp-btn {
    position: absolute !important;
    top: 12px;
    right: 12px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--cpk-whatsapp) !important;
    color: var(--cpk-on-whatsapp) !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 5;
    line-height: 1;
    cursor: pointer;
}

.cpk-whatsapp-btn:hover {
    background-color: var(--cpk-whatsapp-hover) !important;
    transform: scale(1.1) rotate(8deg);
    color: var(--cpk-on-whatsapp) !important;
}

.cpk-whatsapp-btn .cpk-whatsapp-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: currentColor;
}

.cpk-whatsapp-btn span {
    display: none;
}

/* Yazı eklenmişse buton genişler ve pill şeklini alır. */
.cpk-whatsapp-btn-text {
    width: auto;
    height: auto;
    padding: 10px 16px;
    border-radius: 10px;
}

.cpk-whatsapp-btn-text span {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--cpk-on-whatsapp) !important;
}

/* Detay sayfasında geniş WhatsApp butonu */
.cpk-whatsapp-btn-full {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border: none;
    border-radius: 10px;
    background-color: var(--cpk-whatsapp) !important;
    color: var(--cpk-on-whatsapp) !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 700;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 8px 20px -6px rgba(37, 211, 102, 0.55);
}

.cpk-whatsapp-btn-full:hover {
    background-color: var(--cpk-whatsapp-hover) !important;
    color: var(--cpk-on-whatsapp) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -6px rgba(37, 211, 102, 0.6);
}

.cpk-whatsapp-btn-full .cpk-whatsapp-icon {
    width: 22px;
    height: 22px;
}

.cpk-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--cpk-text-light);
    font-size: 15px;
}

/* =========================================================
   Pagination
   ========================================================= */

.cpk-pagination {
    margin-top: 32px;
}

.cpk-pagination-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.cpk-page-btn {
    padding: 10px 16px;
    border: 2px solid var(--cpk-border);
    background: var(--cpk-card-bg);
    color: var(--cpk-text);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cpk-page-btn:hover {
    border-color: var(--cpk-primary);
    color: var(--cpk-primary);
}

.cpk-page-btn.cpk-page-active,
.cpk-page-btn.current {
    background: var(--cpk-gradient);
    color: var(--cpk-on-gradient);
    border-color: transparent;
}

/* =========================================================
   Badge utility
   ========================================================= */

.cpk-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--cpk-primary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

/* =========================================================
   Single Product Page - 2 Column Sticky Layout
   ========================================================= */

.cpk-single {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
    align-items: start;
}

@media (max-width: 900px) {
    .cpk-single {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

/* Sol: Galeri */
.cpk-single-gallery {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-self: start;
}

.cpk-main-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 20px;
    background: #ffffff;
    position: relative;
    box-shadow: 0 16px 40px -16px rgba(99, 102, 241, 0.35);
}

.cpk-main-image-wrap .cpk-image {
    width: 100%;
    height: 100%;
    object-fit: var(--cpk-image-fit);
    position: relative;
    z-index: 1;
    transition: opacity 0.2s ease;
}

.cpk-thumbs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cpk-thumb {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--cpk-border);
    background: var(--cpk-image-bg);
    flex-shrink: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.cpk-thumb:hover {
    transform: translateY(-2px);
}

.cpk-thumb.cpk-thumb-active {
    border-color: var(--cpk-primary);
    box-shadow: 0 4px 12px -4px rgba(99, 102, 241, 0.45);
}

.cpk-thumb img {
    width: 100%;
    height: 100%;
    object-fit: var(--cpk-image-fit);
    display: block;
    background: var(--cpk-image-bg);
}

/* Sağ: Bilgi paneli */
.cpk-single-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-self: start;
}

.cpk-single-title {
    font-size: 30px;
    font-weight: 800;
    margin: 0;
    color: var(--cpk-text);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.cpk-meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--cpk-text-light);
}

.cpk-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid var(--cpk-border);
}

.cpk-meta-row span strong {
    color: var(--cpk-text);
    font-weight: 700;
}

.cpk-meta-row a {
    color: var(--cpk-primary);
    text-decoration: none;
    font-weight: 600;
}

.cpk-meta-row a:hover {
    text-decoration: underline;
}

.cpk-single-short-desc {
    font-size: 15.5px;
    color: var(--cpk-text-light);
    line-height: 1.7;
    margin: 0;
}

.cpk-single-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 4px;
    align-items: center;
}

.cpk-pdf-download .cpk-button {
    background: var(--cpk-card-bg);
    color: var(--cpk-primary);
    border: 2px solid var(--cpk-border);
    box-shadow: none;
}

.cpk-pdf-download .cpk-button:hover {
    border-color: var(--cpk-primary);
    color: var(--cpk-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -8px rgba(99, 102, 241, 0.4);
}

/* =========================================================
   Specs table
   ========================================================= */

.cpk-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--cpk-border);
}

.cpk-specs-table tr {
    border-bottom: 1px solid var(--cpk-border);
}

.cpk-specs-table tr:last-child {
    border-bottom: none;
}

.cpk-specs-table tr:nth-child(odd) {
    background: rgba(99, 102, 241, 0.035);
}

.cpk-specs-table td {
    padding: 12px 16px;
    font-size: 14px;
    vertical-align: top;
}

.cpk-specs-table td:first-child {
    font-weight: 700;
    width: 38%;
    color: var(--cpk-text);
}

.cpk-specs-table td:last-child {
    color: var(--cpk-text-light);
}

/* =========================================================
   Section titles
   ========================================================= */

.cpk-section-title {
    font-size: 21px;
    font-weight: 800;
    margin: 8px 0 16px;
    color: var(--cpk-text);
    letter-spacing: -0.01em;
    position: relative;
    padding-left: 16px;
}

.cpk-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 5px;
    border-radius: 4px;
    background: var(--cpk-gradient);
}

/* =========================================================
   Single description & related products
   ========================================================= */

.cpk-single-description {
    margin-top: 8px;
    line-height: 1.75;
    color: var(--cpk-text);
    font-size: 15.5px;
}

.cpk-single-description img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.cpk-related-products {
    margin-top: 48px;
    padding-top: 36px;
    border-top: 1px solid var(--cpk-border);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 992px) {
    .cpk-grid.cpk-grid-cols-4,
    .cpk-grid.cpk-grid-cols-5,
    .cpk-grid.cpk-grid-cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .cpk-grid,
    .cpk-grid.cpk-grid-cols-2,
    .cpk-grid.cpk-grid-cols-3,
    .cpk-grid.cpk-grid-cols-4,
    .cpk-grid.cpk-grid-cols-5,
    .cpk-grid.cpk-grid-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .cpk-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .cpk-category-filter {
        flex: 1 1 auto;
    }

    .cpk-single-title {
        font-size: 24px;
    }

    .cpk-single-price.cpk-price-button {
        font-size: 22px;
        padding: 12px 20px;
    }

    .cpk-main-image-wrap {
        border-radius: 16px;
    }
}

@media (max-width: 420px) {
    .cpk-grid,
    .cpk-grid.cpk-grid-cols-2,
    .cpk-grid.cpk-grid-cols-3,
    .cpk-grid.cpk-grid-cols-4,
    .cpk-grid.cpk-grid-cols-5,
    .cpk-grid.cpk-grid-cols-6 {
        grid-template-columns: repeat(1, 1fr);
    }

    .cpk-single-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cpk-whatsapp-btn-full,
    .cpk-pdf-download .cpk-button {
        justify-content: center;
        width: 100%;
    }
}
