/* =====================================================
   GLOBAL
   ===================================================== */
html, body {
    height: 100%;
    overflow: hidden; /* body NEVER scrolls */
}

body {
    font-family: Arial, sans-serif;
    background: #fffdf0;
    margin: 0;
    color: #1A2D8C;
	overflow-x: hidden;
}
body.modal-open {
    overflow: hidden;
}
/* =====================================================
   HEADER
   ===================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    padding: 12px 20px;

    background: #1A2D8C;
    color: #FFED00;
    border-bottom: 4px solid #FFED00;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}
/* THIS is what scrolls */
.app-scroll {
    height: calc(100vh - 72px); /* header height */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
/* Left group: burger + logo + title */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

/* Burger (mobile only) */
.burger-left {
    display: none;
    background: transparent;
    border: none;
    color: #FFED00;
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 1023px) {
    .burger-left {
        display: inline-flex;
    }
}

/* Logo & Title */
.site-logo {
    height: 38px;
}

.site-title {
    font-size: clamp(18px, 2.5vw, 26px);
    font-weight: bold;
    white-space: nowrap;
}

/* =====================================================
   HEADER SEARCH
   ===================================================== */
/* Updated Header Search */
.header-search {
    margin-left: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;  /* Ensure alignment to the left */
    z-index: 2; /* Ensure the search input stays above other content */
}

/* Icon */
.search-icon {
    font-size: 18px;
    cursor: pointer;
    color: #FFED00;
    padding: 6px;
    z-index: 1;
    display: inline-block;
}

/* Floating Input */
#searchInput {
    width: 180px; /* Adjust width as needed */
    opacity: 0;
    padding: 6px 32px 6px 10px;
    margin-left: 10px; /* Space between the icon and the input */
    border-radius: 6px;
    border: none;
    outline: none;
    font-size: 14px;
    background: #fff;
    position: absolute; /* Position input below the icon */
    top: 10%; /* Align it directly below the search icon */
        right: 0;
    z-index: 2; /* Ensure it floats above the background elements */
    transition: opacity 0.25s ease, visibility 0.25s ease;
    visibility: hidden; /* Initially hidden */
}

/* Open state for the search box */
.header-search.active #searchInput {
    opacity: 1;
    visibility: visible;
}

/* Clear button */
.search-clear {
    position: absolute;
    right: 8px;
    font-size: 14px;
    cursor: pointer;
    color: #666;
    display: none;
	 z-index: 3;
}

/* Show clear when text exists */
.header-search.has-value .search-clear {
    display: block;
}
@media (max-width: 1024px) {
    .header-search {
        flex-direction: column; /* Stack the icon and input vertically */
        align-items: flex-start; /* Align the input with the search icon */
    }
	.search-clear {
		top: 20%;
	}
    /* Position the input below the icon with a little space */
    #searchInput {
        width: 200px; /* Adjust width to fit smaller screens */
        top: 10%; /* Position it below the icon */
        right: 0;
        margin-left: 0; /* Remove left margin */
        z-index: 2;
    }
}
/* Mobile */
@media (max-width: 600px) {
	.header-search {
        flex-direction: column; /* Stack the icon and input vertically */
        align-items: flex-start; /* Align the input with the search icon */
    }
	.search-clear {
		top: 20%;
	}
    /* Position the input below the icon with a little space */
    #searchInput {
        width: 200px; /* Adjust width to fit smaller screens */
        top: 10%; /* Position it below the icon */
        right: 0;
        margin-left: 0; /* Remove left margin */
        z-index: 2;
    }
    .header-search.active #searchInput,
    .header-search.has-value #searchInput {
        width: 140px;
    }
	.gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 10px;
    }
	.cake-card {
        max-width: none;   /* remove 260px limit */
    }

    .cake-name {
        font-size: 14px;
    }
    .cake-price {
        font-size: 13px;
    }
	 .cake-card img {
        aspect-ratio: 3 / 4;
        height: auto;
    }
}

