/* ============================================
   GOOD LUCK MART – Professional Style (Merged)
   ============================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f8;
    color: #333;
    line-height: 1.6;
}

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

a {
    text-decoration: none;
    color: #2c3e50;
}

a:hover {
    color: #27ae60;
}

/* ---------- Header ---------- */
#main-header {
    background: #1e272e;                    /* deep navy blue */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1200px;
    margin: auto;
}

/* Logo area */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #f1c40f;                        /* gold accent for the brand name */
    font-size: 1.6em;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo img {
    height: 45px;
    width: auto;
    margin-right: 10px;
}

.logo-text {
    font-size: 1.6em;
    color: #f1c40f;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation links */
.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: #e2e8f0;                        /* light grey for contrast */
    font-weight: 500;
    font-size: 1em;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #f1c40f;                        /* gold on hover */
}

/* Underline hover effect */
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: #f1c40f;                   /* gold underline */
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

/* Cart link with badge */
.cart-link {
    position: relative;
}

.cart-icon {
    font-size: 1.3em;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #f1c40f;                   /* gold badge */
    color: #1e293b;                        /* dark text on gold */
    font-size: 0.7em;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.5);
}

/* Main content spacing (to clear sticky header) */
.main-content {
    margin-top: 60px;
}

/* ---------- Footer ---------- */
footer {
    background: #1e272e;
    color: #b0b0b0;
    text-align: center;
    padding: 25px 0;
    margin-top: 60px;
    font-size: 0.95em;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 1em;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
    background: #27ae60;
    text-decoration: none;
    margin-right: 5px;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

.btn:hover {
    background: #219150;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

.btn.secondary {
    background: #3498db;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.btn.secondary:hover {
    background: #2980b9;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

.btn.danger {
    background: #e74c3c;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.btn.danger:hover {
    background: #c0392b;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
}

/* ---------- Product Grid ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    padding-bottom: 20px;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.product-card h3 {
    font-size: 1.2em;
    margin: 15px 10px 5px;
    color: #2c3e50;
}

.product-card .price {
    font-size: 1.3em;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 15px;
}

.product-card .btn {
    margin: 0 5px;
}

/* ---------- Tables (Cart, Orders, Admin) ---------- */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.cart-table th {
    background: #2c3e50;
    color: #ffffff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.cart-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: middle;
}

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

.cart-table tr:hover {
    background: #f8f9fa;
}

.cart-table img {
    border-radius: 6px;
    object-fit: cover;
}

/* ---------- Forms (Checkout, Add/Edit Product) ---------- */
.checkout-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
    max-width: 700px;
    margin: 20px 0;
}

.checkout-form label {
    display: block;
    margin: 18px 0 6px;
    font-weight: 600;
    color: #2c3e50;
}

.checkout-form input[type="text"],
.checkout-form input[type="email"],
.checkout-form input[type="number"],
.checkout-form input[type="file"],
.checkout-form textarea,
.checkout-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.checkout-form input:focus,
.checkout-form textarea:focus,
.checkout-form select:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

.checkout-form textarea {
    resize: vertical;
    min-height: 100px;
}

.checkout-form .btn {
    margin-top: 20px;
}

/* ---------- Product Detail Page – Professional Layout ---------- */
.product-detail-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.product-detail-card {
    display: flex;
    flex-wrap: wrap;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.product-detail-image {
    flex: 1 1 400px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.product-detail-image img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.3s;
}

.product-detail-image img:hover {
    transform: scale(1.03);
}

.product-detail-info {
    flex: 1 1 400px;
    padding: 40px 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-detail-title {
    font-size: 2.2em;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    line-height: 1.3;
}

.product-detail-description {
    font-size: 1.05em;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 30px;
}

.product-detail-description p {
    margin-bottom: 15px;
}

.product-detail-price {
    margin-bottom: 30px;
}

.price-value {
    font-size: 2em;
    font-weight: 700;
    color: #27ae60;
    background: #e8f8f0;
    padding: 8px 20px;
    border-radius: 30px;
    display: inline-block;
}

.product-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

/* Button overrides for product detail actions */
.btn-primary {
    background: #27ae60;
    color: white;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3);
}

.btn-primary:hover {
    background: #219150;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(39, 174, 96, 0.4);
}

.btn-secondary {
    background: #3498db;
    color: white;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

.btn-secondary:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(52, 152, 219, 0.4);
}

/* ---------- Utility / Messages ---------- */
.error {
    color: #e74c3c;
    background: #fadbd8;
    padding: 10px 20px;
    border-radius: 5px;
    margin: 15px 0;
}

.success {
    color: #27ae60;
    background: #d5f5e3;
    padding: 10px 20px;
    border-radius: 5px;
    margin: 15px 0;
}

/* ---------- AdSense Placeholder ---------- */
.adsense-placeholder {
    background: #ffffff;
    padding: 30px;
    margin: 40px auto;
    text-align: center;
    border: 2px dashed #bdc3c7;
    color: #7f8c8d;
    border-radius: 10px;
    max-width: 1200px;
}

/* ---------- Responsive Tweaks ---------- */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .main-nav {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .product-detail-card {
        flex-direction: column;
    }

    .product-detail-image {
        padding: 20px;
    }

    .product-detail-info {
        padding: 30px 25px;
    }

    .product-detail-title {
        font-size: 1.8em;
    }
}