@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=League+Spartan');


:root {
    --black: #1C1A1A;
    --rose: #B88E8D;
    --rose-dusty: #9d7c7a;
    --gold: #C5A059;
    --cream: #F8F5F3;
    --gray: #6B6B6B;
    --white: #ffffff;
    --green: #2e6a38;
    --warning: #ffa0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    color: var(--black);
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.title-font {
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    color: var(--gold);
}

body {
    background: var(--cream);
    color: var(--black);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================
   HEADER
=========================== */

.header {
    background: var(--black);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 999;
    border-radius: 0 0 12px 12px;
}

.header-top {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

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

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: .3s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, .08);
}

/* ===========================
   BURGER BUTTON
=========================== */

.burger {
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 20px;
}

.burger span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--gold);
    margin: 5px 0;
    border-radius: 2px;
}

/* ===========================
   SIDEBAR
=========================== */

.sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background: var(--black);
    box-shadow: 2px 0 15px rgba(0, 0, 0, .35);
    transition: left .3s ease;
    z-index: 1000;
}

.sidebar.active {
    left: 0;
}

.logo {
    padding: 25px;
    font-size: 24px;
    font-weight: 600;
    color: var(--gold);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #ddd;
    transition: .3s;
}

.sidebar ul li a:hover {
    background: rgba(184, 142, 141, .15);
    color: var(--gold);
}

/* ===========================
   MAIN CONTENT
=========================== */

.content {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.title {
    color: var(--gold);
    margin-bottom: 15px;
    font-family: 'Cinzel', serif;
}

/* ===========================
   FOOTER
=========================== */

.footer {
    padding: 1rem;
    text-align: center;
    background: var(--black);
    color: var(--gold);
}

/* ===========================
   OVERLAY
=========================== */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: none;
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* ===========================
   STANDARD FORM
=========================== */

.std-form {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(197, 160, 89, .25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
}

.std-form h2 {
    margin-bottom: 20px;
    color: var(--gold);
    text-align: center;
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.std-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--black);
    font-weight: 600;
}

.std-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    transition: .3s;
}

.std-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    transition: .3s;
}

.std-form input[type="file"] {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    transition: .3s;
}

.std-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    transition: .3s;
}

.std-form input:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(184, 142, 141, .15);
}

.std-form button {
    width: 100%;
    padding: 12px;
    background: var(--gold);
    color: var(--black);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: .3s;
}

.std-form button:hover {
    background: #b28e48;
    transform: translateY(-1px);
}

.std-form a {
    color: var(--rose);
    text-decoration: none;
    transition: .3s;
}

.std-form a:hover {
    color: var(--gold);
}

.std-form .alert {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    text-align: center;
}

.std-form .alert-success {
    background: #edf7ed;
    color: #2e6a38;
}

.std-form .alert-error {
    background: #fdf0f0;
    color: #8a3030;
}

.file-upload {
    margin-bottom: 20px;
}

.file-upload input {
    display: none;
}

.file-box {
    display: block;
    border: 2px dashed rgba(197, 160, 89, .5);
    border-radius: 12px;
    background: #fff;
    padding: 15px;
    cursor: pointer;
    transition: .3s;
}

.file-box:hover {
    border-color: var(--gold);
    background: rgba(197, 160, 89, .05);
}

.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 120px;
}

.upload-placeholder {
    width: 100%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.file-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-placeholder strong {
    color: var(--black);
    font-size: 18px;
}

.upload-placeholder small {
    color: #777;
}

.preview-item {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: 0 3px 10px rgba(0,0,0,.08);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===========================
   PRODUCTS GRID
=========================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px;
    padding: 20px 0;
}

/* ===========================
   PRODUCT CARD
=========================== */

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid rgba(197, 197, 197, 0.963);
    /*border-radius: 16px;*/
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
    transition: all .3s ease;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: rgba(197, 160, 89, .45);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

.product-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* ===========================
   PRODUCT IMAGE
=========================== */

.product-image {
    height: 440px;
    padding: 20px;
    background:
        radial-gradient(
            circle at top,
            rgba(184, 142, 141, .12),
            transparent 70%
        ),
        #faf9f7;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    object-fit: contain;
    transition: transform .35s ease;
    border-radius: 8px;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* ===========================
   PRODUCT INFO
=========================== */

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.product-brand {
    font-size: .75rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Fixed-height title area */
.product-name {
    font-size: .95rem;
    line-height: 1.4;
    color: var(--black);
    font-weight: 600;
    margin-bottom: 12px;

    min-height: calc(1.4em * 3);

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin-top: auto;
    margin-bottom: 14px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--black);
    /*align right*/
    text-align: right;
    font-family: "League Spartan", sans-serif;
}

.product-button {
    width: 100%;
    padding: 10px 11px;
    background: var(--gold);
    color: var(--black);
    border: 1px solid var(--gold);
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s ease;
    text-align: center;
}

.product-button:hover {
    background: var(--gold);
    color: var(--black);
}

.subcategory-button{
    align-self: flex-start;
    display: inline-block;
    width: auto;
    padding: 8px 16px;
    margin: 5px;
    background: var(--gold);
    color: var(--black);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all .3s ease;
}

/* ===========================
   MOBILE
=========================== */

@media (max-width: 768px) {
    .header {
        padding: 10px 12px;
        gap: 8px;
    }

    .header-top {
        min-height: 44px;
    }

    .header-left h2 {
        font-size: 1.1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .product-image {
        height: 160px;
    }

    .product-image img {
        max-height: 120px;
    }

    .product-name {
        font-size: .9rem;
    }

    .product-price {
        font-size: 1.1rem;
    }
}

/* ===========================
    LINKS GRID
=========================== */

.links-grid {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
    max-width: 800px;
    margin:auto;
}

.link-card {
    display: block;
    padding: 1rem 1.25rem;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.link-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.link-card p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.std-link{
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--black);
    text-decoration: none;
    font-weight: 600;
}

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

.std-button, .delete-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--gold);
    color: var(--black);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.delete-button {
    background-color: var(--warning);
}

.success-message{
    color: var(--green);
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 4px solid var(--green);
    border-radius: 4px;
}

.category-title{
    font-size: 2rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.search-bar-container{
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input {
    padding-right: 40px;
}

.search-input-wrapper .search-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form {
    display: flex;
    justify-content: center;
    margin: 0;
    width: 100%;
}

.search-form input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #161616;
    border-radius: 8px;
    width: 100%;
    background: #434343;
    color: var(--white);
}

.search-form input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-form button[type="submit"] {
    
    color: var(--black);
    cursor: pointer;
}