/* =====================================================
   PAGE LAYOUT
   ===================================================== */
.page-layout {
    display: flex;
    width: 100%;
    gap: 30px;
	min-height: 100vh;
}

/* =====================================================
   CATEGORY SIDEBAR (DESKTOP)
   ===================================================== */
.category-sidebar {
    width: 260px;
    padding: 20px 0;
    background: #fff9cf;
    border-radius: 0 12px 12px 0;
}

.sidebar-title {
    font-size: 22px;
    font-weight: bold;
    padding: 0 22px 14px;
}

.category-sidebar a {
    display: block;
    padding: 14px 22px;
    text-decoration: none;
    font-weight: 600;
    color: #1A2D8C;
}

.category-sidebar a:hover {
    background: rgba(26,45,140,0.12);
}

.category-sidebar a.active {
    background: #1A2D8C;
    color: #FFED00;
    position: relative;
}

.category-sidebar a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #FFED00;
}

@media (max-width: 1023px) {
    .category-sidebar {
        display: none;
    }
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.content-area {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
	overflow: visible;
}

.category-title {
    margin: 30px 0 20px;
    text-align: center;
    font-size: clamp(26px, 4vw, 38px);
    letter-spacing: 2px;
    font-weight: bold;
    text-transform: uppercase;
    color: #1A2D8C;
}

/* =====================================================
   GALLERY
   ===================================================== */
.gallery {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    padding: 20px;
	
}
.gallery-container {
    position: relative;
}

/* Hide cards only while loading */
.gallery-container.loading .cake-card {
    opacity: 0;
    transform: translateY(6px);
}
/* When ready */
.gallery-container.loaded .gallery {
    display: grid;
    animation: fadeIn 0.35s ease;
}

.gallery-container.loaded .gallery-loader {
    display: none;
}
/* Reveal cards */
.gallery-container.loaded .cake-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.gallery-loader::before {
    content: "⏳";
    display: inline-block;
    animation: spin 1.2s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Loader visible by default */
.gallery-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
    font-size: 16px;
    color: #1A2D8C;
}

/* Hourglass */
.hourglass {
    width: 40px;
    height: 40px;
    border: 4px solid #1A2D8C;
    border-color: #1A2D8C transparent #1A2D8C transparent;
    border-radius: 50%;
    animation: hourglass-spin 1.2s linear infinite;
}

@keyframes hourglass-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 12px;
    font-weight: bold;
    color: #1A2D8C;
}
/* While images loading */
.gallery-container.loading {
    opacity: 0;
}

/* When fully ready */
.gallery-container.loaded {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.25s ease;
}

/* Hide gallery while loading */
.gallery-container.loading .gallery {
    opacity: 0;
    pointer-events: none;
}
/* Show gallery when ready */
.gallery-container.loaded .gallery {
    opacity: 1;
    transition: opacity 0.35s ease;
}
/* Hide loader when ready */
.gallery-container.loaded .gallery-loader {
    display: none;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* =====================================================
   CAKE CARD
   ===================================================== */
.cake-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
	position: relative;
	overflow: hidden;
	 will-change: opacity, transform;
}

@media (min-width: 601px) {
    .cake-card {
        max-width: 260px;
    }
}
.cake-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.cake-card img {
    width: 100%;
    aspect-ratio: 3 / 4;   /* portrait ratio */
    object-fit: cover;
    display: block;
}

/* =========================
   CAKE INFO (NAME + PRICE)
   ========================= */
.cake-info {
    padding: 10px 12px 12px;
    text-align: center;
}

.cake-name {
    font-weight: bold;
    font-size: 15px;
    line-height: 1.2;
    margin-bottom: 4px;
}

.cake-price {
    font-size: 14px;
    font-weight: 600;
    color: #2B2F42; /* matches best seller vibe */
	margin-top: 2px;
}
.cake-card:has(.badge-best) .cake-price {
    color: #D32F2F;
}

