/* Store Page Styles */

/* Bootstrap page-header override for store page */
body.store-page .page-header {
    margin: 0 !important;
    padding: 10px 0 10px !important;
}

/* Page Header Styles */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 0 60px;
    min-height: 10px;
    position: relative;
    color: white;
    margin-top: 0 !important;
}

.page-header:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1;
}

.page-header-content {
    position: relative;
    z-index: 2;
}

.page-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Header'daki geri dön butonu */
.back-to-categories-header {
    margin-bottom: 20px;
}

.back-to-categories-header .btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-to-categories-header .btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    color: white;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 10px 0 0 0;
    font-size: 16px;
}

.breadcrumb a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: rgba(255,255,255,1);
}

/* Category Hero (only on active category pages) */
body.store-category-active .page-header {
    padding: 70px 0 50px;
}
body.store-category-active .category-hero {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px;
    padding: 20px 22px 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    backdrop-filter: blur(6px);
}
body.store-category-active .category-hero .crumbs {
    margin-bottom: 12px;
    color: rgba(255,255,255,0.92);
}

.crumbs a{
    color: rgba(255,255,255,0.92);
    text-decoration: none;
}
body.store-category-active .category-hero .crumbs .sep{
    margin: 0 10px;
}
body.store-category-active .category-hero .title-row{
    display:flex; align-items:center; justify-content:center; gap:12px;
}
body.store-category-active .category-hero .category-icon{
    display:inline-flex;
    width: 42px; height: 42px;
    align-items:center; justify-content:center;
    border-radius: 10px;
    background: rgba(255,255,255,0.18);
}
body.store-category-active .category-hero .category-icon i{
    color: #fff;
    font-size: 20px;
    line-height: 1;
}
body.store-category-active .category-hero .category-title{
    color:#fff;
    font-weight:800;
    letter-spacing: .2px;
    line-height: 1;
    font-size: 28px;
}
body.store-category-active .category-hero .category-desc{
    color: rgba(255,255,255,0.9);
    margin: 12px 0 16px;
}
body.store-category-active .category-hero .category-meta{
    white-space: nowrap;
}
/* Ensure both items sit on the same baseline with identical height */
body.store-category-active .category-hero .category-meta > *{
    display: inline-flex; align-items: center; height: 30px;
}
body.store-category-active .category-hero .category-meta .badge{
    background:#eef2ff; color:#3730a3;
    font-size: 12px; padding: 0 12px; border-radius: 12px;
    height: 30px; display: inline-flex; align-items:center; box-sizing: border-box; line-height: 1;
}
body.store-category-active .category-hero .back-to-categories{
    border-color: rgba(255,255,255,0.6);
    color:#fff; font-size: 12px;
    padding: 0 12px; box-sizing: border-box; border-width: 1px;
    line-height: 1; height: 30px; display: inline-flex; align-items:center;
}
/* Stronger override for Bootstrap's btn-sm paddings/line-height within our context */
body.store-category-active .category-hero .back-to-categories.btn.btn-sm{
    border-radius:25px; padding-top: 0; padding-bottom: 0; line-height: 1; height: 30px;
}
body.store-category-active .category-hero .back-to-categories:hover{
    background: rgba(255,255,255,0.12);
}

@media (max-width: 576px){
  body.store-category-active .category-hero { padding: 14px 14px 12px; }
    body.store-category-active .category-hero .category-title{ font-size: 22px; }
}

/* Section Padding */
.section-padding {
    padding: 80px 0;
}

/* Category Cards */
.store-categories {
    background: #f8f9fa;
}

