/* ============================================
   МебльШоп — дизайн у стилі Posmobrand
   Кольори та шрифт узяті з реальної теми сайту
   ============================================ */

:root {
    --dark: #011936;
    --light: #ffffff;
    --accent: #249bda;
    --light-blue: #f5faff;
    --pale-blue: #ebf2fb;
    --gray: #acbcd0;
    --error: #fe5f55;
    --radius: 4px;
    --pill: 50px;
}

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

body {
    font-family: 'Geologica', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
    background: var(--light);
    line-height: 1.5;
    font-weight: 400;
}

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

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Підкреслення-анімація для лінків (фірмова фішка бренду) */
.underline-link {
    position: relative;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .3s ease;
}
.underline-link::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -3px;
    height: 1px;
    background: var(--accent);
    width: 0;
    transition: width .5s;
}
.underline-link:hover::after { width: 100%; }

/* ===== Header ===== */
.site-header {
    background: var(--light);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--pale-blue);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
}

.logo {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--dark);
}
.logo span { color: var(--accent); }

.main-nav {
    display: flex;
    gap: 32px;
}
.main-nav a {
    font-weight: 400;
    font-size: 16px;
    color: var(--dark);
    position: relative;
    transition: color .3s ease;
}
.main-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 1px;
    background: var(--accent);
    width: 0;
    transition: width .5s;
}
.main-nav a:hover, .main-nav a.active { color: var(--accent); }
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

.cart-link {
    font-weight: 400;
    font-size: 15px;
    background: var(--dark);
    color: var(--light);
    padding: 12px 24px;
    border-radius: var(--pill);
    position: relative;
    transition: background .3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cart-link:hover { background: var(--accent); }

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--error);
    color: var(--light);
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Hero ===== */
.hero {
    padding: 60px 0 70px;
}
.hero .container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.hero h1 {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(40px, 7vw, 96px);
    font-weight: 500;
    line-height: 0.94;
    letter-spacing: -2px;
    max-width: 900px;
}
.hero p {
    font-size: clamp(16px, 1.6vw, 20px);
    color: var(--dark);
    opacity: .7;
    max-width: 480px;
}

/* ===== Catalog ===== */
.catalog-section { padding: 20px 0 90px; }

.search-form {
    display: flex;
    gap: 10px;
    max-width: 460px;
    margin: 0 0 32px;
}
.search-form input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    background: var(--pale-blue);
    border-radius: var(--pill);
    font-size: 15px;
    font-family: inherit;
    color: var(--dark);
}
.search-form input::placeholder { color: var(--gray); }
.search-form input:focus { outline: 2px solid var(--accent); }
.search-form button {
    background: var(--dark);
    color: var(--light);
    border: none;
    padding: 0 28px;
    border-radius: var(--pill);
    font-weight: 400;
    font-size: 15px;
    cursor: pointer;
    transition: background .3s ease;
}
.search-form button:hover { background: var(--accent); }

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 48px;
}
.filter-chip {
    padding: 12px 24px;
    background: var(--pale-blue);
    border-radius: var(--pill);
    font-weight: 400;
    font-size: 15px;
    color: var(--dark);
    transition: all .3s ease;
}
.filter-chip:hover { background: var(--gray); color: var(--light); }
.filter-chip.active {
    background: var(--dark);
    color: var(--light);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 32px 24px;
}

.product-card {
    display: flex;
    flex-direction: column;
}
.product-image {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--pale-blue);
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-image img { transform: scale(1.04); }

.product-info { display: flex; flex-direction: column; gap: 10px; }
.product-name {
    display: block;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.3;
    min-height: 42px;
    color: var(--dark);
    transition: color .3s ease;
}
.product-name:hover { color: var(--accent); }
.product-price {
    font-size: 19px;
    font-weight: 500;
    color: var(--dark);
}

.btn-add, .btn-add-large {
    width: 100%;
    background: var(--dark);
    color: var(--light);
    border: none;
    padding: 13px;
    border-radius: var(--pill);
    font-weight: 400;
    font-size: 15px;
    cursor: pointer;
    transition: background .3s ease;
    font-family: inherit;
}
.btn-add:hover, .btn-add-large:hover { background: var(--accent); }