.badge-best {
    position: absolute;
    top: 20px;
    left: -45px;
    background: #b3261e;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 6px 40px;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    z-index: 3;
    pointer-events: none;
}

/* ======================
   MODAL – IMAGE FIRST
   ====================== */
/* BACKDROP */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

/* SHOW */
.modal.show {
    display: flex;
    animation: fadeIn 0.25s ease;
}

/* MODAL CONTAINER */
.modal-content {
    background: #fff;
    width: 96%;
    max-width: 1100px;
    max-height: calc(100dvh - 24px); /* 🔥 dynamic viewport */
    border-radius: 18px;
	-webkit-overflow-scrolling: touch;
    padding: 18px;
    position: relative;
    overflow-y: auto;
	z-index: 10001;
	
}

/* CLOSE BUTTON */
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;

    z-index: 50;          /* 🔥 higher than image & ribbon */

    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
    font-weight: bold;
    color: #1A2D8C;
    cursor: pointer;
}


/* TWO-COLUMN LAYOUT */
.modal-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
}

.modal-image {
    position: relative;
}
/* IMAGE */
.modal-image img {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 14px;
    display: block;
	 position: relative;
    z-index: 1;   /* BELOW close button */
}

/* DETAILS */
.modal-details h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.modal-details p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.4;
}

/* VARIANTS */
.variant-list {
    display: grid;
    gap: 10px;
}

/* Labels inside cards */
.variant-card strong {
    color: #243A8F;   /* brand blue */
    font-weight: 700;
}

/* Label */
.variant-line strong {
    color: #243A8F;
    flex-shrink: 0;             /* keep label visible */
}
/* Value */
.variant-line span {
    color: #1F2937;             /* dark readable gray */
    font-weight: 600;
}
/* RIBBON */
.modal-ribbon {
    position: absolute;
    top: 30px;
    left: -65px;
    background: #b3261e;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 8px 70px;
    transform: rotate(-45deg);
    letter-spacing: 1px;
    z-index: 10;
    display: none;
}

/* SHOW RIBBON */
.modal.show .modal-ribbon {
    display: block;
}
/* =========================
   MODAL VARIANT CARD
   ========================= */
#modalVariants {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px;          /* 👈 tighter */
    margin-top: 8px;  /* 👈 tighter */
}

.variant-card {
    background: #fff9cf;
    border: 2px solid #243A8F;
    border-radius: 10px;

    padding: 10px 12px;
    margin-bottom: 0;   /* tighter spacing */

    font-size: 14px;
    line-height: 1.35;

    white-space: normal;       /* ✅ allow wrapping */
    word-break: break-word;    /* ✅ break long text */
}
/* Label lines */
.variant-card div {
    margin-bottom: 2px;        /* tighter vertical spacing */
}
/* One-line rows */
.variant-line {
    display: flex;
    gap: 6px;
    align-items: baseline;

    white-space: normal;        /* ✅ allow wrapping */
    word-break: break-word;     /* ✅ prevent cutoff */
    font-size: 14px;
    line-height: 1.4;
}

/* PRICE */
.variant-price {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 800;
    color: #c62828;
}

/* Optional: subtle inner look */
.variant-card::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 6px;
    pointer-events: none;
}
/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.92); }
    to   { transform: scale(1); }
}

/* MOBILE */
@media (max-width: 768px) {
    .modal-layout {
        grid-template-columns: 1fr;
    }
	 .modal {
        align-items: flex-start;
        padding: 12px 0;
    }
	 html, body {
        height: auto;
        overflow-y: auto;
    }

    .content-area {
        overflow: visible;
        padding-bottom: 20px;
    }

     .pagination {
        display: flex !important;
        justify-content: center;
    }
}


/* =====================================================
   MOBILE SIDE MENU
   ===================================================== */
.side-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 9998;
}
.site-header.scrolled {
    padding: 8px 20px;
}
.side-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100dvh;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 10000;
	pointer-events: auto;
    display: flex;
    flex-direction: column;
}