.category-card {
    background: white;
    border-radius: 15px;
    padding: 40px 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    margin-bottom: 30px;
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.category-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.category-card:hover:before {
    left: 100%;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.category-icon {
    position: relative;
    z-index: 2;
}

.category-icon i {
    transition: all 0.3s ease;
}

.category-card:hover .category-icon i {
    transform: scale(1.1);
}

.category-content {
    position: relative;
    z-index: 2;
}

.category-content h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 22px;
    font-weight: 600;
}

.category-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.category-stats {
    margin: 20px 0;
}

.badge {
    font-size: 12px;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
}

/* Store Filters */
.store-filters {
    background: white;
    padding: 40px 0;
    border-bottom: 3px solid #eee;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    color: #333;
    font-size: 14px;
}

.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-toggle .btn {
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    background: white;
    color: #666;
    transition: all 0.3s ease;
}

.view-toggle .btn:hover,
.view-toggle .btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Products Section */
.store-products {
    padding: 50px 0 10px; /* reduced bottom whitespace */
}

.w-100 {
    width: 100% !important;
}

.mt-3 {
    margin-top: 1rem !important;
}
.d-block {
    display: block !important;
}
.category-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.back-to-categories {
    text-align: left;
}

.back-to-categories .btn {
    background: white;
    border: 2px solid #ddd;
    color: #666;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-to-categories .btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,123,255,0.2);
}

.back-to-categories .btn i {
    margin-right: 8px;
}

.category-header h3 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.category-header p {
    color: #666;
    font-size: 1.2rem;
}

/* Product Cards */
.product-item {
    margin-bottom: 60px; /* more space between rows of cards */
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 380px; /* further halve remaining bottom white space */
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 160px; /* reduce image height a bit more */
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.products-grid {
    margin-bottom: 30px; /* pull up the last row to reduce bottom gap */
}

.product-actions .btn {
    margin: 5px 0; /* tighter vertical spacing between buttons */
    width: 100%;
}

.product-content {
    padding: 18px 18px 0; /* even less padding to reduce white space */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Ensure action buttons area stays inside the card */
.product-actions {
    margin-top: 4px; /* even tighter distance from price */
    padding-bottom: 0; /* no extra gap under last button */
}

/* Remove extra bottom margin on the last action button only */
.product-actions .btn:last-child {
    margin-bottom: 0;
}

.product-title {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px; /* reduce gap between title and price */
    line-height: 1.4;
    max-height: 56px; /* allow 1-2 lines without forcing extra empty space */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.product-price {
    margin-bottom: 4px; /* even tighter gap between price and buttons */
    flex-shrink: 0;
}

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

.product-buy-btn {
    margin-top: auto;
    padding: 15px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.product-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,123,255,0.3);
}

/* Empty Products */
.empty-products {
    padding: 80px 20px;
    color: #999;
}

.empty-products i {
    margin-bottom: 30px;
}

.empty-products h4 {
    margin-bottom: 15px;
    color: #666;
}

/* Product Modal */
.modal-lg {
    width: 900px;
}

.product-modal-image {
    margin-bottom: 20px;
}

.product-modal-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.product-modal-info h4 {
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 20px;
}

.product-modal-info h4:first-child {
    margin-top: 0;
}

.product-modal-info p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.price-text {
    color: #28a745 !important;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Balance Modal */
#balanceModal .modal-body {
    padding: 40px;
}

#balanceModal .text-center i {
    margin-bottom: 20px;
}

#balanceModal h4 {
    color: #333;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .product-title {
        font-size: 1.1rem;
        max-height: 50px;
        margin-bottom: 6px;
    }
    
    .product-price .price {
        font-size: 1.4rem;
    }
    
    .product-card {
        height: 360px; /* halve remaining bottom white space on mobile */
    }
    
    .product-image {
        height: 145px; /* reduce mobile image height slightly */
    }
    
    .product-content {
        padding: 16px 16px 2px; /* minimal bottom padding on mobile */
    }
    
    .modal-lg {
        width: 95%;
        margin: 10px auto;
    }
    
    .store-filters .filter-group {
        margin-bottom: 20px;
    }
    
    .category-header h3 {
        font-size: 2rem;
    }
}
.store-products {
    min-height: 400px;
}

