/* ===============================
   GENERAL STYLING
   =============================== */
   *, *::before, *::after {
    box-sizing: border-box;
}


body {
    font-family: Arial, sans-serif;
    margin: 0;
     padding: 0;
    background: #000;
    color: #fff;
}

h1, h2 {
    text-align: center;
    margin: 15px 0;
    color: #fff;
	font-size: 22px;
}

/* ===============================
   CONTAINER
   =============================== */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 25px 30px;
    background: #1c1c1c;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
    font-size: 15px;
    line-height: 1.7;
    color: #ddd;
}

.container h1, 
.container h2, 
.container h3 {
    text-align: left;
    font-weight: bold;
    margin-bottom: 15px;
    color: #fff;
}

.container h1 { font-size: 22px; }
.container h2 { font-size: 18px; color: #eee; }
.container h3 { font-size: 16px; color: #ccc; }

.container p {
    margin-bottom: 15px;
    font-size: 15px;
    color: #ccc;
}

.container a {
    color: #4da6ff;
    text-decoration: none;
}
.container a:hover { text-decoration: underline; }

/* ===============================
   FILTERS
   =============================== */
.filters {
    text-align: center;
    margin-bottom: 20px;
}
.filters a {
    display: inline-block;
    margin: 3px;
    padding: 6px 10px;
    background: #333;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
}
.filters a.active { background: #007BFF; }

/* ===============================
   GRID & CARDS
   =============================== */

.card {
    position: relative;
    background: #182025;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(255,255,255,0.05);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    overflow: hidden; /* keep ribbons inside */
}
.card:hover {
    transform: scale(1.03);
    background: #2a2a2a;
    box-shadow: 0 4px 10px rgba(255,255,255,0.1);
}
.card h3 { margin: 10px 0 5px; font-size: 1.1em; }

/* ===============================
   WATCH CONTAINER (LISTING)
   =============================== */
.watch-container {
    width: 100%;
    aspect-ratio: 1/1;
    background: url('watch.png') center center no-repeat;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: center;
	 	border: 4px solid #595959;       /* full border around watch container */
    border-radius: 12px;          /* optional rounded corners */
    box-shadow: 0 4px 12px rgba(0,0,0,0.5); /* optional shadow */
}
.watch-container img {
    width: 78%;
    height: auto;
	  margin-bottom: 2px;
    object-fit: contain;
}

/* ===============================
   MODAL
   =============================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0,0,0,0.8);

    /* Smooth scrolling */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* important for smooth scrolling on iOS */
    padding: 20px 0;
}
.modal-content {
    background: #182025;
    margin: 0 auto;
    padding: 20px;
    border-radius: 8px;
    width: 85%;       /* relative width for desktop */
    max-width: 400px; /* smaller than before */
    color: #fff;
    text-align: center;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.modal-buttons a {
    display: inline-block;
    margin: 10px 5px 0;
    padding: 8px 15px;
    background: #28a745;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
	
}

.modal-buttons a:hover {
    background: #218838;  /* darker green on hover */
}

/* Close button */
.close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #ff9800;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    z-index: 10;
}
.close:hover { color: #fff; }


/* ===============================
   MODAL IMAGE
   =============================== */
.modal-image-container {
    position: relative;
    max-width: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    background: url('watch.png') center center no-repeat;
    background-size: contain;
}

.modal-image-container img {
    width: 80%;
    max-width: 250px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

#modalTitle { font-size: 1.2em; margin-bottom: 8px; }
#modalDesc { text-align: left; margin-top: 10px; line-height: 1.6; font-size: 0.95em; }


.modal-image-container a {
    display: block;
    width: 90%;
    height: 100%;
}
#modalImage {
    width: 78%;
    height: auto;
    object-fit: contain;
    display: block;
   
	margin: -4px auto 0 auto; /* negative top margin moves the image up inside container */
}

.modal-watch-container {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
 
}

.modal-watch-container .watch-container {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  background: url('watch.png') center center no-repeat;
  background-size: contain;
  display: flex;
  align-items: center;
  justify-content: center;
   	border: 4px solid #595959;       /* full border around watch container */
    border-radius: 12px;          /* optional rounded corners */
    box-shadow: 0 4px 12px rgba(0,0,0,0.5); /* optional shadow */
}

.modal-watch-container .watch-container img {
  width: 78%;
  height: auto;
  object-fit: contain;

  z-index: 2;
}



/* ===============================
   MODAL CONTENT TEXT
   =============================== */
#modalDesc {
    text-align: left;
    margin-top: 10px;
    line-height: 1.6;
}

/* Buttons */
.modal-buttons {
    margin-top: 15px;
}

#modalImage {
    cursor: pointer;
}
/* ===============================
   RIBBONS
   =============================== */
.ribbon {
    position: absolute;
    top: 10px;
    left: -30px;
    width: 140px;
    background: #f00;
    color: #fff;
    text-align: center;
    line-height: 22px;
    font-size: 11px;
    font-weight: bold;
    transform: rotate(-45deg);
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    pointer-events: none;
    padding: 2px 0;
}
.ribbon.free-ribbon { background: #28a745; }
.ribbon.new { background: #ff9800; }
.ribbon.sale {
    background: #e91e63; /* pinkish-red for sale */
}

/* ===============================
   PAGINATION
   =============================== */
.pagination {
    text-align: center;
    margin: 30px 0;
}
.pagination a {
    margin: 0 5px;
    padding: 8px 12px;
    background: #333;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
}
.pagination a.active { background: #007BFF; }

/* ===============================
   TOP BANNER
   =============================== */
.top-banner {
    background: #182025;
    padding: 4px 0;
    text-align: center;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.top-banner img {
    max-height: 60px;
    width: auto;
}
.top-banner p {
    margin: 5px 0 0;
    color: #ccc;
    font-size: 1em;
}



/* ===============================
   WATCH BACKGROUND SELECTOR
   =============================== */
.watch-selector {
    text-align: center;
    margin: 20px 0;
    color: #fff;
    font-size: 14px;
}

.watch-selector label {
    margin-right: 8px;
}

.watch-selector select {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #555;
    background: #222;
    color: #fff;
    cursor: pointer;
}

/* ===============================
   FOOTER
   =============================== */
.site-footer {
    text-align: center;
    padding: 20px;
    color: #aaa;
    font-size: 14px;
    margin-top: 30px;
}
.site-footer a { color: #aaa; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ===============================
   RESPONSIVE
   =============================== */
@media (max-width: 768px) {
    .featured { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .watch-container img { width: 82%; }
    .modal-content { max-width: 320px; padding: 15px; }
	 font-size: 20px; /* smaller on mobile */
}
@media (max-width: 480px) {
    .featured, .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .watch-container img { width: 78%; }
    .modal-content { max-width: 380px; padding: 12px; }
    .modal-image-container { max-width: 220px; }
    #modalImage { width: 77%; }
    .top-banner img { max-height: 40px; }
    .top-banner p { font-size: 0.85em; }
	font-size: 18px; /* slightly smaller on tablet */
}

.card,
.card * {
    -webkit-tap-highlight-color: transparent; /* Safari & Chrome */
    outline: none; /* remove focus outline */
    -webkit-user-select: none; /* optional: prevent text selection on tap */
    -ms-user-select: none;
    user-select: none;
}

/* ===============================
   CENTER GRID CARDS (NEWEST TO OLDEST)
   =============================== */
.featured, .grid {
    display: flex;           /* switch from grid to flex for easy centering */
    flex-wrap: wrap;         /* allow wrapping to new lines */
    justify-content: center; /* center cards horizontally */
    gap: 20px;               /* space between cards */
    margin: 0 auto;          /* center the container */
    padding-bottom: 20px;
}

.card {
   flex: 0 0 240px;
    max-width: 280px;
}
#modalImage {
    user-select: none;
}

/* ===============================
   LINK VISITED FIX
   =============================== */
a:link,
a:visited,
a:active,
a:focus {
    color: #ffffff;      /* keep links same color before and after click */
    text-decoration: none;
}

a:hover {
    color: #d79432;      /* optional hover color */
    text-decoration: underline;
}
/* ===============================
   SINGLE WATCHFACE PAGE LAYOUT (UPDATED)
   =============================== */
.watchface-page {
    max-width: 700px;
    margin: 40px auto;
    padding: 25px;
    background: #1c1c1c;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
    color: #fff;
    text-align: center; /* Title and buttons centered */
}

.watchface-page h1 {
    font-size: 26px;
    margin-bottom: 25px;
    color: #fff;
    text-align: center; /* Ensure title is centered on mobile too */
}

.watchface-page .watch-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 25px;
    background: url('/watch.png') center center no-repeat; /* restore watch background */
    background-size: contain;
    display: flex;
    justify-content: center;
	border: 4px solid #595959;       /* full border around watch container */
    border-radius: 12px;          /* optional rounded corners */
    box-shadow: 0 4px 12px rgba(0,0,0,0.5); /* optional shadow */
	
    align-items: center;
}

.watchface-page .watch-container img {
    width: 92%;        /* scale image inside background */
    max-width: 250px;  /* prevent it from being too big */
    height: auto;
    display: block;
    margin: -2px auto 0 auto;  /* move image up by 10px */
}

.watchface-page .description {
    font-size: 15px;
    line-height: 1.6;
    color: #ccc;
    text-align: left; /* Description left-aligned */
    margin-bottom: 25px;
}

.watchface-page .modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.watchface-page .modal-buttons .btn {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 6px;
    background: #007BFF;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}

.watchface-page .modal-buttons .btn:hover {
    background: #0056b3;
}

/* Responsive */
@media (max-width: 480px) {
    .watchface-page {
        padding: 15px;
        margin: 20px auto;
    }
    .watchface-page h1 {
        font-size: 22px; /* smaller font for mobile */
        text-align: center; /* ensure title stays centered */
    }
    .watchface-page .watch-container {
        max-width: 220px;
        margin-bottom: 20px;
    }
    .watchface-page .watch-container img {
        max-width: 180px;
    }
    .watchface-page .modal-buttons {
        gap: 10px;
    }
}
html, body {
    overflow-x: hidden;
}

@media (max-width: 480px) {
    .card {
        flex: 0 0 45%;
        max-width: 45%;
    }
}

/* Single page "View Watch Face" button color */
.watchface-page .modal-buttons .view-btn {
    background: #28a745;  /* green color, change as needed */
    color: #fff;
}

.watchface-page .modal-buttons .view-btn:hover {
    background: #218838;  /* darker green on hover */
}