/**
 * Responsywność i dodatkowe style dla mniejszych ekranów
 */

/* === CATEGORY PAGE === */
.category-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin-top: 30px;
}

.sidebar {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}

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

.filter-group h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

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

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-option label {
    cursor: pointer;
    font-size: 14px;
}

/* === PRODUCT DETAIL === */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.product-gallery {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.main-image {
    width: 100%;
    height: 500px;
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    cursor: pointer;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.gallery-thumb {
    width: 100%;
    height: 80px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: var(--secondary-color);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details h1 {
    margin-bottom: 10px;
}

.product-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.product-price-large {
    font-size: 32px;
    font-weight: bold;
    color: var(--secondary-color);
}

.add-to-cart-form {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.quantity-selector label {
    font-weight: 500;
}

.quantity-selector input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

.specifications {
    margin-top: 40px;
}

.specifications h2 {
    margin-bottom: 20px;
}

.specifications table {
    width: 100%;
    border-collapse: collapse;
}

.specifications th,
.specifications td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.specifications th {
    background: var(--bg-light);
    font-weight: 500;
}

/* === CART === */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.cart-table th {
    background: var(--bg-light);
    font-weight: 500;
}

.cart-table img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-quantity input {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.cart-summary {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-top: 30px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.cart-summary-row.total {
    font-size: 24px;
    font-weight: bold;
    border: none;
}

/* === CHECKOUT === */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin-top: 30px;
}

.checkout-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.checkout-section h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.address-option,
.payment-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.address-option:hover,
.payment-option:hover {
    border-color: var(--secondary-color);
    background: var(--bg-light);
}

.address-option input[type="radio"],
.payment-option input[type="radio"] {
    margin-top: 3px;
}

.order-summary {
    position: sticky;
    top: 20px;
}

.order-items {
    margin-bottom: 20px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

/* === ACCOUNT PAGES === */
.account-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin-top: 30px;
}

.account-sidebar {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}

.account-sidebar ul {
    list-style: none;
}

.account-sidebar li {
    margin-bottom: 10px;
}

.account-sidebar a {
    display: block;
    padding: 10px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

.account-sidebar a:hover,
.account-sidebar a.active {
    background: var(--secondary-color);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.orders-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.orders-table th,
.orders-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.orders-table th {
    background: var(--bg-light);
    font-weight: 500;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

/* === LIGHTBOX === */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

/* === TABLET === */
@media (max-width: 1024px) {
    .category-layout {
        grid-template-columns: 200px 1fr;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    .order-summary {
        position: static;
    }
}

/* === MOBILE === */
@media (max-width: 768px) {
    .category-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        margin-bottom: 20px;
    }
    
    .account-layout {
        grid-template-columns: 1fr;
    }
    
    .main-image {
        height: 300px;
    }
    
    .cart-table {
        font-size: 14px;
    }
    
    .cart-table img {
        width: 60px;
        height: 60px;
    }
    
    .cart-table th:nth-child(1),
    .cart-table td:nth-child(1) {
        display: none;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* === UTILITY CLASSES === */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}