.side-menu.open {
    transform: translateX(0);
}

.side-menu-header {
    background: #1A2D8C;
    color: #FFED00;
    padding: 16px;

    display: flex;
    align-items: center;
    justify-content: space-between; /* 👈 pushes X to the right */

    font-weight: bold;
}

.side-menu a {
    padding: 14px 16px;
    text-decoration: none;
    font-weight: bold;
    color: #1A2D8C;
    border-bottom: 1px solid #eee;
}

.side-menu a:hover,
.side-menu a.active {
    background: #1A2D8C;
    color: #FFED00;
}

/* Lock body scroll */
body.menu-open {
    overflow: hidden;
}

.side-menu::after {
    content: "";
    position: sticky;
    bottom: 0;
    height: 24px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.08));
}
.side-menu-body {
    flex: 1;                        /* 👈 take remaining height */
    overflow-y: auto;           /* 👈 enable scroll */
    -webkit-overflow-scrolling: touch;
}
.side-menu-body a {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    font-weight: bold;
    color: #1A2D8C;
    border-bottom: 1px solid #eee;
}

.side-menu-body a.active,
.side-menu-body a:hover {
    background: #1A2D8C;
    color: #FFED00;
}

.side-menu-title {
    font-size: 18px;
}
/* Footer */
.side-menu-footer {
    margin-top: auto;              /* pushes to bottom */
    padding: 12px;
    border-top: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.side-menu-footer button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    background: #1A2D8C;
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;    /* ANDROID FIX */
}
.side-menu-footer button:active {
    transform: scale(0.97);
}

/* Close button */
.close-side {
    background: none;
    border: none;
    color: #FFED00;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.close-side:hover {
    opacity: 0.8;
}

.close-side:active {
    transform: scale(0.9);
}

/* =====================================================
   GOOGLE-STYLE PAGINATION
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 20px 0;
    flex-wrap: wrap;
    font-size: 14px;
}

.pagination a,
.pagination span {
    padding: 4px 8px;
    min-width: auto;
    height: auto;
    border: none;
    background: transparent;
    color: #1a0dab; /* Google blue */
    font-weight: normal;
    text-decoration: none;
    cursor: pointer;
}

/* Hover */
.pagination a:hover {
    text-decoration: underline;
}

/* Active page */
.pagination a.active {
    color: #000;
    font-weight: bold;
    cursor: default;
    text-decoration: none;
}

/* Disabled text (ellipsis) */
.pagination .ellipsis {
    color: #777;
    cursor: default;
}

/* Prev / Next */
.pagination a.prev,
.pagination a.next {
    font-weight: normal;
}

/* =====================================================
   DESKTOP SAFETY (HIDE MOBILE MENU)
   ===================================================== */
@media (min-width: 1024px) {
    .side-menu,
    .side-overlay {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .modal-content img {
        max-height: 80vh;
    }
}

.app-version {
    text-align: center;
    font-size: 12px;
    opacity: 0.7;
    margin-top: 6px;
}

@media (min-width: 768px) {
  .app-version {
    display: none;
  }
}
.web-toast {
    position: fixed;
    bottom: 90px; /* above Android nav bar */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    z-index: 99999;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.web-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
}
/* =========================
   LOGIN MODAL
   ========================= */
.login-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 12000;
}

.login-modal.show {
    display: flex;
}

.login-box {
    background: #fff;
    width: 90%;
    max-width: 360px;
    border-radius: 14px;
    padding: 20px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.login-box h3 {
    margin: 0 0 14px;
    text-align: center;
    color: #1A2D8C;
}

.login-box label {
    font-size: 13px;
    font-weight: bold;
    display: block;
    margin-top: 12px;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.login-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

.login-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.login-submit {
    background: #1A2D8C;
    color: #FFED00;
}

.login-cancel {
    background: #eee;
}

/* Desktop only */
@media (max-width: 1023px) {
    #btnLogin {
        display: none;
    }
}


