@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Basic Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    background-color: #000;
    color: #fff;
}

/* Header */
.top-announcement {
    background-color: #f0c48a;
    color: #000;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.eid-notice {
    background-color: #111;
    color: #f0c48a;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    border-bottom: 1px solid #333;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    border-bottom: 1px solid #333;
    background-color: #000;
    gap: 30px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo a {
    color: #f0c48a;
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-categories {
    position: relative;
}

.nav-categories .dropdown-toggle {
    font-size: 13px; /* Reduced from 14px */
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-categories .dropdown-toggle:hover {
    color: #f0c48a;
}

.nav-search {
    flex: 0 1 250px;
    max-width: 250px;
}

#nav-search-bar {
    width: 100%;
    padding: 8px 15px;
    background-color: #111;
    border: 1px solid #333;
    color: #fff;
    border-radius: 25px;
    outline: none;
    font-family: inherit;
    font-size: 13px;
}

#nav-search-bar:focus {
    border-color: #f0c48a;
}

.nav-auth {
    display: flex;
    gap: 20px;
}

.nav-auth a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-auth a:hover {
    color: #f0c48a;
}

.nav-cart a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#cart-count {
    background-color: #f0c48a;
    color: #000;
    padding: 2px 8px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
}

/* Dropdown */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #111;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    z-index: 1000;
    flex-direction: column;
    padding: 10px 0;
    list-style: none;
    margin: 0;
}

.dropdown.show {
    display: flex;
}

.dropdown li a {
    padding: 10px 20px;
    display: block;
    font-size: 13px;
    color: #fff;
    text-decoration: none;
}

.dropdown li a:hover {
    background-color: #222;
    color: #f0c48a;
}

.arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.dropdown-toggle.active .arrow {
    transform: rotate(180deg);
}

/* Main Content */
main {
    padding: 50px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: #111;
    border: 1px solid #333;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1; /* Desktop Square */
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills the container without stretching */
    display: block;
}

.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.product-info h3 {
    font-size: 15px;
    margin-bottom: 2px;
    min-height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.product-info a {
    text-decoration: none;
    color: inherit;
}

.add-to-cart-btn {
    background-color: #f0c48a;
    color: #000;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
    margin-top: auto; /* Keeps buttons aligned at the bottom */
    transition: background-color 0.3s ease;
}

.add-to-cart-btn:hover {
    background-color: #fff;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(240, 196, 138, 0.1);
}

.stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff4d4d;
    color: #fff;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 1;
}

.style-no {
    color: #888;
    font-size: 12px;
    margin: 2px 0;
}

.price {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin: 5px 0;
}

.more-colors {
    color: #f0c48a;
    font-size: 11px;
    font-style: italic;
    margin: 2px 0;
}

.live-viewers {
    color: #f0c48a;
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.viewer-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #f0c48a;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.product-card a {
    text-decoration: none;
    color: #fff;
}

.product-card img {
    max-width: 100%;
}

.product-card h3 {
    color: #f0c48a;
    font-size: 20px;
    margin: 15px 0;
}

/* Product Detail Page */
.product-detail-container {
    padding: 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-detail {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.detail-image-section {
    flex: 1;
}

.detail-image-section img {
    width: 100%;
    border: 1px solid #333;
    border-radius: 5px;
}

.product-info {
    flex: 1;
}

.product-info h2 {
    color: #f0c48a;
    font-size: 32px;
    margin-top: 0;
    text-transform: capitalize;
}

.product-description-section {
    margin: 20px 0;
    border-top: 1px solid #222;
    padding-top: 20px;
}

.product-description-section h3 {
    font-size: 18px;
    color: #f0c48a;
    margin-bottom: 10px;
}

.description-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    font-size: 14px;
    color: #ccc;
}

.description-list li {
    margin-bottom: 5px;
}

.details-table-container {
    margin: 20px 0;
    overflow-x: auto;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.details-table th, .details-table td {
    border: 1px solid #333;
    padding: 12px;
    text-align: left;
}

.details-table th {
    background-color: #111;
    color: #f0c48a;
    text-transform: uppercase;
}

.dimensions {
    font-size: 14px;
    color: #888;
    margin: 10px 0;
}

.stock-info {
    font-size: 14px;
    margin: 10px 0;
}

.stock-info.low-stock {
    color: #ff4d4d;
    font-weight: bold;
}

.product-extra-info {
    margin-top: 30px;
    border-top: 1px solid #333;
    padding-top: 20px;
}

.extra-info-item h4 {
    color: #f0c48a;
    margin-bottom: 10px;
}

.extra-info-item p {
    font-size: 14px;
    line-height: 1.6;
    color: #ccc;
}

.add-to-cart {
    background-color: #f0c48a;
    color: #000;
    padding: 15px 30px;
    border: none;
    cursor: pointer;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease;
}

.add-to-cart:hover {
    background-color: #fff;
}

/* Cart Page */
.cart-container {
    padding: 50px;
}

.cart-item {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
    align-items: center;
}

.cart-item img {
    width: 150px;
}

.cart-item-info h4 {
    color: #f0c48a;
    margin: 0;
    font-size: 22px;
}

.cart-item-quantity {
    width: 50px;
    background-color: #111;
    color: #fff;
    border: 1px solid #333;
}

.remove-from-cart {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.remove-from-cart:hover {
    background-color: #f0c48a;
    color: #000;
}

/* Admin Panel */
.admin-container {
    padding: 50px;
    background-color: #fff;
    color: #000;
}

#add-product-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 500px;
    margin-bottom: 30px;
}

#add-product-form input,
#add-product-form textarea {
    padding: 10px;
    border: 1px solid #ccc;
}

#add-product-form button {
    background-color: #000;
    color: #fff;
    padding: 10px;
    border: none;
    cursor: pointer;
}

