/* ===== Reset & baza ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ee4266;
    --primary-dark: #d62f52;
    --secondary: #2b3a67;
    --accent: #06d6a0;
    --bg: #f4f5f7;
    --white: #ffffff;
    --text: #1f2430;
    --muted: #7a828e;
    --border: #e4e7eb;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --radius: 10px;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

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

.site-main {
    min-height: 60vh;
    padding-bottom: 40px;
}

/* ===== Butoane ===== */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-hero {
    background: #fff;
    color: var(--primary);
    padding: 14px 32px;
    font-size: 17px;
}

.btn-hero:hover {
    background: #f0f0f0;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: #f0f0f0;
}

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

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

.btn-link {
    background: transparent;
    color: var(--primary);
}

.btn-disabled,
.btn:disabled {
    background: #cfd3d8;
    color: #fff;
    cursor: not-allowed;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ===== Header ===== */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 20px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary);
    white-space: nowrap;
}

.logo span {
    color: var(--primary);
}

.logo.center {
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.search-bar {
    flex: 1;
    display: flex;
    max-width: 600px;
}

.search-bar input {
    flex: 1;
    padding: 11px 16px;
    border: 2px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 15px;
    outline: none;
}

.search-bar input:focus {
    border-color: var(--primary);
}

.search-bar button {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 0 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    font-size: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-link {
    font-weight: 600;
    color: var(--text);
    position: relative;
    white-space: nowrap;
}

.header-link:hover {
    color: var(--primary);
}

.cart-badge {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    padding: 2px 7px;
    position: absolute;
    top: -10px;
    right: -14px;
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 60px 0;
    margin-bottom: 30px;
}

.hero-content h1 {
    font-size: 40px;
    margin-bottom: 12px;
}

.hero-content p {
    font-size: 19px;
    margin-bottom: 24px;
    opacity: 0.95;
}

/* ===== Chips categorii ===== */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.chip {
    background: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    font-weight: 600;
    font-size: 14px;
}

.chip:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== Sectiuni ===== */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 18px;
}

.section-head h2 {
    font-size: 24px;
}

.link-more {
    color: var(--primary);
    font-weight: 600;
}

.results-count {
    color: var(--muted);
    font-size: 14px;
}

.page-title {
    font-size: 28px;
    margin: 24px 0;
}

/* ===== Grid produse ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-thumb {
    position: relative;
    aspect-ratio: 1;
    background: #f0f0f0;
    overflow: hidden;
}

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

.badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
}

.badge-discount.big {
    font-size: 18px;
    padding: 8px 12px;
}

.badge-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #555;
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
}

.product-info {
    padding: 12px 14px;
    flex: 1;
}

.product-brand {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.product-brand.big {
    font-size: 14px;
}

.product-name {
    font-size: 15px;
    font-weight: 500;
    margin: 4px 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.product-prices.big {
    margin: 16px 0;
}

.price-now {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.product-prices.big .price-now {
    font-size: 32px;
}

.price-old {
    font-size: 14px;
    color: var(--muted);
    text-decoration: line-through;
}

.product-card .btn {
    margin: 0 14px 14px;
    border-radius: 8px;
}

/* ===== Layout magazin ===== */
.shop-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
    margin-top: 24px;
}

.shop-sidebar {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    align-self: start;
}

.shop-sidebar h3 {
    margin-bottom: 14px;
    font-size: 18px;
}

.category-list {
    list-style: none;
}

.category-list li a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text);
}

.category-list li a:hover,
.category-list li a.active {
    background: var(--primary);
    color: #fff;
}

/* ===== Detaliu produs ===== */
.breadcrumb {
    margin: 20px 0;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: #fff;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.product-detail-image {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f0f0f0;
}

.product-detail-image img {
    width: 100%;
    object-fit: cover;
}

.product-detail-info h1 {
    font-size: 26px;
    margin: 6px 0 12px;
}

.detail-category {
    color: var(--muted);
    margin-bottom: 10px;
}

.stock-info {
    font-weight: 600;
    margin: 10px 0;
}

.in-stock {
    color: var(--accent);
}

.out-stock {
    color: var(--primary);
}

.product-description {
    margin: 18px 0;
    color: #444;
}

