/* Price List Plugin - Frontend Styles */

/* Ana Container */
.wc-price-list-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header ve Filtreler */
.price-list-header {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-filter-container {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.price-list-search,
.price-list-category-filter {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.price-list-search {
    flex: 1;
    min-width: 250px;
}

.price-list-category-filter {
    min-width: 180px;
}

.price-list-search:focus,
.price-list-category-filter:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.price-list-clear-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.price-list-clear-btn:hover {
    background: #c82333;
}

/* Tablo Stili */
.price-list-grid {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}

.price-list-table-header {
    display: grid;
    grid-template-columns: 120px 150px 1fr 150px;
    background: white;
    color: #2c3e50;
    border: 2px solid #e9ecef;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-cell {
    padding: 15px 20px;
    border-right: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.header-cell:last-child {
    border-right: none;
}

/* Ürün Satırları */
.price-list-row {
    display: grid;
    grid-template-columns: 120px 150px 1fr 150px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
}

.price-list-row:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.price-list-row:last-child {
    border-bottom: none;
}

.price-list-row > div {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #eee;
}

.price-list-row > div:last-child {
    border-right: none;
}

.product-code {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.product-image img {
    max-width: 80px;
    max-height: 80px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-name {
    font-size: 15px;
    color: #2c3e50;
    text-align: left;
    font-weight: 500;
    line-height: 1.4;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #28a745;
}

/* Masaüstünde ek resimleri gizle */
.additional-images.mobile-only {
    display: none;
}

/* Modal Styles */
.price-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    max-width: 900px;
    max-height: calc(100vh - 40px);
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

.modal-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    border-radius: 15px 15px 0 0;
    z-index: 11;
    flex-shrink: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Modal İçerik */
.product-modal-content {
    padding: 30px;
}

.modal-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.modal-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

/* Resim Slider */
.product-images {
    position: relative;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.image-slider {
    position: relative;
    padding: 20px;
    text-align: center;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-image {
    margin-bottom: 15px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    width: 100%;
}

.main-image img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease;
}

.image-slider.loading .main-image img {
    opacity: 0.7;
}

.prev-btn, .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

.prev-btn:hover, .next-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn:active, .next-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.image-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.dot.active {
    background: #007cba;
    transform: scale(1.2);
    border-color: rgba(0, 124, 186, 0.3);
}

.dot:hover:not(.active) {
    background: #bbb;
    transform: scale(1.1);
}

/* Tek resim için özel stil */
.single-image {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-image img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Ürün Detayları */
.product-details h3, .product-details h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.product-info-grid {
    margin-bottom: 30px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 600;
    color: #495057;
    flex: 1;
}

.info-row .value {
    color: #2c3e50;
    text-align: right;
    flex: 0 0 auto;
}

/* Besin Değerleri */
.nutrition-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
}

.nutrition-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nutrition-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.nutrition-row:last-child {
    border-bottom: none;
}

.nutrition-label {
    font-weight: 500;
    color: #495057;
}

.nutrition-value {
    font-weight: 600;
    color: #2c3e50;
}

/* Boş sonuç */
.no-products-found {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

/* Responsive Tasarım - Ana Liste */
@media (max-width: 768px) {
    .wc-price-list-wrapper {
        padding: 15px;
    }
    
    .price-list-header {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .search-filter-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .price-list-search,
    .price-list-category-filter {
        width: 100%;
        min-width: unset;
    }
    
    .price-list-clear-btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    /* Mobil tablo */
    .price-list-table-header {
        display: none;
    }
    
    .price-list-row {
        display: block;
        background: white;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 1px solid #eee;
        overflow: hidden;
        min-height: auto;
    }
    
    .price-list-row > div {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        justify-content: space-between;
        min-height: 50px; /* Sabit yükseklik */
    }
    
    .price-list-row > div:last-child {
        border-bottom: none;
    }
    
    .price-list-row > div:before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        min-width: 80px;
        flex-shrink: 0;
    }
    
    .product-code[data-label-code]:before {
        content: attr(data-label-code);
    }
    
    .product-image:before {
        content: '';
        display: none;
    }
    
    .product-name:before {
        content: '';
        display: none;
    }
    
    .product-price[data-label-price]:before {
        content: attr(data-label-price);
    }
    
    /* Ürün resmi alanı - SABIT BOYUT */
    .product-image {
        justify-content: center;
        padding: 15px;
        background: #f8f9fa;
        border-bottom-color: #ddd !important;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        min-height: 140px; /* Küçültüldü (180px'den 140px'e) */
    }
    
    .product-image .main-product-image {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100px;  /* Küçültüldü */
        height: 100px; /* Küçültüldü */
        background: white;
        border-radius: 8px;
        border: 1px solid #ddd;
    }
    
    .product-image .main-product-image img {
        max-width: 90px !important;
        max-height: 90px !important;
        width: auto;
        height: auto;
        object-fit: contain;
        border-radius: 6px;
    }
    
    /* Ek resimler mobilde göster - YANYANA DİZİLİM */
    .additional-images.mobile-only {
        display: flex !important;
        justify-content: center;
        gap: 8px;
        flex-wrap: nowrap; /* Yanyana düzsün */
        overflow-x: auto;
        padding: 0 5px;
    }
    
    .additional-thumb {
        width: 100px !important;  /* Ana görsel ile aynı boyut */
        height: 100px !important;
        flex-shrink: 0;          /* Küçülmesin */
        object-fit: contain;    /* cover yerine contain */
        border-radius: 6px;
        border: 1px solid #ddd;
        opacity: 0.9;
        transition: all 0.2s ease;
    }
    
    .additional-thumb:hover {
        opacity: 1;
        transform: scale(1.05);
    }
    
    .more-images {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100px !important;  /* Ana görsel ile aynı boyut */
        height: 100px !important;
        flex-shrink: 0;
        background: rgba(0,0,0,0.7);
        color: white;
        font-size: 14px;
        font-weight: bold;
        border-radius: 6px;
        text-align: center;
    }
    
    /* Ürün adı alanı */
    .product-name {
        text-align: left;
        justify-content: center;
        font-size: 16px;
        font-weight: 600;
        background: white;
        color: #2c3e50;
        margin: 0;
        padding: 15px !important;
        border: 2px solid #eee;
        line-height: 1.4;
        min-height: 50px;
        display: flex;
        align-items: center;
    }
    
    /* Kod alanı */
    .product-code {
        font-size: 16px;
        font-weight: 700;
        color: #007cba;
        min-height: 50px;
        display: flex;
        align-items: center;
    }
    
    /* Fiyat alanı */
    .product-price {
        font-size: 25px;  /* 20px'den 25px'e çıkarıldı (+5px) */
        font-weight: 700;
        color: #28a745;
        background: #f8f9fa;
        min-height: 50px;
        display: flex;
        align-items: center;
    }
    
    .price-list-row:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
}

/* Mobile Modal Responsive */
@media (max-width: 768px) {
    .price-list-modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 20px);
        margin: 0;
        border-radius: 10px;
    }
    
    .modal-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-modal-content {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 18px;
        margin-bottom: 20px;
        line-height: 1.3;
        padding-right: 40px;
    }
    
    .modal-header {
        padding: 10px 15px;
        border-radius: 10px 10px 0 0;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .image-slider {
        padding: 15px;
        min-height: 280px;
    }
    
    .main-image {
        min-height: 200px;
    }
    
    .main-image img {
        max-height: 200px;
    }
    
    .prev-btn, .next-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 10px 0;
    }
    
    .info-row .value {
        text-align: left;
        font-size: 14px;
    }
    
    .info-row .label {
        font-size: 14px;
        font-weight: 600;
    }
    
    .nutrition-section {
        padding: 15px;
        margin-top: 20px;
    }
    
    .nutrition-row {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .nutrition-label,
    .nutrition-value {
        font-size: 14px;
    }
    
    .image-dots {
        gap: 8px;
        margin-top: 10px;
    }
    
    .dot {
        width: 12px;
        height: 12px;
    }
    
    .dot.active {
        transform: scale(1.1);
    }
}

/* Küçük telefon ekranları */
@media (max-width: 480px) {
    .wc-price-list-wrapper {
        padding: 10px;
    }
    
    .price-list-header {
        padding: 10px;
    }
    
    .price-list-row > div {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .product-name {
        font-size: 15px !important;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    .product-image .main-product-image img {
        max-width: 100px;
        max-height: 100px;
    }
}

/* Tablet responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .modal-content {
        width: 95%;
        max-width: 800px;
    }
    
    .modal-main-content {
        gap: 30px;
    }
    
    .image-slider {
        min-height: 300px;
    }
    
    .main-image {
        min-height: 220px;
    }
    
    .main-image img {
        max-height: 220px;
    }
}

/* Loading Animation */
.price-list-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    font-size: 16px;
    color: #6c757d;
}

.price-list-loading:after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filtreleme durumu */
.price-list-row.hidden {
    display: none;
}

/* Hover efektleri */
.price-list-row:hover .product-name {
    color: #007cba;
}

.price-list-row:hover .product-image img {
    transform: scale(1.05);
}

/* Product Short Description - En altta */
.product-short-description {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.product-short-description .description-content {
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.product-short-description .description-content p {
    margin-bottom: 10px;
}

.product-short-description .description-content p:last-child {
    margin-bottom: 0;
}

/* Product categories - stil güncellemesi */
.product-categories {
    margin-top: 25px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 6px;
    border-left: 3px solid #4a90e2;
}

.product-categories .info-row {
    margin: 0;
}

/* Info grid sadeleştir */
.product-info-grid {
    margin-top: 0;
}

.product-info-grid .info-row {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.product-info-grid .info-row:last-child {
    border-bottom: none;
}

/* Modal genişliği artır */
.product-modal-content {
    max-width: 900px !important;
}

/* Language Dropdown */
.language-dropdown-wrapper {
    margin-left: 15px;
}

.language-dropdown {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6,9 12,15 18,9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.language-dropdown:hover {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.language-dropdown:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.language-dropdown option {
    padding: 8px;
    font-size: 14px;
}

/* Search filter container responsive */
.search-filter-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
}

/* RTL Support for Arabic */
[dir="rtl"] .search-filter-container {
    direction: rtl;
}

[dir="rtl"] .price-list-table-header,
[dir="rtl"] .price-list-row {
    direction: rtl;
}

[dir="rtl"] .price-list-row > div {
    text-align: right;
}

[dir="rtl"] .product-name {
    text-align: right;
}

[dir="rtl"] .language-dropdown-wrapper {
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .language-dropdown {
    direction: rtl;
    background-position: left 12px center;
    padding-left: 40px;
    padding-right: 15px;
}

/* RTL Mobil */
@media (max-width: 768px) {
    [dir="rtl"] .language-dropdown-wrapper {
        margin-right: 0;
    }
    
    [dir="rtl"] .price-list-row > div {
        text-align: right;
    }
    
    [dir="rtl"] .price-list-row > div:before {
        margin-left: 10px;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .search-filter-container {
        flex-direction: column;
        gap: 15px;
    }
    
    [dir="rtl"] .search-filter-container {
        text-align: center;
    }
    
    .language-dropdown-wrapper {
        margin-left: 0;
        width: 100%;
        max-width: 300px;
    }
    
    .language-dropdown {
        width: 100%;
        min-width: unset;
    }
    
    .price-list-search,
    .price-list-category-filter {
        width: 100%;
        max-width: 300px;
    }
}
