* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #1b2430;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 20px 50px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    gap: 20px;
}

.topbar h1 {
    font-size: 2.1rem;
    margin: 0;
}

.admin-link {
    display: inline-block;
    background: #1b2430;
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
}

.compare-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.08);
    padding: 26px 22px 18px;
}

.compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 20px;
}

.compare-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    min-height: 500px;
}

.product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
    border: 1px solid #e1e7f0;
    border-radius: 16px;
    min-height: 450px;
    padding: 18px 18px 16px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(31, 41, 55, 0.12);
}

.product-card.featured {
    border-color: #ffcc4d;
    box-shadow: inset 0 0 0 1px rgba(255, 204, 77, 0.5);
}

.product-card .badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffcc4d;
    color: #1b2430;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 10px;
}

.card-top {
    padding-top: 18px;
}

.product-name {
    font-size: 1.7rem;
    margin: 0 0 10px;
    font-weight: 700;
    line-height: 1.2;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.price-main {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0d7a40;
}

.old-price {
    font-size: 1rem;
    text-decoration: line-through;
    color: #8893a3;
}

.product-description {
    margin: 0 0 16px;
    color: #4b5563;
    line-height: 1.5;
    min-height: 72px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
}

.feature-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: #344054;
    font-size: 0.95rem;
}

.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #0d7a40;
    font-weight: 800;
}

.card-actions {
    margin-top: auto;
}

.cta-button {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #0d7a40 0%, #0a5f35 100%);
    color: #fff;
    text-decoration: none;
    text-align: center;
    border-radius: 10px;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 1rem;
}

.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 10px;
}

.page-btn,
.nav-btn {
    background: #eef3fb;
    border: 1px solid #d9e1f2;
    color: #1b2430;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.page-btn.active {
    background: #1b2430;
    color: #fff;
    border-color: #1b2430;
}

.mobile-controls {
    display: none;
}

@media (max-width: 767px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .compare-grid {
        grid-template-columns: 1fr;
        min-height: 440px;
    }

    .product-card {
        min-height: 420px;
        display: none;
    }

    .product-card.visible {
        display: flex;
    }

    .compare-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-controls {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 18px;
    }

    .mobile-page-counter {
        font-weight: 700;
        color: #344054;
    }

    .nav-btn {
        padding: 10px 14px;
    }

    .pager {
        display: none;
    }
}

.admin-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 50px;
}

.admin-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.08);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
    color: #344054;
}

input, textarea, button {
    font: inherit;
}

input, textarea {
    width: 100%;
    border: 1px solid #d5dce7;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

.primary-btn,
.secondary-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
}

.primary-btn {
    background: #0d7a40;
    color: #fff;
}

.secondary-btn {
    background: #eef3fb;
    color: #1b2430;
    border: 1px solid #d9e1f2;
}

.buttons-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.status {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #edf8f2;
    color: #0d7a40;
    border: 1px solid #cfead9;
    display: none;
}

.status.error {
    background: #fff1f1;
    color: #a62828;
    border-color: #f0c8c8;
}

.table-wrap {
    margin-top: 24px;
    overflow-x: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.product-table th,
.product-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.product-table th {
    background: #f8fafc;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #465266;
}

.inline-btn {
    display: inline-block;
    background: #eef3fb;
    border: 1px solid #d9e1f2;
    border-radius: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #1b2430;
    font-weight: 700;
    margin-right: 8px;
    margin-bottom: 6px;
}

.delete-btn {
    background: #fdecec;
    border-color: #f2c3c3;
    color: #9b2c2c;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}