.product-item-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.delete-product {
    background-color: #ccc;
    color: #000;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

#edit-product-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 500px;
    margin-bottom: 30px;
}

#edit-product-form input,
#edit-product-form textarea {
    padding: 10px;
    border: 1px solid #ccc;
}

#edit-product-form button {
    background-color: #000;
    color: #fff;
    padding: 10px;
    border: none;
    cursor: pointer;
}

.edit-product {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    text-decoration: none;
}

/* Auth Refinement */
.auth-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 300px);
    padding: 80px 20px;
    background-color: #050505;
}

.auth-card {
    background-color: #111;
    padding: 40px;
    border-radius: 8px;
    border: 1px solid #333;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.auth-card h2 {
    color: #f0c48a;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    color: #888;
    margin-bottom: 8px;
    font-size: 14px;
}

.auth-form input {
    width: 100%;
    padding: 12px 15px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
    font-family: inherit;
    outline: none;
}

.auth-form input:focus {
    border-color: #f0c48a;
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background-color: #f0c48a;
    color: #000;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.auth-btn:hover {
    background-color: #fff;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 14px;
}

.auth-switch a {
    color: #f0c48a;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.logout-btn {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: none;
    border: 1px solid #333;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
}

.logout-btn:hover {
    border-color: #f0c48a;
    color: #f0c48a;
}

/* About Page */
.about-container {
    padding: 80px 50px;
    max-width: 900px;
    margin: 0 auto;
}

.about-section {
    margin-bottom: 60px;
    text-align: center;
}

.about-section h2 {
    color: #f0c48a;
    font-size: 36px;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.about-section p {
    font-size: 18px;
    line-height: 1.8;
    color: #ccc;
}

/* Extra Sections */
.extra-sections {
    display: flex;
    justify-content: space-around;
    padding: 60px 50px;
    background-color: #050505;
    margin-top: 50px;
    border-top: 1px solid #222;
}

.extra-item {
    text-align: center;
    max-width: 300px;
}

.extra-item h4 {
    color: #f0c48a;
    font-size: 18px;
    margin: 15px 0 10px;
    text-transform: uppercase;
}

.extra-item p {
    font-size: 14px;
    color: #888;
    line-height: 1.5;
}

/* Footer */
footer {
    background-color: #000;
    padding: 80px 50px 20px;
    border-top: 1px solid #333;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 40px;
}

.footer-col {
    flex: 1;
}

.footer-col h3 {
    color: #f0c48a;
    font-size: 20px;
    margin-bottom: 25px;
    text-transform: uppercase;
}

.footer-col p, .footer-col ul li a {
    color: #888;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li a:hover {
    color: #f0c48a;
}

.newsletter-form {
    display: flex;
    margin-top: 20px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px;
    background-color: #111;
    border: 1px solid #333;
    color: #fff;
    border-radius: 3px 0 0 3px;
}

.newsletter-form button {
    padding: 12px 20px;
    background-color: #f0c48a;
    color: #000;
    border: none;
    cursor: pointer;
    font-weight: bold;
    border-radius: 0 3px 3px 0;
}

.footer-bottom {
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #111;
    color: #555;
    font-size: 13px;
}

/* WhatsApp Button */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
}

.whatsapp-btn img {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
}

.whatsapp-btn:hover img {
    transform: scale(1.1);
}

/* Product Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Lighter to show blur */
    backdrop-filter: blur(10px); /* Glass effect */
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #080808; /* Deeper black */
    border: 1px solid #f0c48a44; /* Subtle gold border */
    border-radius: 12px;
    width: 90%;
    max-width: 950px;
    max-height: 85vh;
    display: flex;
    flex-direction: row;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
    background: none;
    border: none;
}

.modal-close:hover {
    color: #f0c48a;
}

.modal-image-container {
    flex: 1;
    background-color: #000;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-info h2 {
    color: #fff; /* Pure white for readability */
    font-size: 28px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 5px;
}

.modal-info .style-no {
    margin-bottom: 15px;
}

.modal-info .price {
    font-size: 22px;
    margin-bottom: 15px;
}

.modal-info .description {
    line-height: 1.6;
    color: #ccc;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-add-to-cart {
    background-color: #f0c48a;
    color: #000;
    border: none;
    padding: 15px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: auto;
}

