/* === Variables === */
:root {
    --primary: #8b2252;
    --primary-dark: #6e1a40;
    --primary-light: #f7e8f0;
    --text: #333;
    --text-muted: #666;
    --bg: #fdf8f5;
    --white: #ffffff;
    --border: #eee;
    --success: #155724;
    --success-bg: #d4edda;
    --error: #721c24;
    --error-bg: #f8d7da;
    --warning: #856404;
    --warning-bg: #fff3cd;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Lato', sans-serif;
}

/* === Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === Base === */
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* === Header === */
header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-title {
    color: var(--white);
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.site-title-main {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    line-height: 1.2;
}

.site-title-sub {
    font-size: 0.75rem;
    opacity: 0.8;
    font-style: italic;
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

nav a:hover {
    color: var(--white);
    text-decoration: underline;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* === Main === */
main {
    min-height: 60vh;
}

/* === Hero === */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #b5396e 100%);
    color: var(--white);
    text-align: center;
    padding: 5rem 1.5rem;
}

.hero-inner {
    max-width: 640px;
    margin: 0 auto;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.btn-hero {
    font-size: 1.1rem;
    padding: 0.85rem 2.5rem;
    background: var(--white);
    color: var(--primary);
    border-radius: 50px;
    font-weight: 700;
    display: inline-block;
}

.btn-hero:hover {
    background: var(--primary-light);
    text-decoration: none;
}

/* === Products Section === */
.product-section {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 2rem;
    text-align: center;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

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

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.13);
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.product-card-image img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    background: #f0e0ea;
}

.product-info {
    padding: 1rem 1rem 0.5rem;
}

.product-info h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.price {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stock-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.in-stock-tag {
    background: var(--success-bg);
    color: var(--success);
}

.out-of-stock-tag {
    background: #f0f0f0;
    color: #999;
}

.product-card-footer {
    padding: 0.75rem 1rem 1rem;
}

.btn-block {
    display: block;
    text-align: center;
}

/* === Buttons === */
.btn {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.55rem 1.3rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-body);
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: var(--white);
}

.btn-large {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
    text-align: center;
}

.btn-secondary {
    background: #666;
}

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

.btn-danger {
    background: #c62828;
}

.btn-danger:hover {
    background: #8b1a1a;
}

.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}

/* === About Strip === */
.about-strip {
    background: var(--primary-light);
    padding: 3rem 1.5rem;
    margin-top: 3rem;
}

.about-strip-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    text-align: center;
}

.about-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.about-item h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.4rem;
}

.about-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* === Product Detail === */
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 0.95rem;
}

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

.product-detail {
    max-width: 1000px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

.product-detail-inner {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.product-detail-image {
    flex: 1;
    min-width: 280px;
}

.product-detail-image img {
    width: 100%;
    border-radius: var(--radius);
    object-fit: cover;
    max-height: 440px;
    box-shadow: var(--shadow);
}

.product-detail-info {
    flex: 1;
    min-width: 280px;
}

.product-detail-info h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.stock {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.in-stock { color: var(--success); }
.out-of-stock { color: #c62828; }

.description {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* === Flash Messages === */
.flash {
    padding: 0.85rem 1.25rem;
    border-radius: 4px;
    margin: 1rem auto;
    max-width: 1100px;
    font-size: 0.95rem;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success);
}

.flash-error {
    background: var(--error-bg);
    color: var(--error);
}

/* === No Products === */
.no-products {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 4rem;
    grid-column: 1 / -1;
}

/* === Error Page === */
.error-page {
    text-align: center;
    padding: 5rem 1rem;
}

.error-page h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* === Footer === */
footer {
    background: var(--primary);
    color: rgba(255,255,255,0.85);
    padding: 2.5rem 1.5rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--white);
}

footer a {
    color: rgba(255,255,255,0.85);
}

footer a:hover {
    color: var(--white);
}

.footer-copy {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* === Admin Layout === */
.admin-body {
    background: #f0f2f5;
    font-family: var(--font-body);
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-nav {
    width: 210px;
    background: var(--primary);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

.admin-nav-title {
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.admin-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    text-decoration: none;
}

.logout-link {
    margin-top: auto;
    color: rgba(255,255,255,0.55) !important;
    font-size: 0.85rem !important;
}

.admin-main {
    flex: 1;
    padding: 2rem;
    max-width: 1000px;
}

.admin-main h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: #222;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-page-header h1 {
    margin-bottom: 0;
}

/* Admin Login */
.admin-login-wrap {
    max-width: 380px;
    margin: 5rem auto;
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.admin-login-wrap h1 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.admin-login-wrap h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: #333;
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #444;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139,34,82,0.15);
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

.admin-form {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    max-width: 640px;
}

.current-photo-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.4rem;
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.admin-table th {
    background: #f5f5f5;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #555;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

.admin-thumb-large {
    width: 120px;
    height: 120px;
    margin-bottom: 0.75rem;
    display: block;
}

.admin-actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Stats */
.admin-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    text-align: center;
    min-width: 130px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.admin-actions {
    display: flex;
    gap: 1rem;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-shipped {
    background: var(--success-bg);
    color: var(--success);
}

/* === Mobile === */
@media (max-width: 700px) {
    .site-title-main { font-size: 1.1rem; }
    .site-title-sub { display: none; }

    .nav-toggle { display: block; }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
        align-items: flex-start;
    }

    nav.open { display: flex; }

    header { position: relative; }

    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }

    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

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

    .product-detail-inner {
        flex-direction: column;
        gap: 1.5rem;
    }

    .form-row { flex-direction: column; gap: 0; }

    .admin-layout { flex-direction: column; }

    .admin-nav {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.75rem;
        gap: 0.25rem;
    }

    .admin-nav-title { width: 100%; margin-bottom: 0.25rem; }
    .logout-link { margin-top: 0; }

    .admin-main { padding: 1rem; }

    .admin-table { font-size: 0.85rem; }
    .admin-table th, .admin-table td { padding: 0.5rem 0.6rem; }
}

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