:root {
    --rolex-green: #006039;
    --ferrari-red: #ff2800;
    --gold: #d4af37;
    --gold-light: #f4e4bc;
    --rich-black: #0a0a0a;
    --dark-grey: #1c1c1c;
    --off-white: #f5f5f5;
    --glass-bg: rgba(28, 28, 28, 0.95);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', serif;
    /* Premium feel for headings */
    background-color: var(--rich-black);
    background-image: linear-gradient(rgba(0, 30, 20, 0.9), rgba(0, 30, 20, 0.9)), url('img/lumina_gold_1.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--off-white);
    line-height: 1.6;
    padding-bottom: 6rem;
    /* Space for fixed footer */
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

body {
    font-family: 'Inter', sans-serif;
    /* Clean for body text */
}

h1,
h2.product-title,
.modal-title {
    font-family: 'Playfair Display', serif;
}

/* Header */
header {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0));
    padding: 3rem 5%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease, background 0.3s ease;
}

header.scrolled {
    padding: 1rem 5%;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.logo {
    color: var(--gold);
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
    transition: font-size 0.3s ease;
}

header.scrolled .logo {
    font-size: 1.5rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

/* Product Card */
.product-card {
    background-color: transparent;
    border: 1px solid transparent;
    /* Prepare for hover border */
    border-radius: 0;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    height: 100%;
    will-change: transform;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.product-image-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
    position: relative;
    order: 2;
    /* Image below text */
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    /* Push to bottom of title area if needed */
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the frame */
    transition: transform 0.8s ease;
}

.product-card:hover .product-image {
    transform: scale(1.02);
}

.product-info {
    padding: 1.5rem 1rem;
    background: transparent;
    order: 1;
    /* Text above image */
    text-align: center;
    width: 100%;
    height: 100px;
    /* Stronger height enforcement */
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
}

.product-title {
    color: var(--gold-light);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    font-weight: 700;
}

.card-desc-table-container {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.card-desc-table {
    width: 80%;
    border-collapse: collapse;
    font-size: 0.8rem;
    color: #ccc;
    text-align: center;
}

.card-desc-table td {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-desc-table tr:last-child td {
    border-bottom: none;
}

.product-price {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

/* Detail Modal/Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(8px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--dark-grey);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 8px;
    /* Slightly softer corners */
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* overflow: hidden; Removed to allow better control, or kept if children scroll */
    overflow: hidden;
    transform: translateY(50px);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid var(--gold);
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-image-col {
    background: #000;
    height: 100%;
    min-height: 500px;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-details-col {
    padding: 3rem;
    display: flex;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* changed from center to allow top alignment when scrolling */
    position: relative;
    max-height: 100%;
    overflow-y: auto;
}

.close-lightbox {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--off-white);
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100;
    transition: color 0.3s;
    line-height: 1;
}

.close-modal {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: var(--off-white);
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
    z-index: 100;
}

.close-modal:hover {
    color: var(--ferrari-red);
}

.modal-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
    line-height: 1.2;
}

.modal-price {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 2rem;
    font-weight: 300;
}

.modal-description {
    color: #aaa;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.modal-desc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.modal-desc-table td {
    padding: 0.8rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    font-size: 0.95rem;
}

.modal-desc-table tr:last-child td {
    border-bottom: none;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    align-self: flex-start;
}

.modal-action-btn {
    background-color: var(--rolex-green);
    color: white;
    padding: 1rem 2rem;
    border: none;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 600;
}

.modal-action-btn:hover {
    background-color: #004d2e;
}

.modal-secondary-btn {
    background-color: transparent;
    color: var(--gold);
    padding: 1rem 2rem;
    border: 1px solid var(--gold);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.modal-secondary-btn:hover {
    background-color: var(--gold);
    color: var(--rich-black);
}

/* Admin Styles */
.admin-container {
    max-width: 600px;
    margin: 4rem auto;
    background: var(--dark-grey);
    padding: 2rem;
    border-radius: 8px;
    border-top: 4px solid var(--ferrari-red);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gold);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input,
textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    color: white;
    font-family: inherit;
    transition: border 0.3s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.btn-primary {
    background-color: var(--ferrari-red);
    color: white;
    padding: 1rem 2rem;
    border: none;
    width: 100%;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: #cc2000;
    transform: translateY(-2px);
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--off-white);
}

@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-start;
    }

    .modal-content {
        grid-template-columns: 1fr;
        max-height: 100vh;
        height: auto;
        width: 100%;
        max-width: 100%;
        overflow-y: auto;
        border-radius: 0;
        margin: 0;
    }

    .modal-image-col {
        height: 40vh;
        min-height: 250px;
    }

    .modal-image {
        object-fit: cover;
    }

    .modal-details-col {
        padding: 2rem 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 1rem;
    }

    .modal-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .close-modal {
        position: fixed;
        top: 1rem;
        right: 1rem;
        font-size: 2.5rem;
        z-index: 10000;
        background: rgba(0, 0, 0, 0.7);
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-actions {
        position: sticky;
        bottom: 0;
        background: var(--dark-grey);
        padding: 1rem 1.5rem;
        margin: 0 -1.5rem -2rem;
        flex-direction: column;
        width: calc(100% + 3rem);
        gap: 0.75rem;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
        z-index: 10;
    }

    .modal-action-btn,
    .modal-secondary-btn {
        width: 100%;
        text-align: center;
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }

    .modal-desc-table {
        margin-bottom: 1.5rem;
    }

    .modal-desc-table td {
        font-size: 0.85rem;
        padding: 0.6rem 0.3rem;
        line-height: 1.5;
    }

    .logo {
        font-size: 1.4rem;
        text-align: center;
    }

    .container {
        padding: 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Admin Product Table */
.table-responsive {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.chart-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: block;
}

.table-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

.table-title {
    color: var(--off-white);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    display: block;
}

.table-desc {
    color: #888;
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 300px;
    line-clamp: 2;
}

.table-price {
    color: var(--gold);
    font-weight: 600;
}

.btn-delete {
    background: transparent;
    border: 1px solid var(--ferrari-red);
    color: var(--ferrari-red);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
}

.btn-delete:hover {
    background-color: var(--ferrari-red);
    color: white;
}

.btn-edit {
    display: inline-block;
    background-color: transparent;
    border: 1px solid var(--rolex-green);
    color: var(--rolex-green);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
}

.btn-edit:hover {
    background-color: var(--rolex-green);
    color: white;
}

/* Mobile Responsiveness for Table */
@media (max-width: 768px) {
    .admin-container {
        padding: 1rem;
        margin: 2rem 1rem;
    }

    .table-responsive {
        background: transparent;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tr {
        background: rgba(255, 255, 255, 0.03);
        margin-bottom: 1.5rem;
        border-radius: 8px;
        padding: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .admin-table td {
        padding: 0.5rem 0;
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .table-thumb {
        width: 100%;
        height: 200px;
        margin-bottom: 1rem;
    }

    .admin-table td:first-child {
        display: block;
    }
}

/* Lightbox Gallery */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    background: rgba(0, 0, 0, 0.95);
    z-index: 10005;
    display: none;
    flex-direction: row;
    /* Change to row to put thumbs on left */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2rem;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-thumbnails {
    display: flex;
    flex-direction: column;
    /* Vertical alignment */
    gap: 1.5rem;
    overflow-y: auto;
    padding: 1rem;
    height: 80%;
    justify-content: center;
    border-right: 1px solid rgba(212, 175, 55, 0.2);
    margin-right: 2rem;
}

.lightbox-main-image-container {
    flex: 1;
    /* Take remaining space */
    height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Prevent overflow when zoomed */
    cursor: zoom-in;
}

.lightbox-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 2px solid var(--gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
    transition: transform 0.3s ease, cursor 0.3s ease;
}

.lightbox-main-image.zoomed {
    transform: scale(2.5);
    /* Boosted zoom factor */
    cursor: zoom-out;
}

.lightbox-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.3s;
}

.lightbox-thumb.active {
    border-color: var(--gold);
    opacity: 1;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .lightbox-overlay {
        flex-direction: column;
        padding: 1rem;
    }

    .lightbox-thumbnails {
        flex-direction: row;
        width: 100%;
        height: auto;
        border-right: none;
        border-top: 1px solid rgba(212, 175, 55, 0.2);
        margin-right: 0;
        margin-top: 1rem;
        order: 2;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .lightbox-main-image-container {
        width: 100%;
        height: 60vh;
        order: 1;
    }

    .lightbox-thumb {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .close-lightbox {
        top: 1rem;
        right: 1.5rem;
        font-size: 2.5rem;
    }
}

.close-lightbox:hover {
    color: var(--ferrari-red);
}

/* Fixed Footer Style */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--gold);
    padding: 0.5rem 0;
    z-index: 9999;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--off-white);
    flex-wrap: wrap;
}

.footer-divider {
    color: var(--gold);
    font-weight: bold;
}

.footer-bottom {
    display: none;
}

/* Responsive Styles for Modal and Footer (Tablet & Mobile) */
@media (max-width: 1024px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-start;
    }

    .modal-content {
        grid-template-columns: 1fr !important;
        /* Force single column on tablets too */
        max-height: 100vh;
        height: auto;
        width: 100%;
        max-width: 100%;
        overflow-y: auto;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-image-col {
        height: 40vh;
        min-height: 300px;
        flex-shrink: 0;
        /* Keep image size stable */
    }

    .modal-image {
        object-fit: cover;
    }

    .modal-details-col {
        padding: 2rem 1.5rem;
        flex-grow: 1;
        /* Allow details to expand */
    }

    .modal-title {
        font-size: 1.8rem;
        text-align: center;
        margin-bottom: 1rem;
    }

    .modal-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .close-modal {
        position: fixed;
        top: 1rem;
        right: 1rem;
        font-size: 2.5rem;
        z-index: 10000;
        background: rgba(0, 0, 0, 0.7);
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-actions {
        /* On tablet/mobile, let actions be static or sticky at bottom of content */
        position: relative;
        width: 100%;
        margin: 0;
        padding-top: 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
        z-index: 10;
        background: transparent;
        box-shadow: none;
    }

    .modal-action-btn,
    .modal-secondary-btn {
        width: 100%;
        text-align: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .modal-desc-table {
        margin-bottom: 1.5rem;
    }

    .modal-desc-table td {
        font-size: 0.9rem;
        padding: 0.6rem 0.3rem;
        line-height: 1.5;
    }

    .logo {
        font-size: 1.6rem;
        text-align: center;
    }

    .container {
        padding: 1rem;
    }

    /* Make grid responsive earlier */
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    /* Footer adjustments for tablet/mobile */
    .site-footer {
        position: relative;
        padding: 2rem 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }

    .footer-divider {
        display: none;
    }

    body {
        padding-bottom: 0 !important;
    }
}

/* Price Request Form */
.price-request-form {
    max-width: 500px !important;
    padding: 2rem;
}

.form-subtitle {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.price-request-form .form-group {
    margin-bottom: 1.5rem;
}

.price-request-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gold);
    font-size: 0.9rem;
}

.price-request-form input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    color: white;
    font-family: inherit;
    transition: border 0.3s;
    border-radius: 4px;
}

.price-request-form input:focus {
    outline: none;
    border-color: var(--gold);
}

.price-request-form .btn-primary {
    margin-top: 1rem;
}

/* Admin Sections */
.admin-section {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .chart-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .chart-label {
        font-size: 0.85rem;
    }

    .chart-thumb {
        width: 30px;
        height: 30px;
    }
}