.category-header {
    margin-bottom: 50px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    text-align: center;
}

.category-header h3 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.category-header p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

.empty-products {
    padding: 80px 20px;
    text-align: center;
    color: #666;
}

.empty-products i {
    margin-bottom: 30px;
    opacity: 0.3;
}

.empty-products h4 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
}

.loading-animation {
    margin-top: 30px;
    color: #007bff;
    font-size: 1.1rem;
}

.loading-animation i {
    margin-right: 10px;
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 0;
    color: white;
    position: relative;
}

.newsletter-section:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
}

.newsletter-content {
    position: relative;
    z-index: 2;
}

.newsletter-content h3 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.newsletter-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form .form-control {
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    border-radius: 50px 0 0 50px;
}

.newsletter-form .btn {
    border-radius: 0 50px 50px 0;
    padding: 15px 25px;
    font-weight: 600;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        padding: 80px 0 60px;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .section-padding {
        padding: 60px 0;
    }
    
    .category-card {
        height: auto;
        margin-bottom: 20px;
        padding: 30px 20px;
    }
    
    .filter-group {
        margin-bottom: 20px;
    }
    
    .view-toggle {
        justify-content: center;
    }
    
    .category-header h3 {
        font-size: 2rem;
    }
    
    .newsletter-content h3 {
        font-size: 1.8rem;
    }
    
    .newsletter-form .form-control,
    .newsletter-form .btn {
        border-radius: 8px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .category-card {
        padding: 25px 15px;
    }
    
    .category-content h4 {
        font-size: 18px;
    }
    
    .newsletter-content h3 {
        font-size: 1.5rem;
    }
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card {
    animation: fadeInUp 0.6s ease forwards;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }

/* =============================================================
 * KATEGORİ LİSTESİ TEK SÜTUN DİKEY DİZİLİM OVERRIDE
 * İstek: Kategoriler yan yana değil alt alta görünsün.
 * Açıklama: magaza.php içinde kategori wrapper'ı:
 * <div class="d-flex justify-content-center row"> ... </div>
 * Buradaki d-flex + bootstrap .row yatay dizilim sağlıyor.
 * Aşağıdaki override ile sadece kategori bölümünde (store-categories)
 * flex yönünü kolona çeviriyoruz ve sütun genişliklerini %100 yapıyoruz.
 * İleride tekrar yan yana görünmesi istenirse bu blok kaldırılabilir / yorumlanabilir.
 * ============================================================= */
.store-categories .row.d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
}

.store-categories .row.d-flex > [class*="col-"],
.store-categories .row.d-flex > .col,
.store-categories .row.d-flex > .col-auto {
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

/* Kartlar arasındaki düşey boşluğu koru (zaten margin-bottom var) */
.store-categories .row.d-flex > [class*="col-"] .category-card {
    height: auto; /* Yükseklik sabit ise çok boşluk olmasın */
}

@media (min-width: 992px){
  /* Büyük ekranlarda da tek sütun sürsün diye tekrar %100 bırakıyoruz. */
  .store-categories .row.d-flex > [class*="col-"]{
      max-width: 100% !important;
  }
}

/* Boş kategori placeholder kartı */
.product-card.placeholder.empty-category {
    border: 2px dashed #cfd3d7;
    background: #fafbfc;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 360px;
}
.product-card.placeholder.empty-category .product-image.placeholder-img i{
    opacity: .5;
}
.product-card.placeholder.empty-category .product-title{ color:#555; }
.product-card.placeholder.empty-category p{ color:#888; }

/* Placeholder içindeki image konteynerini de tam ortalama */
.product-card.placeholder.empty-category .product-image.placeholder-img{
    width:100%;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    margin-bottom:20px;
    background:linear-gradient(135deg,#f1f3f5,#e9ecef);
}
.product-card.placeholder.empty-category .product-content{
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
}