.buy-box {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.size-selector,
.qty-selector {
    margin-bottom: 16px;
}

.size-selector label,
.qty-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.size-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.size-btn {
    min-width: 46px;
    padding: 8px 14px;
    border: 2px solid var(--border);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.size-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.qty-selector input {
    width: 90px;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
}

/* ===== Cos ===== */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cart-item {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: 16px;
    align-items: center;
}

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

.cart-item-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.cart-item-size {
    color: var(--muted);
    font-size: 14px;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 700;
    margin-top: 4px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
}

.qty-input {
    width: 50px;
    text-align: center;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.cart-item-subtotal {
    font-weight: 700;
    min-width: 90px;
    text-align: right;
}

.cart-item-remove {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.cart-summary {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 90px;
}

.cart-summary h3 {
    margin-bottom: 16px;
}

.summary-row,
.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
}

.summary-item {
    font-size: 14px;
    color: #444;
    border-bottom: 1px dashed var(--border);
}

.summary-row.total {
    border-top: 2px solid var(--border);
    margin-top: 10px;
    padding-top: 14px;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

/* ===== Checkout ===== */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 30px;
    align-items: start;
}

.checkout-form {
    background: #fff;
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}

.checkout-form h3 {
    margin-bottom: 18px;
}

.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.checkbox-group input {
    width: auto;
}

/* ===== Alerte & stari ===== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #ffe5e9;
    color: #c62828;
    border: 1px solid #ffccd2;
}

.alert-error ul {
    margin-left: 18px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 20px;
    font-size: 17px;
}

.success-box {
    text-align: center;
    background: #fff;
    border-radius: var(--radius);
    padding: 60px 20px;
    box-shadow: var(--shadow);
    max-width: 560px;
    margin: 40px auto;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 44px;
    line-height: 80px;
    margin: 0 auto 20px;
}

.success-box h1 {
    margin-bottom: 12px;
}

.success-box p {
    color: var(--muted);
    margin-bottom: 8px;
}

.success-box .btn {
    margin-top: 20px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--secondary);
    color: #fff;
    padding: 14px 22px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Footer ===== */
.site-footer {
    background: var(--secondary);
    color: #cdd3e0;
    margin-top: 40px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
    padding: 40px 20px;
}

.footer-inner h4 {
    color: #fff;
    margin-bottom: 12px;
}

.footer-inner ul {
    list-style: none;
}

.footer-inner ul li {
    margin-bottom: 6px;
}

.footer-inner a:hover {
    color: #fff;
}

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

/* ===== Login ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    font-size: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.login-hint {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
}

.login-back {
    display: block;
    text-align: center;
    margin-top: 12px;
    color: var(--primary);
    font-weight: 600;
}

/* ===== Admin ===== */
.admin-body {
    background: #eef1f5;
}

.admin-wrap {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--secondary);
    color: #fff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
}

.admin-logo {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 24px;
    color: #fff;
}

.admin-logo span {
    color: var(--primary);
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-nav a {
    padding: 11px 14px;
    border-radius: 8px;
    color: #cdd3e0;
    font-weight: 500;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-user {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.admin-back {
    margin-top: 14px;
    font-size: 13px;
    color: #9aa4bd;
}

.admin-content {
    padding: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 26px;
}

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

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card a {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.admin-section {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.admin-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.admin-table th {
    background: #f7f8fa;
    font-weight: 700;
}

.admin-section .admin-table {
    box-shadow: none;
}

.table-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.status-badge {
    background: #e8eaf0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.ok {
    background: #d7f5ec;
    color: #087f5b;
}

.status-badge.off {
    background: #ffe0e0;
    color: #c62828;
}

.admin-form {
    background: #fff;
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
    max-width: 760px;
}

.current-image {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

.status-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.status-form select {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 8px;
}

.muted {
    color: var(--muted);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {

    .shop-layout,
    .product-detail,
    .cart-layout,
    .checkout-layout,
    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    .admin-wrap {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .admin-user {
        margin: 0 0 0 auto;
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 70px 1fr;
        grid-template-areas:
            "img info"
            "qty subtotal"
            "remove remove";
    }

    .hero-content h1 {
        font-size: 30px;
    }
}
