/**
 * Frontend CSS - Styly pro e-shop (zákaznická část)
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #4CAF50;
    --danger: #f44336;
    --warning: #ff9800;
    --light: #f5f5f5;
    --dark: #333;
    --border: #ddd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.6;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.logo:hover {
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 24px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Category Menu */
.category-menu {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 70px;
    z-index: 999;
}

.category-menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    gap: 20px;
    overflow-x: auto;
}

.category-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.category-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: var(--primary);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

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

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: var(--light);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.badge-new {
    background: var(--success);
}

.badge-sale {
    background: var(--danger);
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 15px;
}

.product-price-from {
    font-size: 14px;
    color: #999;
    font-weight: normal;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.btn-block {
    width: 100%;
}

/* Product Detail */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.product-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    aspect-ratio: 1;
    background: var(--light);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.05);
}

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

.product-detail-price {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 30px;
}

.variants-section {
    margin-bottom: 30px;
}

.variants-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--dark);
}

.variant-options {
    display: grid;
    gap: 10px;
}

.variant-option {
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.variant-option:hover {
    border-color: var(--primary);
}

.variant-option.selected {
    border-color: var(--primary);
    background: #f0f4ff;
}

.variant-price {
    font-weight: bold;
    color: var(--primary);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: right 0.3s;
    overflow-y: auto;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.cart-items {
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-variant {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.cart-item-price {
    font-weight: bold;
    color: var(--primary);
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 20px;
}

.cart-footer {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 20px;
}

.cart-total {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none;
}

.cart-overlay.show {
    display: block;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-social a {
    color: white;
    font-size: 24px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-social a:hover {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    opacity: 0.7;
}

/* GDPR Cookies */
.cookies-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 25px;
    z-index: 3000;
    display: none;
}

.cookies-banner.show {
    display: block;
}

.cookies-banner h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.cookies-banner p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.cookies-buttons {
    display: flex;
    gap: 10px;
}

.btn-accept {
    background: var(--success);
    color: white;
}

.btn-decline {
    background: #999;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #666;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid var(--light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .product-detail-container {
        grid-template-columns: 1fr;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .cookies-banner {
        left: 10px;
        right: 10px;
    }
}

/* Utility */
.text-center { text-align: center; }
.mt-30 { margin-top: 30px; }
.mb-30 { margin-bottom: 30px; }

/* Notifikace */
.notification {
    position: fixed;
    top: 100px;
    right: -400px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transition: right 0.3s ease;
    max-width: 350px;
}

.notification.show {
    right: 20px;
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-success i {
    color: var(--success);
    font-size: 20px;
}

.notification-info {
    border-left: 4px solid var(--primary);
}

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

.notification-error {
    border-left: 4px solid var(--danger);
}

.notification-error i {
    color: var(--danger);
    font-size: 20px;
}

/* Animace přidání do košíku */
.add-to-cart.added,
.add-to-cart-detail.added {
    animation: addToCartPulse 0.6s ease;
}

@keyframes addToCartPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Sticky header při scrollování */
.header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state i {
    font-size: 80px;
    color: var(--border);
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--dark);
}

.empty-state p {
    color: #666;
    margin-bottom: 30px;
}

/* Search & Sort controls */
.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.products-count {
    color: #666;
    font-size: 14px;
}

.catalog-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-form {
    flex: 1;
    max-width: 400px;
}

.search-input {
    display: flex;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.search-input input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
}

.search-input input:focus {
    outline: none;
}

.search-input button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-input button:hover {
    background: var(--primary-dark);
}

.sort-form select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

.sort-form select:focus {
    outline: none;
    border-color: var(--primary);
}

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

.product-gallery .main-image {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f9f9f9;
}

.product-gallery .main-image a {
    display: block;
}

.product-gallery .main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnail-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.thumbnail {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s;
    display: block;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary);
}

.thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.product-info-detail h1 {
    font-size: 32px;
    margin-bottom: 15px;
}

.product-perex {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
}

.product-price-box {
    background: var(--light);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.price-old-large {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 5px;
}

.price-current-large {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.price-vat {
    font-size: 14px;
    color: #666;
}

.price-badge {
    display: inline-block;
    background: var(--danger);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-variants {
    margin-bottom: 25px;
}

.product-variants label {
    display: block;
    margin-bottom: 8px;
}

.product-variants select,
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.product-variants select:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.product-meta {
    margin-bottom: 15px;
    font-size: 14px;
}

.meta-label {
    color: #666;
    margin-right: 8px;
}

.meta-value {
    font-weight: 500;
}

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

.meta-value a:hover {
    text-decoration: underline;
}

.product-actions {
    margin: 30px 0;
}

.product-features {
    background: var(--light);
    padding: 20px;
    border-radius: 12px;
}

.feature-item-small {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 14px;
}

.feature-item-small i {
    color: var(--success);
    font-size: 18px;
}

.product-description-section {
    margin-top: 50px;
    padding-top: 50px;
    border-top: 1px solid var(--border);
}

.product-description-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

.product-description-content {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
}

.related-products-section {
    margin-top: 50px;
    padding-top: 50px;
    border-top: 1px solid var(--border);
}

.related-products-section h2 {
    font-size: 28px;
    margin-bottom: 30px;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .catalog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .catalog-controls {
        width: 100%;
        flex-direction: column;
    }

    .search-form {
        max-width: 100%;
        width: 100%;
    }

    .notification {
        right: -100%;
        max-width: calc(100% - 40px);
    }

    .notification.show {
        right: 20px;
    }

    .product-detail {
        grid-template-columns: 1fr;
    }

    .thumbnail-images {
        grid-template-columns: repeat(3, 1fr);
    }

    .price-current-large {
        font-size: 28px;
    }

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