/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Ürün Sayfası Stilleri */

.page-header {
    margin-top: 70px;
    background: linear-gradient(90deg, #132546 60%, #1e40af 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.search-bar {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-bar input {
    width: 100%;
    padding: 12px 0px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

.search-bar i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background:  linear-gradient(90deg, #132546 60%, #1e40af 100%);
    color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    align-items: stretch; /* Grid itemlarının aynı yükseklikte olmasını sağlar */
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%; /* Grid container'ın yüksekliğini kullan */
    min-height: 500px; /* Minimum yükseklik belirle */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: #f8f9fa; /* Görsel yüklenirken arka plan */
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* Görseli merkeze hizala */
    transition: transform 0.3s;
    background: #f8f9fa; /* Görsel yüklenirken arka plan */
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.product-badge {
    background: #ff6b35;
    color: white;
}

.product-badge.new {
    background: #28a745;
}

.product-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1; /* Kalan alanı kapla */
}

.product-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.product-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 14px;
    flex: 1; /* Kalan alanı kapla */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Maksimum 3 satır */
    line-clamp: 3; /* Standart özellik */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.product-features {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.product-features span {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-features i {
    color: #667eea;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 20px;
}

.price {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
}

.period {
    color: #666;
    font-size: 14px;
}

.product-stock {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-stock i {
    color: #667eea;
}

/* Sepete ekle buton stilleri */
.add-to-cart-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(90deg, #132546 60%, #1e40af 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  font-size: 16px;
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Ürün sepette varsa buton stili */
.add-to-cart-btn.in-cart {
  background: linear-gradient(135deg, #059669, #047857);
}

/* Ürün adedi göstergesi */
.item-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #f97316;
  color: white;
  font-size: 12px;
  font-weight: 700;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  margin-left: 5px;
}

/* Buton içindeki ikon ve metni düzgün hizalamak için */
.add-to-cart-btn i {
  margin-right: 6px;
}

.add-to-cart-btn .btn-text {
  margin-right: auto;
  margin-left: auto;
}

.cart-item .cart-count {
    background: #ff6b35;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 5px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .page-header {
        margin-top: 60px;
        padding: 60px 0 40px;
    }
    
    /* Mobil grid düzenlemesi */
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        margin: 20px 10px 40px;
        padding: 0 5px;
    }
    
    .product-card {
        min-height: 420px;
        margin-bottom: 0;
    }
    
    .product-image {
        height: 200px;
    }
}

/* Çok küçük mobil ekranlar için */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 15px 0 30px;
        padding: 0;
    }
    
    .product-card {
        min-height: 380px;
        max-width: calc(100vw - 20px);
        margin: 0 auto;
    }
    
    .product-image {
        height: 180px;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
}

/* Modal Stilleri */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    
    /* iOS Safari fix */
    -webkit-overflow-scrolling: touch;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* iOS Safari viewport fix */
    max-height: min(75vh, calc(100% - 60px));
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 0 24px 24px;
    overflow-y: auto;
    flex: 1;
    /* Smooth scrolling */
    -webkit-overflow-scrolling: touch;
}

.modal-product-info {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-product-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.modal-product-details {
    flex: 1;
}

.modal-description {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}

.modal-price .period {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
}

.rental-options {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
}

.options-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.option-group {
    flex: 1;
    margin-bottom: 0;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.quantity-controls,
.duration-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #f0f7ff;
}

.quantity-btn:active {
    transform: scale(0.95);
}

#rentalQuantity,
#rentalDuration {
    width: 70px;
    height: 36px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    color: #374151;
    background: white;
}

.duration-limit {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
    display: block;
    font-style: italic;
}

.total-calculation {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid #e5e7eb;
}

.calculation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.calculation-row.total {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2563eb;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.modal-btn.secondary:hover {
    background: #e5e7eb;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
}

.modal-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: min(70vh, calc(100% - 100px));
        /* iOS Safari viewport fix for mobile */
        max-height: min(70vh, calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 100px));
    }
    
    .modal-product-info {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-product-image {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
    
    .options-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.whatsapp-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    animation: whatsappPulse 2s infinite;
}

.whatsapp-link:hover {
    background: #128c7e;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.whatsapp-link i {
    animation: whatsappBounce 1s ease-in-out infinite alternate;
}

.whatsapp-tooltip {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 6px solid transparent;
    border-top-color: #333;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* WhatsApp Animations */
@keyframes whatsappPulse {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.7), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

@keyframes whatsappBounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-3px);
    }
}

/* Responsive WhatsApp Button */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-link {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .whatsapp-tooltip {
        font-size: 12px;
        padding: 6px 10px;
        bottom: 60px;
    }
}

/* iOS Safari Modal Fix */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    -webkit-overflow-scrolling: touch;
}

/* iOS Safari viewport height fix */
@supports (-webkit-touch-callout: none) {
    .product-modal {
        height: -webkit-fill-available;
    }
    
    .modal-content {
        max-height: min(70vh, -webkit-fill-available - 100px) !important;
    }
}
