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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #e1e0dd; /*FFF186*/
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column; 
}

.wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Top bar */
.top-bar {
    background: #222;
    color: #bebebe;
    font-size: 13px;
    padding: 6px 0;
}

.top-bar .wrapper {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.admin-header {
}

.top-bar-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.top-bar-info a {
    color: #bebebe;
    text-decoration: none;
}

.top-bar-info a:hover {
    color: #fff;
}

/* Header */
.header {
    background: #202020;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header .wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.logo img {
    max-height: 34px;
    display: block;
    flex-shrink: 0;
    margin: 10px 0 10px 0;
}

/* Search form */
.search-form {
    --timing: 0.3s;
    --width-of-input: 220px;
    --height-of-input: 36px;
    --border-height: 2px;
    --input-bg: #333;
    --border-color: #e0c800;
    --border-radius: 30px;
    --after-border-radius: 1px;
    position: relative;
    width: var(--width-of-input);
    height: var(--height-of-input);
    display: flex;
    align-items: center;
    padding-inline: 0.8em;
    border-radius: var(--border-radius);
    transition: border-radius 0.5s ease;
    background: var(--input-bg,#333);
    flex-shrink: 0;
}

.search-input {
    font-size: 0.85rem;
    background-color: transparent;
    width: 100%;
    height: 100%;
    padding-inline: 0.5em;
    padding-block: 0.6em;
    border: none;
    outline: none;
    color: #e0e0e0;
}

.search-input::placeholder {
    color: #999;
}

.search-form:before {
    content: "";
    position: absolute;
    background: var(--border-color);
    transform: scaleX(0);
    transform-origin: center;
    width: 100%;
    height: var(--border-height);
    left: 0;
    bottom: 0;
    border-radius: 1px;
    transition: transform var(--timing) ease;
}

.search-form:focus-within {
    border-radius: var(--after-border-radius);
}

.search-form:focus-within:before {
    transform: scale(1);
}

.search-btn {
    border: none;
    background: none;
    color: #bbb;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.search-btn:hover {
    color: #e0c800;
}

.search-reset {
    border: none;
    background: none;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: #999;
}

.search-reset svg {
    width: 14px;
    height: 14px;
}

.search-input:not(:placeholder-shown) ~ .search-reset {
    opacity: 1;
    visibility: visible;
}

.search-form svg {
    width: 17px;
    margin-top: 3px;
}

/* Navigation inside header */
.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    gap: 2px;
}

.nav-menu > li {
    position: relative;
}

.nav-link {
    text-decoration: none;
    outline: none;
    color: #ccc;
    display: block;
    position: relative;
    /* margin: 4px 0 4px 0; */
}

.dropdown > .nav-link::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 12px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    font-size: 14px;
    position: relative;
}

.nav-btn::after {
    content: "";
    position: absolute;
    bottom: 2px;
    right: 10px;
    left: 10px;
    height: 2px;
    background: #e0c800;
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.2s;
}

