.detail-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

.detail-card {
    display: flex;
    gap: 36px;
    align-items: flex-start;
    flex-wrap: wrap;
    position: relative;
}

.detail-image {
    flex: 0 0 320px;
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
}

.detail-image img {
    max-width: 320px;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    background: #f8f8f8;
    padding: 10px;
}

.detail-info {
    flex: 1;
    min-width: 260px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    /* umožní umístit back-link absolutně */
}

.detail-info h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 2rem;
    color: #222;
    word-break: break-word;
}

.detail-price {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1976d2;
}

.detail-desc {
    margin-bottom: 18px;
    color: #444;
    font-size: 1.08em;
    line-height: 1.5;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 18px;
    background: #f7f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.detail-table tr {
    border-bottom: 1px solid #f0f0f0;
}
.detail-table tr:last-child {
    border-bottom: none;
}

.detail-table th {
    text-align: left;
    color: #888;
    font-weight: 500;
    padding: 8px 12px 8px 0;
    width: 140px;
    vertical-align: top;
    background: #f2f4f7;
    font-size: 1em;
}

.detail-table td {
    color: #222;
    padding: 8px 0 8px 0;
    font-size: 1em;
    background: #fff;
}

.back-link {
    display: inline-block;
    margin-top: 10px;
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
    font-size: 1.08em;
    padding: 2px 0;
    border-bottom: 1px dotted #1976d2;
}
.back-link:hover {
    color: #0d47a1;
    text-decoration: underline;
}

.add-to-cart-form {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.add-to-cart-form label {
    font-size: 1em;
    color: #333;
}
.add-to-cart-form input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #bbb;
    border-radius: 5px;
    font-size: 1em;
    width: 60px;
}
.add-to-cart-btn {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 7px 16px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.15s;
}
.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.add-to-cart-btn:hover:not(:disabled) {
    background: #1256a3;
}

.gallery-container {
    position: relative;
    width: 320px;
    margin: 0 auto 18px auto;
    overflow: hidden;
    background: #f8f8f8;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 10px;
}
.gallery-main-img {
    width: 100%;
    height: 320px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #ddd;
    transition: transform 0.2s;
    cursor: zoom-in;
    display: block;
    will-change: transform;
}
.gallery-main-img.zoomed {
    z-index: 10;
    cursor: zoom-out;
    box-shadow: 0 0 12px rgba(0,0,0,0.18);
}
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #bbb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: background 0.15s, color 0.15s;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.4em;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    user-select: none;
}
.gallery-arrow:hover {
    background: #1976d2;
    color: #fff;
}
.gallery-arrow.left { left: 2px; }
.gallery-arrow.right { right: 2px; }
.gallery-thumbs {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
}
.gallery-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 2px solid transparent;
    background: #fff;
    cursor: pointer;
    transition: border 0.15s;
}
.gallery-thumb.active {
    border: 2px solid #388e3c;
    box-shadow: 0 0 6px #388e3c33;
    background: #e8f5e9;
}

/* --- RESPONSIVE --- */
@media (min-width: 701px) {
    .add-to-cart-form {
        justify-content: flex-end;
    }
    .detail-info {
        min-height: 340px;
        padding-bottom: 36px;
    }
    .back-link {
        position: absolute;
        left: 0;
        bottom: 0;
        margin-top: 0;
        font-size: 1em;
    }
}

@media (max-width: 900px) {
    .detail-container {
        padding: 10px 2vw;
        margin: 18px auto;
        border-radius: 8px;
    }
    .detail-card {
        gap: 18px;
    }
    .detail-image {
        max-width: 100%;
        width: 100%;
    }
    .gallery-container,
    .detail-image img {
        max-width: 100%;
        width: 100%;
    }
    .gallery-main-img {
        height: 220px;
    }
}

@media (max-width: 700px) {
    .detail-card {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }
    .detail-image,
    .gallery-container,
    .detail-image img {
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
    }
    .gallery-main-img {
        height: 180px;
    }
    .detail-info h2 {
        font-size: 1.3rem;
    }
    .detail-price {
        font-size: 1.1rem;
    }
    .detail-table th,
    .detail-table td {
        font-size: 0.98em;
        padding: 6px 4px;
    }
    .detail-table th {
        width: 110px;
    }
    .add-to-cart-form {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        justify-content: flex-start;
    }
    .back-link {
        position: static;
        margin-top: 8px;
        font-size: 0.98em;
    }
    .gallery-thumbs {
        justify-content: center;
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

@media (max-width: 480px) {
    .detail-container {
        padding: 4px 0;
        border-radius: 0;
        box-shadow: none;
    }
    .gallery-main-img {
        height: 120px;
    }
    .gallery-thumb {
        width: 36px;
        height: 36px;
    }
    .detail-table th {
        width: 80px;
        padding-right: 2px;
    }
    .detail-info h2 {
        font-size: 1.08rem;
    }
    .detail-desc {
        font-size: 0.97em;
    }
}

/* Zlepšení notifikací */
.notification {
    position: fixed;
    top: 18px;
    right: 18px;
    background: #388e3c;
    color: #fff;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 1.08em;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 9999;
}
.notification.show {
    opacity: 1;
    transform: translateY(0);
}
.notification:not(.show) {
    transform: translateY(-20px);
}