.modal-add-to-cart:hover {
    background-color: #fff;
}

@media (max-width: 768px) {
    .modal-content {
        flex-direction: column;
        max-height: 95vh;
    }
    .modal-image-container {
        max-height: 40vh;
    }
    .modal-info {
        padding: 20px;
    }
}

/* Orders Dashboard */
.orders-section-admin {
    margin-top: 50px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.orders-section-admin h3 {
    margin-bottom: 20px;
}

.order-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.order-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
}

.order-details p {
    margin: 5px 0;
    font-size: 14px;
}

.order-items-list {
    margin-top: 15px;
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.order-items-list ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.order-items-list li {
    font-size: 14px;
    margin-bottom: 5px;
}

#add-product-form label,
#edit-product-form label {
    font-weight: bold !important;
    color: #444 !important;
    font-size: 16px !important;
    margin-top: 10px !important;
    margin-bottom: 5px !important;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (Media Queries)
   ========================================================================== */

@media (max-width: 992px) {
    .modal-content {
        flex-direction: column;
        padding: 0;
        width: 92%;
        margin: 4% auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-image-container {
        flex: none;
        height: 300px;
        width: 100%;
    }

    .modal-info {
        padding: 20px;
        flex: none;
    }
}

@media (max-width: 768px) {
    /* Header/Nav Stabilized for Mobile */
    nav {
        flex-direction: column;
        padding: 5px 15px 15px; 
        gap: 10px;
        background-color: #000;
        border-bottom: 2px solid #111;
    }

    .logo {
        margin: 5px 0;
        font-size: 22px;
        text-align: center;
        width: 100%;
    }

    .nav-search {
        width: 100%;
        max-width: 100%;
        margin: 5px 0;
    }

    .nav-search input {
        width: 100% !important;
        border-radius: 20px !important;
        padding: 8px 15px !important;
    }

    .nav-categories, .nav-auth {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 12px; 
        margin: 0;
        padding: 5px 0;
    }

    .nav-categories a, .nav-auth a {
        font-size: 12px !important;
    }

    /* Professional Square Card Grid - 1 ITEM PER ROW */
    .product-grid {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important; /* Forces 1-column */
        gap: 40px !important; 
        padding: 15px !important;
        background: #000;
    }

    .product-card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        background: #fff; /* White as requested */
        border-radius: 12px;
        overflow: hidden;
        border: none;
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    }

    .product-image-container {
        width: 100%;
        aspect-ratio: 1 / 1; /* PERFECT SQUARE */
        height: auto;
        overflow: hidden;
    }

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

    .product-info {
        padding: 15px !important;
        text-align: left;
        background: #fff;
    }

    .product-info h3 {
        color: #000 !important;
        font-size: 16px; 
        margin-bottom: 5px;
        font-weight: 700;
    }

    .price {
        color: #d4a762 !important; /* Gold/Elegant instead of Red if preferred, but keeping standard as requested */
        font-size: 16px;
        font-weight: 800;
        margin: 5px 0 10px;
    }

    .add-to-cart-btn {
        width: 100% !important;
        padding: 12px !important;
        background: #000 !important; /* Premium Black Button */
        color: #fff !important;
        border-radius: 5px;
        font-size: 13px;
        pointer-events: auto !important; /* Always clickable */
    }

    .product-modal-trigger {
        pointer-events: none !important; /* Disable all clicks on the link */
        cursor: default !important;
    }

    /* Modal Mobile - Side by Side Like Desktop */
    .modal-content {
        width: 95% !important;
        margin: 10% auto !important;
        flex-direction: row !important; /* Forces side by side */
        padding: 0 !important;
        background: #fff;
        height: auto;
        min-height: 250px;
    }

    .modal-image-container {
        width: 45% !important; /* Smaller image to save space */
        height: auto !important;
        aspect-ratio: 1 / 1;
        flex: none;
    }

    .modal-info {
        width: 55% !important;
        padding: 10px 15px !important;
        flex: 1;
        overflow-y: auto;
    }

    .modal-info h2 {
        font-size: 14px !important;
        margin-bottom: 5px;
        color: #000;
    }

    .modal-info .price {
        font-size: 13px !important;
        margin-bottom: 5px;
    }

    .modal-info p {
        font-size: 11px !important;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    /* Modal Button Mobile */
    .modal-info .add-to-cart-btn {
        padding: 8px !important;
        font-size: 10px !important;
        width: 100% !important;
    }

    /* Admin/Dashboard Fixes */
    .admin-prod-item {
        flex-direction: column;
        gap: 15px;
    }

    .cart-item {
        flex-direction: row; /* Keep items horizontal but scale image */
        padding: 10px 0;
    }
}

/* Very Small Phone Adjustments */
@media (max-width: 480px) {
    .logo {
        font-size: 18px;
    }
    
    .product-grid {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        gap: 30px !important;
        padding: 10px;
    }

    .product-card {
        width: 100% !important;
        margin-bottom: 20px !important;
    }

    .product-modal-trigger {
        pointer-events: none !important;
        cursor: default !important;
    }
}
