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

body {
    font-family: 'Segoe UI', sans-serif;
    background: #fff5f7;
    color: #333;
}

/* HEADER */
header {
    background: #fff;
    border-bottom: 2px solid #ffb6c1;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 20px;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #e91e8c;
    text-decoration: none;
}
.search-form {
    display: flex;
    flex: 1;
    max-width: 400px;
}
.search-form input {
    flex: 1;
    padding: 8px 14px;
    border: 1.5px solid #ffb6c1;
    border-radius: 20px 0 0 20px;
    outline: none;
}
.search-form button {
    padding: 8px 14px;
    background: #e91e8c;
    color: #fff;
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
}
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.btn-review-upload, .btn-cart, .btn-auth {
    background: #fff0f5;
    border: 1.5px solid #ffb6c1;
    color: #e91e8c;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}
.btn-review-upload:hover, .btn-cart:hover, .btn-auth:hover {
    background: #e91e8c;
    color: #fff;
}

/* AUTH DROPDOWN */
.auth-dropdown {
    position: relative;
}

.auth-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px); /* Positions it perfectly below the button */
    background: #fff;
    border: 1px solid #ffb6c1;
    border-radius: 10px;
    min-width: 150px;
    z-index: 200;
    padding: 8px 0;
    box-shadow: 0 4px 15px rgba(233, 30, 140, 0.15); /* Added a soft shadow for depth */
}

/* This creates the invisible bridge so the menu doesn't disappear */
.auth-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
}

.auth-dropdown:hover .auth-menu {
    display: block;
}

.auth-menu a, .logout-btn {
    display: block;
    padding: 8px 16px;
    color: #e91e8c;
    text-decoration: none;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.auth-menu a:hover, .logout-btn:hover {
    background: #fff0f5;
}

/* PAGE WRAPPER */
.page-wrapper {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* SIDEBAR */
.sidebar {
    width: 220px;
    background: #fff;
    border-right: 2px solid #ffb6c1;
    padding: 20px 0;
    min-height: 100%;
    flex-shrink: 0;
}
.sidebar ul { list-style: none; }
.sidebar ul li a {
    display: block;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s;
}
.sidebar ul li a:hover { background: #fff0f5; color: #e91e8c; }
.submenu {
    display: none;
    background: #fff5f7;
    padding-left: 16px;
}
.submenu.open { display: block; }
.submenu li a { font-size: 13px; padding: 8px 16px; }

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}

/* HERO SLIDER */
.hero-slider {
    position: relative;
    width: 100%;
    max-height: 70vh; /* Forces the slider to never be taller than 70% of your screen height */
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 28px;
    background: #fff5f7; /* Matches your background color in case the image is narrow */
}
.slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
    align-items: center; /* Centers the images vertically */
}
.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.slide img {
    max-width: 100%;
    max-height: 70vh; /* Prevents the image from forcing the user to scroll */
    width: auto;
    height: auto;
    object-fit: contain; /* Keeps the exact 16:9, 3:4, or square aspect ratio perfectly intact */
}
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(233,30,140,0.6);
    color: #fff;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 50%;
    z-index: 10;
}
.prev { left: 12px; }
.next { right: 12px; }

