/* Products Page Specific Styles */

/* Page Header */
.page-header {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)),
                url('https://images.unsplash.com/photo-1619642751034-765dfdf7c58e?w=1600') center/cover;
    padding: 150px 0 100px;
    margin-top: 60px;
    text-align: center;
    color: white;
}

/* Fix for mobile view - ensure content is not hidden behind fixed navbar */
@media (max-width: 768px) {
    .page-header {
        padding-top: 180px;
    }
    
    /* Ensure proper spacing for scroll animations on mobile */
    .shop-main {
        padding-top: 140px; /* Navbar için boşluk */
    }
}

.page-header h1 {
    font-size: 48px;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.page-header p {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 20px;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb span {
    color: var(--text-gray);
}

/* Shop Layout */
.shop-main {
    background: #f8f9fa;
    padding: 60px 0;
    padding-top: 140px; /* Navbar için boşluk */
    margin-top: 0;
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* Sidebar */
.shop-sidebar {
    background: white;
    padding: 25px;
    border-radius: 10px;
    height: fit-content;
    position: sticky;
    top: 120px; /* Navbar yüksekliği + padding */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 10; /* Navbar'dan düşük ama içerikten yüksek */
}

.filter-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--dark-bg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-section h3 i {
    color: var(--primary-color);
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 16px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

.filter-item:hover {
    background: #f8f9fa;
}

.filter-item input[type="checkbox"],
.filter-item input[type="radio"] {
    cursor: pointer;
}

.filter-item span {
    flex: 1;
    font-size: 14px;
    color: #555;
}

.filter-item .count {
    font-size: 12px;
    color: #999;
}

.price-range {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-inputs input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.range-inputs span {
    color: #999;
}

.btn-filter {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-filter:hover {
    background: var(--secondary-color);
}

.info-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-box p {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box i {
    color: var(--primary-color);
    font-size: 14px;
}

/* Shop Content */
.shop-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.shop-toolbar {
    background: white;
    padding: 20px 25px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.result-count {
    font-size: 15px;
    color: #666;
}

.result-count strong {
    color: var(--primary-color);
    font-size: 18px;
}

.sort-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-form label {
    font-size: 14px;
    color: #666;
}

.sort-form select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Product Card Animations */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
    position: relative;
    transform: translateY(30px);
}

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

.product-image {
    position: relative;
    overflow: hidden;
    height: 280px;
}

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

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

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

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

.btn-view {
    background: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-view:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.out-of-stock-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #e74c3c;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.product-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--dark-bg);
    min-height: 45px;
}

.product-info > p {
    color: #666;
    font-size: 13px;
    margin-bottom: 15px;
    min-height: 40px;
}

.btn-cart.disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-cart.disabled:hover {
    background: #ccc;
    transform: none;
}

/* No Products */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
}

.no-products i {
    font-size: 64px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.no-products h3 {
    font-size: 28px;
    color: var(--dark-bg);
    margin-bottom: 15px;
}

.no-products p {
    color: #666;
    margin-bottom: 30px;
}

/* Cart Icon */
.cart-icon-wrapper {
    position: relative;
    margin-left: 20px;
    cursor: pointer;
    color: white;
    font-size: 20px;
    text-decoration: none;
    transition: color 0.3s;
}

.cart-icon-wrapper:hover {
    color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Cart popup */
.cart-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1200;
}

.cart-popup-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.cart-popup {
    background: #ffffff;
    color: #1a1a1a;
    padding: 28px 30px;
    border-radius: 16px;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.25);
    width: min(360px, 90vw);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: cartPopIn 0.35s ease;
}

.cart-popup::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(243, 156, 18, 0.15), transparent 40%),
                radial-gradient(circle at 80% 10%, rgba(230, 126, 34, 0.12), transparent 40%),
                radial-gradient(circle at 50% 80%, rgba(243, 156, 18, 0.1), transparent 40%);
    pointer-events: none;
}

.cart-popup-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: grid;
    place-items: center;
    font-size: 26px;
    margin: 0 auto 12px;
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.4);
    animation: pulseGlow 1.8s ease infinite;
}

.cart-popup h4 {
    margin-bottom: 6px;
    font-size: 20px;
    color: var(--dark-bg);
}

.cart-popup p {
    color: #4a4a4a;
    margin-bottom: 14px;
    font-size: 14px;
}

.cart-popup .product-name {
    font-weight: 700;
    color: var(--primary-color);
}

.cart-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.cart-popup-actions a {
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cart-popup-actions .btn-go-cart {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 8px 18px rgba(243, 156, 18, 0.35);
}

.cart-popup-actions .btn-continue {
    background: #f4f4f4;
    color: #2c3e50;
    border: 1px solid #eee;
}

.cart-popup-actions a:hover {
    transform: translateY(-1px);
}

@keyframes cartPopIn {
    0% {
        transform: translateY(10px) scale(0.94);
        opacity: 0;
    }
    60% {
        transform: translateY(-4px) scale(1.02);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.35); }
    70% { box-shadow: 0 0 0 12px rgba(243, 156, 18, 0); }
    100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0); }
}

