/* =========================
   GLOBAL RESET - TAŞMA ENGELLEME
========================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* =========================
   ÜRÜN BÖLÜMLERİ - KONTEYNER
========================= */
.product-section {
    margin: 2rem 0;
    padding: 0 1rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.section-header {
    margin-bottom: 1.5rem;
    text-align: center;
    width: 100%;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.section-title i {
    color: #3b82f6;
}

.section-subtitle {
    color: #666;
    font-size: 0.95rem;
}

/* =========================
   GRID SİSTEMİ - RESPONSIVE, TAŞMA YOK
========================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Tablet: 3 sütun */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* Mobil: 2 sütun - tam sığar, kayma olmaz */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0;
    }
    
    .product-section {
        padding: 0 0.75rem;
    }
}

/* Küçük mobil (max 480px) - yine 2 sütun, padding az */
@media (max-width: 480px) {
    .products-grid {
        gap: 0.5rem;
    }
    
    .product-section {
        padding: 0 0.5rem;
    }
}

/* =========================
   ÜRÜN KARTI - TAM RESPONSIVE, TAŞMA YOK
========================= */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 100%;
    width: 100%;
    max-width: 100%;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* =========================
   GÖRSEL ALANI - SABİT ORAN, TAŞMA YOK
========================= */
.product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8fafc;
    cursor: pointer;
}

.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-image-container:hover .product-image {
    transform: scale(1.05);
}

/* =========================
   ETİKETLER (SOL ÜST - SAĞ ÜST)
========================= */
.product-labels-left {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.product-discount-right {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.label {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    backdrop-filter: blur(2px);
    white-space: nowrap;
}

.label-new {
    background: #10b981;
}

.label-popular {
    background: #f59e0b;
}

.label-bestseller {
    background: #8b5cf6;
}

.label-discount {
    background: #3b82f6;
    font-size: 11px;
    padding: 4px 10px;
}

/* Mobil etiketler küçülsün */
@media (max-width: 480px) {
    .label {
        font-size: 8px;
        padding: 2px 6px;
    }
    .label-discount {
        font-size: 9px;
        padding: 3px 8px;
    }
}

/* =========================
   ZOOM OVERLAY
========================= */
.zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: none;
    cursor: pointer;
    z-index: 3;
}

.zoom-overlay .zoom-icon {
    color: white;
    font-size: 2rem;
}

.product-image-container:hover .zoom-overlay {
    opacity: 1;
}

/* =========================
   İÇERİK ALANI - TAŞMA YOK
========================= */
.product-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
    overflow: hidden;
}

.product-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.product-title a {
    color: #111;
    text-decoration: none;
    transition: color 0.2s;
}

.product-title a:hover {
    color: #3b82f6;
}

.product-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.stat-sold, .stat-views {
    display: flex;
    align-items: center;
    gap: 3px;
}

.stat-sold i {
    color: #ef4444;
}

.stat-views i {
    color: #3b82f6;
}

.product-price {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.new-price {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
}

.old-price {
    font-size: 0.75rem;
    text-decoration: line-through;
    color: #9ca3af;
}

.discount-percent {
    font-size: 0.7rem;
    font-weight: 700;
    color: #ef4444;
    background: #fee2e2;
    padding: 2px 5px;
    border-radius: 20px;
}

/* =========================
   BUTON DÜZENİ - TÜM EKRANLARDA AYNI YAPIDA
========================= */
.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

.product-buy-now {
    width: 100%;
}

.btn-view, .btn-add-cart, .btn-buy-now {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

.btn-view {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-view:hover {
    background: #e5e7eb;
}

.btn-add-cart {
    background: #3b82f6;
    color: white;
}

.btn-add-cart:hover {
    background: #2563eb;
}

.btn-buy-now {
    background: #10b981;
    color: white;
    width: 100%;
}

.btn-buy-now:hover {
    background: #059669;
}

/* Mobil butonlar küçülsün ama yapı bozulmasın */
@media (max-width: 480px) {
    .btn-view, .btn-add-cart, .btn-buy-now {
        padding: 5px 4px;
        font-size: 0.65rem;
        white-space: nowrap;
    }
    .product-actions {
        gap: 4px;
    }
}

/* =========================
   MODAL (RESİM BÜYÜTME) - TAM RESPONSIVE
========================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-content {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: transparent;
    border: none;
}

/* Mobilde modal daha iyi görünsün */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 75vh;
    }
    .close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}

/* =========================
   VARIANT MODAL (RENK/BEDEN) - TAM RESPONSIVE
========================= */
.variant-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 1rem;
}

.variant-modal.active {
    display: flex;
}

.variant-modal-content {
    background: white;
    border-radius: 16px;
    padding: 1.2rem;
    max-width: 450px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
    margin: auto;
}

.variant-modal h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
    word-break: break-word;
}

.option-group {
    margin-bottom: 1rem;
}

.option-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.option-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-option, .size-option {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 40px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
}

.option-btn.selected, .color-option.selected, .size-option.selected {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.variant-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 1.2rem;
}

.variant-modal-actions button {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.variant-cancel {
    background: #f3f4f6;
    color: #333;
}

.variant-confirm {
    background: #3b82f6;
    color: white;
}

/* Mobil variant modal düzenlemeleri */
@media (max-width: 480px) {
    .variant-modal-content {
        padding: 1rem;
        width: 95%;
    }
    .color-option, .size-option {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    .variant-modal-actions button {
        padding: 8px;
        font-size: 0.85rem;
    }
}

/* =========================
   BİLDİRİM (TOAST) - MOBİLDE TAŞMA YOK
========================= */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    z-index: 1200;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-width: 280px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

@media (max-width: 480px) {
    .notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        font-size: 0.8rem;
        text-align: center;
    }
}

/* =========================
   EK GÜVENLİK - TAŞMAYI TAMAMEN ÖNLE
========================= */
img, svg, video, iframe {
    max-width: 100%;
    height: auto;
}

.container, .wrapper, main, .content {
    overflow-x: hidden;
    width: 100%;
}

/* Kayan scroll çubuğu sorunlarına karşı */
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}