.empty-state {
    text-align: center;
    padding: 70px 20px;
    color: var(--gray);
    font-size: 16px;
}
.empty-state a { color: var(--accent); font-weight: 500; }

/* ===== Product detail ===== */
.product-detail-section { padding: 40px 0 90px; }
.breadcrumbs { font-size: 14px; color: var(--gray); margin-bottom: 32px; }
.breadcrumbs a { color: var(--accent); }

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 90px;
}
.product-detail-image {
    background: var(--pale-blue);
    border-radius: var(--radius);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-detail-image img { object-fit: contain; max-height: 480px; }

.product-gallery { display: flex; flex-direction: column; gap: 14px; }
.product-thumbs { display: flex; gap: 12px; flex-wrap: wrap; }
.product-thumb {
    width: 76px;
    height: 76px;
    object-fit: cover;
    background: var(--pale-blue);
    border-radius: var(--radius);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .3s ease, opacity .3s ease;
    opacity: .65;
}
.product-thumb:hover { opacity: 1; }
.product-thumb.active { border-color: var(--accent); opacity: 1; }

.product-detail-info h1 {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 20px;
}
.product-detail-price { font-size: 34px; font-weight: 500; color: var(--dark); margin-bottom: 20px; }
.product-detail-desc { color: var(--dark); opacity: .7; margin-bottom: 24px; font-size: 16px; }

.stock-status { font-weight: 500; font-size: 15px; margin-bottom: 24px; }
.stock-status.in-stock { color: var(--accent); }
.stock-status.out-stock { color: var(--error); }

.add-form-detail { display: flex; gap: 14px; align-items: center; }
.add-form-detail input[type=number] {
    width: 74px;
    padding: 13px;
    border: none;
    background: var(--pale-blue);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    text-align: center;
}
.btn-add-large { width: auto; padding: 14px 32px; }

.related-section h2 {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(24px, 2.4vw, 36px);
    font-weight: 500;
    margin-bottom: 28px;
}

/* ===== Cart ===== */
.cart-section, .checkout-section { padding: 48px 0 90px; }
.cart-section h1, .checkout-section h1 {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(32px, 3.5vw, 52px);
    font-weight: 500;
    margin-bottom: 36px;
}

.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 18px 12px; text-align: left; border-bottom: 1px solid var(--pale-blue); }
.cart-table th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--gray); font-weight: 400; }
.cart-product-cell { display: flex; align-items: center; gap: 14px; font-weight: 400; }
.cart-product-cell img { border-radius: var(--radius); background: var(--pale-blue); }

.qty-input { width: 60px; padding: 8px; border: none; background: var(--pale-blue); border-radius: var(--radius); font-family: inherit; text-align: center; }
.remove-cell { text-align: center; }
.btn-remove { background: none; border: none; color: var(--error); font-size: 18px; cursor: pointer; font-weight: 500; }

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}
.btn-secondary {
    background: var(--pale-blue);
    border: none;
    padding: 13px 24px;
    border-radius: var(--pill);
    font-weight: 400;
    cursor: pointer;
    font-family: inherit;
    color: var(--dark);
    transition: background .3s ease;
}
.btn-secondary:hover { background: var(--gray); color: var(--light); }
.cart-total { font-size: 22px; }
.cart-total strong { color: var(--dark); font-weight: 500; }

.cart-checkout-btn { text-align: right; margin-top: 28px; }
.btn-checkout {
    display: inline-block;
    background: var(--dark);
    color: var(--light);
    padding: 16px 36px;
    border-radius: var(--pill);
    font-weight: 400;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background .3s ease;
}
.btn-checkout:hover { background: var(--accent); }