.nav-link:hover .nav-btn,
.nav-link:focus-visible .nav-btn {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-link:hover .nav-btn::after {
    transform: scaleX(1);
}

.nav-link.nav-active .nav-btn::after {
    transform: scaleX(1);
}

.nav-link.nav-active .nav-btn {
    color: #fff;
}

.nav-btn svg {
    flex-shrink: 0;
}

.nav-btn .dropdown-arrow {
    transition: transform 0.2s;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown - first level */
.nav-menu .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2a2a2a;
    min-width: 260px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 1003;
    list-style: none;
    padding: 4px;
    margin: 4px 0 0 0;
    border-radius: 8px;
}

.nav-menu .dropdown-menu > li {
    position: relative;
}

.nav-menu .dropdown-menu > li > a {
    display: block;
    padding: 8px 12px;
    color: #ccc;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.nav-menu .dropdown-menu > li > a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-menu .dropdown-submenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    z-index: 1004;
    background: #2a2a2a;
    min-width: 240px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    list-style: none;
    padding: 4px;
    margin: 0;
    border-radius: 8px;
}

.nav-menu .dropdown-submenu li a {
    display: block;
    padding: 8px 12px;
    color: #ccc;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.nav-menu .dropdown-submenu li a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Hover to show dropdowns */
.nav-menu .dropdown:hover > .dropdown-menu {
    display: block;
}

.nav-menu .has-submenu:hover > .dropdown-submenu {
    display: block;
}

/* Arrow indicator for items with submenu */
.nav-menu .has-submenu > a::after {
    content: "►";
    float: right;
    font-size: 8px;
    margin-left: 8px;
    color: #999;
    line-height: 1.6;
}

/* Main content */
.main {
    padding: 30px 0;
    flex: 1;
    animation: fadeSlideIn 0.4s ease-out;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero */
.hero {
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url('/images/uzlet.webp');
    background-size: cover;
    background-position: center;
    color: #fff;
    /*text-align: center;*/
    padding: 100px 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    background-color: #555;
    background-blend-mode: overlay;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 10px;
    font-weight: 700;
}

.hero p {
    font-size: 18px;
    opacity: 0.95;
    /*max-width: 600px;*/
    margin: 0 auto;
}

.hero .hero-sub {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 20px;
    display: block;
}

a[href^="mailto:"], a[href^="tel:"] {
    text-decoration: none;
}

iframe {
    display: block;
}

/* Page title */
.page-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #e0c800;
}

/* Category grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    background: #ddd;
}

.category-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.category-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75) 60%);
    padding: 30px 16px 14px;
}

.category-card h3 {
    font-size: 15px;
    color: #fff;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.category-card .count {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    display: block;
    margin-top: 2px;
}

/* Subcategory list */
.subcategory-list {
    list-style: none;
    margin-bottom: 30px;
}

.subcategory-list li {
    margin-bottom: 10px;
}

.subcategory-list a {
    display: block;
    background: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.subcategory-list a:hover {
    transform: translateX(5px);
}

.subcategory-list .count {
    font-size: 12px;
    color: #888;
    margin-left: 10px;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.product-card .info {
    padding: 15px;
}

.product-card .info h3 {
    font-size: 15px;
    margin-bottom: 8px;
}

.product-card .info .price {
    font-size: 18px;
    font-weight: 700;
    color: #c00;
}

.product-card .info .price-label {
    font-size: 12px;
    color: #888;
}

/* Product detail */
.product-detail {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-detail h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
}

/* Gallery */
.gallery {
    display: flex;
    flex-direction: column;
}

.gallery-main {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 10px;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gallery-thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.gallery-thumbs img:hover, .gallery-thumbs img.active {
    border-color: #e0c800;
}

/* Description */
.description {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    line-height: 1.8;
}

/* Variants table */
.variants-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.variants-table th, .variants-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.variants-table th {
    background: #f9f9f9;
    font-weight: 600;
    font-size: 14px;
}

.variants-table .price {
    font-weight: 700;
    color: #c00;
}

/* Admin */
.admin-header {
    background: #c00;
    color: #fff;
    padding: 10px 0;
}

.admin-header .wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.admin-header a:hover {
    text-decoration: underline;
}

.admin-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-section h1, .admin-section h2, .admin-section h3,
.admin-section h4, .admin-section h5, .admin-section h6 {
    margin: 1.2em 0 0.5em;
    color: #222;
}
.admin-section h1 { font-size: 28px; }
.admin-section h2 { font-size: 24px; }
.admin-section h3 { font-size: 20px; }
.admin-section p { margin-bottom: 1em; }
.admin-section ul, .admin-section ol { margin: 0 0 1em 1.5em; }
.admin-section li { margin-bottom: 0.3em; }
.admin-section a { color: #0055cc; text-decoration: underline; }
.admin-section blockquote {
    border-left: 4px solid #e0c800;
    padding: 10px 20px;
    margin: 1em 0;
    background: #fafafa;
    color: #555;
}
.admin-section pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}
.admin-section code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
}
.admin-section pre code {
    background: none;
    padding: 0;
}
.admin-section img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1em 0;
}

.admin-section h2 {
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

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

.admin-card {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
}

.admin-card h4 {
    margin-bottom: 8px;
}

.admin-card .sub-items {
    list-style: none;
    margin-top: 8px;
    font-size: 13px;
}

.admin-card .sub-items li {
    padding: 3px 0;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: #e0c800;
    color: #333;
}

.btn-primary:hover {
    background: #d4bc00;
}

.btn-danger {
    background: #c00;
    color: #fff;
}

.btn-danger:hover {
    background: #a00;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-secondary {
    background: #666;
    color: #fff;
}

.btn-secondary:hover {
    background: #555;
}

.admin-actions {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

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

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

.text-center {
    text-align: center;
}

/* Form styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.form-row input {
    flex: 1;
}

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

.lightbox.active {
    display: flex;
}

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

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
}

/* Alert */
.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
.footer {
    background: #333;
    color: #aaa;
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    margin-top: 40px;
}

.footer a {
    color: #ddd;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Admin back link */
.back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Type pricing blocks (product detail) */
.type-pricing {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.type-pricing:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.type-pricing h3 {
    font-size: 16px;
    color: #444;
    margin-bottom: 5px;
}

/* Admin type blocks */
.type-block {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.type-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.type-header .type-name {
    flex: 1;
}

.type-variants {
    margin-bottom: 8px;
}

.variant-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.variant-row input {
    flex: 1;
}

.variant-row .remove-variant {
    flex: 0 0 30px;
}