/* Product detail page */
.product-detail-section {
    background: #f8f9fa;
    padding: 80px 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: start;
}

.product-detail-image img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    object-fit: cover;
}

.product-detail-info h1 {
    font-size: 32px;
    color: var(--dark-bg);
    margin-bottom: 12px;
}

.product-price {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.product-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 18px;
}

.product-features-list,
.product-specs-list {
    list-style: none;
    display: grid;
    gap: 12px;
    padding: 0;
}

.product-specs-list li {
    display: flex;
    justify-content: space-between;
    background: white;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #eee;
    font-size: 14px;
    color: #444;
}

.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0 16px;
}

.quantity-selector button {
    background: #f4f4f4;
    border: none;
    padding: 10px 14px;
    font-size: 16px;
    cursor: pointer;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    border: none;
    padding: 10px 0;
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(243, 156, 18, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.add-to-cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(243, 156, 18, 0.4);
}

.related-products {
    margin-top: 60px;
}

.related-products h2 {
    margin-bottom: 24px;
    color: var(--dark-bg);
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.related-products-grid .product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.related-products-grid .product-image {
    width: 40%;
    min-width: 160px;
    height: auto;
    min-height: 180px;
    flex-shrink: 0;
}

.related-products-grid .product-image img {
    object-fit: cover;
    height: 100%;
}

.related-products-grid .product-info {
    display: flex;
    flex-direction: column;
    padding: 18px;
    flex: 1;
    width: 60%;
}

.related-products-grid .product-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
    min-height: auto;
    line-height: 1.3;
}

.related-products-grid .product-info > p {
    font-size: 13px;
    margin-bottom: 12px;
    min-height: auto;
    flex: 1;
    line-height: 1.4;
}

.related-products-grid .product-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.related-products-grid .product-footer .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.related-products-grid .btn-cart {
    padding: 10px 14px;
    font-size: 12px;
    width: 100%;
}

.related-products-grid .product-overlay {
    display: none;
}

@media (max-width: 1024px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-products-grid .product-card {
        flex-direction: column;
    }
    
    .related-products-grid .product-image {
        width: 100%;
        min-height: 200px;
    }
    
    .related-products-grid .product-info {
        width: 100%;
    }
}

/* Mobile adjustments */
@media (max-width: 900px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }

    .product-detail-section {
        padding: 50px 0;
    }

    .product-detail-image img {
        max-height: 420px;
    }
}

@media (max-width: 600px) {
    .product-detail-section {
        padding: 40px 0;
    }

    .product-detail-info h1 {
        font-size: 26px;
    }

    .product-price {
        font-size: 22px;
    }

    .product-specs-list li {
        flex-direction: column;
        gap: 6px;
    }

    .add-to-cart-btn {
        width: 100%;
        text-align: center;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .shop-layout {
        grid-template-columns: 250px 1fr;
        gap: 30px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    
    .shop-sidebar {
        position: static;
        margin-bottom: 30px;
    }
    
    /* IMPROVED: Single column for mobile products */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Ensure product cards take full width on mobile */
    .product-card {
        width: 100%;
        max-width: 100%;
        /* Ensure smooth animations on mobile devices */
        will-change: transform, opacity;
        backface-visibility: hidden;
    }
    
    .product-image {
        height: 250px;
    }

    .shop-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .sort-form {
        justify-content: space-between;
    }

    .page-header {
        padding: 120px 0 60px;
    }

    .page-header h1 {
        font-size: 32px;
    }
    
    /* Ensure proper container padding on mobile */
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .range-inputs {
        flex-direction: column;
        gap: 5px;
    }

    .range-inputs span {
        display: none;
    }

    .product-footer {
        flex-direction: column;
        gap: 10px;
    }

    .btn-cart {
        width: 100%;
    }
    
    /* IMPROVED: Even better spacing for small mobile */
    .products-grid {
        gap: 15px;
    }
    
    .product-card {
        border-radius: 10px;
    }
    
    .product-image {
        height: 220px;
    }
    
    .product-info {
        padding: 20px 15px;
    }
}