/* ===== Checkout ===== */
.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.checkout-form { display: flex; flex-direction: column; gap: 28px; }
.checkout-form label { font-weight: 400; font-size: 13px; color: var(--gray); display: flex; flex-direction: column; gap: 8px; }
.checkout-form input, .checkout-form textarea {
    padding: 0 0 14px;
    border: none;
    border-bottom: 1px solid var(--dark);
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-size: 17px;
    font-weight: 400;
    color: var(--dark);
}
.checkout-form input:focus, .checkout-form textarea:focus { outline: none; border-bottom-color: var(--accent); }
.checkout-form textarea { resize: none; }

.checkout-summary { background: var(--pale-blue); padding: 28px; border-radius: var(--radius); }
.checkout-summary h3 { font-weight: 500; margin-bottom: 18px; }
.checkout-item { display: flex; justify-content: space-between; padding: 10px 0; font-size: 14px; border-bottom: 1px solid rgba(1,25,54,.08); }
.checkout-total { display: flex; justify-content: space-between; font-weight: 500; font-size: 19px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--dark); }

.success-box { background: var(--pale-blue); border-radius: var(--radius); padding: 40px; text-align: center; }
.success-box h2 { color: var(--accent); margin-bottom: 14px; font-weight: 500; }
.success-box p { margin-bottom: 24px; }
.error-box { background: #fff0ef; border-left: 3px solid var(--error); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; color: var(--error); font-weight: 500; }

/* ===== Footer ===== */
.site-footer { background: var(--dark); color: var(--light); margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding: 60px 20px 40px; max-width: 1280px; margin: 0 auto; }
.footer-col h3 { font-size: 22px; font-weight: 600; margin-bottom: 12px; }
.footer-col h3 span { color: var(--accent); }
.footer-col h4 { color: var(--accent); font-weight: 500; margin-bottom: 14px; font-size: 15px; }
.footer-col p { opacity: .8; font-size: 14px; margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; text-align: center; font-size: 13px; opacity: .6; }
.footer-bottom a { color: var(--light); text-decoration: underline; }

/* ===== Admin ===== */
.admin-body { background: var(--pale-blue); font-family: 'Geologica', sans-serif; }
.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 40px 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.admin-header h1 { font-size: 26px; font-weight: 500; }
.admin-header nav a { font-size: 14px; color: var(--dark); }
.admin-header nav a:hover { color: var(--accent); }
.admin-table { width: 100%; background: var(--light); border-collapse: collapse; border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { padding: 16px; text-align: left; border-bottom: 1px solid var(--pale-blue); font-size: 14px; }
.admin-table th { background: var(--dark); color: var(--light); font-weight: 400; }
.admin-form { background: var(--light); padding: 32px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.admin-form label { font-weight: 400; font-size: 13px; color: var(--gray); display: flex; flex-direction: column; gap: 8px; }
.admin-form input, .admin-form select, .admin-form textarea {
    padding: 12px 14px; border: none; background: var(--pale-blue); border-radius: var(--radius); font-family: inherit; font-size: 15px; font-weight: 400; color: var(--dark);
}
.login-box { max-width: 400px; margin: 100px auto; background: var(--light); padding: 40px; border-radius: var(--radius); }
.login-box h1 { text-align: center; margin-bottom: 28px; font-size: 24px; font-weight: 500; }
.btn-primary { background: var(--dark); color: var(--light); border: none; padding: 14px; border-radius: var(--pill); font-weight: 400; cursor: pointer; font-family: inherit; font-size: 15px; transition: background .3s ease; }
.btn-primary:hover { background: var(--accent); }
.btn-danger { background: var(--error); color: var(--light); border: none; padding: 9px 16px; border-radius: var(--pill); font-weight: 400; cursor: pointer; font-size: 13px; font-family: inherit; }
.btn-edit { background: var(--dark); color: var(--light); padding: 9px 16px; border-radius: var(--pill); font-weight: 400; font-size: 13px; display: inline-block; transition: background .3s ease; }
.btn-edit:hover { background: var(--accent); }
.admin-actions { display: flex; gap: 8px; }
.logout-link { color: var(--error); font-weight: 500; font-size: 14px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .product-detail { grid-template-columns: 1fr; }
    .checkout-layout { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
}