/* AD CAROUSEL */
.ad-carousel {
    overflow: hidden;
    margin-bottom: 28px;
    border-radius: 12px;
}
.ad-track {
    display: flex;
    gap: 12px;
    animation: scrollAds 20s linear infinite;
    width: max-content;
}
.ad-item img {
    height: 160px;
    width: 240px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #ffb6c1;
}
@keyframes scrollAds {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* SECTION TITLE */
.section-title {
    font-size: 20px;
    font-weight: bold;
    color: #e91e8c;
    margin: 24px 0 14px;
    border-left: 4px solid #e91e8c;
    padding-left: 10px;
}

/* PRODUCT GRID */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.product-card {
    background: #fff;
    border: 1.5px solid #ffb6c1;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.product-card:hover { box-shadow: 0 4px 20px rgba(233,30,140,0.15); }
.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.product-info { padding: 12px; }
.product-info h3 { font-size: 15px; margin-bottom: 6px; }
.price { color: #e91e8c; font-weight: bold; font-size: 16px; }
.category { color: #999; font-size: 12px; margin: 4px 0 10px; }

/* BUTTONS */
.btn-pink {
    background: #e91e8c;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
}
.btn-pink:hover { background: #c0176d; }
.btn-danger {
    background: #ff4444;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}
.btn-danger:hover { background: #cc0000; }
.full-width { width: 100%; text-align: center; }

/* REVIEWS */
.reviews-preview {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.review-card {
    background: #fff;
    border: 1.5px solid #ffb6c1;
    border-radius: 12px;
    padding: 12px;
    width: 200px;
}
.review-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.review-card-full {
    background: #fff;
    border: 1.5px solid #ffb6c1;
    border-radius: 14px;
    padding: 16px;
    overflow: hidden;
}
.review-card-full img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}
.see-all-btn {
    display: inline-block;
    margin-top: 10px;
    color: #e91e8c;
    font-weight: bold;
    text-decoration: none;
}

/* AUTH CARD */
.auth-card {
    max-width: 440px;
    margin: 40px auto;
    background: #fff;
    border: 1.5px solid #ffb6c1;
    border-radius: 16px;
    padding: 32px;
}
.auth-card h2 { margin-bottom: 20px; color: #e91e8c; text-align: center; }
.auth-card label { display: block; margin-bottom: 4px; font-size: 13px; color: #666; }
.auth-card input, .auth-card textarea, .auth-card select {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 14px;
    border: 1.5px solid #ffb6c1;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}
.auth-card p { text-align: center; margin-top: 14px; font-size: 14px; }
.auth-card p a { color: #e91e8c; }

/* ALERTS */
.alert {
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert.success { background: #e6ffe6; color: #2a7a2a; border: 1px solid #b3e6b3; }
.alert.error { background: #ffe6e6; color: #a00; border: 1px solid #f5c6c6; }

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    width: 90%;
    max-width: 420px;
}
.modal-box h3 { color: #e91e8c; margin-bottom: 16px; }
.modal-box label { display: block; margin-bottom: 4px; font-size: 13px; color: #666; }
.modal-box input, .modal-box textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1.5px solid #ffb6c1;
    border-radius: 10px;
    font-size: 14px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* CART TABLE */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.cart-table th {
    background: #ffb6c1;
    color: #fff;
    padding: 12px;
    text-align: left;
}
.cart-table td {
    padding: 12px;
    border-bottom: 1px solid #fff0f5;
    vertical-align: middle;
}
.cart-total {
    text-align: right;
    font-size: 20px;
    color: #e91e8c;
    padding: 10px;
}

/* ADMIN */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: #fff;
    border: 2px solid #ffb6c1;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
}
.stat-card h3 { font-size: 36px; color: #e91e8c; }
.stat-card p { color: #777; margin-top: 6px; }
.admin-links { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.admin-table th {
    background: #ffb6c1;
    color: #fff;
    padding: 12px 16px;
    text-align: left;
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #fff0f5;
    vertical-align: middle;
}
.admin-form-card {
    background: #fff;
    border: 1.5px solid #ffb6c1;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 28px;
}
.admin-form-card h3 { color: #e91e8c; margin-bottom: 16px; }
.admin-form-card input,
.admin-form-card textarea,
.admin-form-card select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1.5px solid #ffb6c1;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

/* FOOTER */
footer {
    background: #fff;
    border-top: 2px solid #ffb6c1;
    padding: 30px 40px 10px;
}
.footer-inner {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 20px;
}
.footer-col h4 { color: #e91e8c; margin-bottom: 10px; }
.footer-col a, .footer-col p {
    display: block;
    color: #555;
    text-decoration: none;
    margin-bottom: 6px;
    font-size: 14px;
}
.footer-bottom {
    text-align: center;
    color: #aaa;
    font-size: 13px;
    padding-top: 10px;
    border-top: 1px solid #ffb6c1;
}

/* PAGE HEADING */
.page-heading {
    font-size: 24px;
    color: #e91e8c;
    margin-bottom: 20px;
    border-left: 4px solid #e91e8c;
    padding-left: 12px;
}

/* EMPTY MSG */
.empty-msg {
    text-align: center;
    color: #aaa;
    font-size: 16px;
    padding: 40px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-slider { height: 200px; }
    .header-inner { flex-wrap: wrap; }
}

/* ===== PRODUCT PROFILE PAGE ===== */
.product-profile-container {
    display: flex;
    gap: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    border: 1.5px solid #ffb6c1;
}
.product-image-box {
    flex: 1;
    max-width: 400px;
}
.product-image-box img {
    width: 100%;
    border-radius: 12px;
    object-fit: contain;
}
.product-details-box {
    flex: 1.5;
}
.product-details-box h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}
.price-large {
    font-size: 24px;
    color: #e91e8c;
    margin-bottom: 10px;
}
.size-options {
    margin-bottom: 20px;
}
.size-options label {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}
.size-btn {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 8px;
    transition: 0.3s;
}
.size-btn:hover, .size-btn.active {
    background: #fff0f5;
    border-color: #e91e8c;
    color: #e91e8c;
    font-weight: bold;
}
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
.btn-action {
    flex: 1;
    padding: 12px;
    border-radius: 30px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}
.btn-cart { background: #e91e8c; color: white; }
.btn-buy { background: #8a4b62; color: white; }
.btn-whatsapp { background: #25D366; color: white; }

/* ===== CHECKOUT PAGE ===== */
.checkout-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.checkout-left { flex: 2; }
.checkout-right { flex: 1; position: sticky; top: 90px; }
.checkout-card {
    background: #fff;
    border: 1.5px solid #ffb6c1;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.checkout-card h3 { color: #e91e8c; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; }
.checkout-card input[type="text"], .checkout-card textarea {
    width: 100%; padding: 10px; border: 1px solid #ffb6c1; border-radius: 8px; margin-bottom: 15px; outline: none;
}
.radio-group { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.checkout-summary-card {
    background: #fff0f5;
    border: 1.5px solid #ffb6c1;
    border-radius: 12px;
    padding: 24px;
}
.summary-product { display: flex; gap: 15px; align-items: center; }
.summary-product img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.totals-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 15px; }
.total-final { font-size: 20px; font-weight: bold; color: #e91e8c; }

/* ===== QUANTITY SELECTOR ===== */
.qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.qty-btn {
    background: #fff0f5;
    border: 1px solid #ffb6c1;
    color: #e91e8c;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
.qty-btn:hover {
    background: #e91e8c;
    color: #fff;
}
.qty-control input {
    width: 60px !important;
    text-align: center;
    border: 1px solid #ffb6c1 !important;
    border-radius: 8px !important;
    padding: 8px !important;
    font-size: 16px;
    font-weight: bold;
    pointer-events: none; /* Prevents user from typing letters */
    margin-bottom: 0 !important;
}

/* ===== NEWS TICKER ===== */
.news-ticker {
    background-color: #000;
    color: #fff;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    display: flex;
    align-items: center;
}

.ticker-text {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    animation: scrollTicker 15s linear infinite;
}

/* This makes the text slide continuously from right to left */
@keyframes scrollTicker {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* Minor adjustment to the header to fit the ticker perfectly */
header {
    padding: 0;
}
.header-inner {
    padding: 10px 20px;
}

/* ===== PROFESSIONAL IMAGE UPLOAD BOX ===== */
.image-upload-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    border: 2px dashed #ffb6c1;
    border-radius: 12px;
    background-color: #fffafb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 15px;
    transition: 0.3s ease;
}
.image-upload-wrapper:hover {
    background-color: #fff0f5;
    border-color: #e91e8c;
}
.image-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.upload-placeholder {
    text-align: center;
    color: #888;
    pointer-events: none;
}
.upload-placeholder i {
    font-size: 40px;
    color: #ccc;
    margin-bottom: 10px;
}
.upload-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Keeps the whole image visible */
    background-color: #fff;
    z-index: 1;
    display: none; /* Hidden until an image is selected */
}

/* ===== ADMIN ORDER STATUS BADGES ===== */
.status-badge {
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}
.status-pending { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.status-confirmed { background-color: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.status-delivered { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-cancelled { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.btn-outline { border: 1px solid #e91e8c; color: #e91e8c; padding: 8px 16px; border-radius: 8px; text-decoration: none; }
.btn-outline:hover { background: #e91e8c; color: white; }

/* =========================================
   📱 MOBILE RESPONSIVENESS (MEDIA QUERIES)
   ========================================= */

/* Hide mobile elements on Desktop */
.mobile-menu-btn { display: none; font-size: 24px; cursor: pointer; color: #e91e8c; }
.close-sidebar { display: none; }

/* Trigger when screen gets smaller than an iPad (768px) */
@media (max-width: 768px) {

    /* 1. Header Adjustments */
    .header-inner {
        flex-wrap: wrap; /* Allows items to wrap to the next line */
        gap: 10px;
        padding: 10px;
    }
    .mobile-menu-btn { display: block; } /* Show the hamburger */
    .hide-on-mobile { display: none; } /* Hide text next to icons to save space */

    /* Force search bar to take up its own full line */
    .search-form {
        order: 3;
        width: 100%;
        margin-top: 5px;
    }

    /* 2. Sidebar to Off-Canvas Mobile Menu (UPDATED FOR GUARANTEED VISIBILITY) */
    .page-wrapper { flex-direction: column; }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        transform: translateX(-110%) !important; /* Forces it completely off-screen */
        width: 260px !important;
        height: 100vh !important;
        background: white !important;
        z-index: 99999 !important; /* Forces it above EVERYTHING else */
        transition: transform 0.3s ease-in-out !important;
        box-shadow: 4px 0 25px rgba(0,0,0,0.5) !important;
        padding-top: 60px !important;
        overflow-y: auto !important;
        display: block !important;
    }

    .sidebar.active {
        transform: translateX(0) !important; /* Forces it to slide in! */
    }

    .close-sidebar {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 28px;
        color: #333;
        cursor: pointer;
    }

    /* 3. Checkout Page & Form Stacking */
    .checkout-container, .product-profile-container {
        flex-direction: column;
    }
    .checkout-left, .checkout-right, .product-image-box, .product-details-box {
        width: 100%;
    }

    /* 4. Table Scroll (Prevents tables from breaking the screen width) */
    .admin-table {
        display: block;
        width: 100%;
        overflow-x: auto; /* Adds a horizontal scrollbar just for the table */
        white-space: nowrap;
    }

    /* 5. Footer Stacking */
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    /* 6. Fix Insights Dashboard Grid */
    .stats-grid {
        grid-template-columns: 1fr; /* Stack cards 1 on top of another */
    }
}

/* For very small phones (max-width 480px) */
@media (max-width: 480px) {
    .logo span { font-size: 20px !important; }
    .news-ticker .ticker-text { font-size: 12px; }
    .action-buttons { flex-direction: column; } /* Stack buy buttons */
    .btn-action { width: 100%; justify-content: center; }
}