/* ===============================
   GLOBAL RESET
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===============================
   BACKGROUND VIDEO (FIXED)
================================ */
#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* ===============================
   BODY
================================ */
body {
    font-family: Arial, sans-serif;
}

/* ===============================
   HEADER
================================ */
.banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #000;
    padding: 10px;
    margin-bottom: 100px;
    border-bottom: 6px solid;
    border-image: linear-gradient(90deg, red, yellow, green) 1;
    
}

#logo img {
    height: 100px;
}

#title-container {
    text-align: center;
    color: #000;
    flex-grow: 1;
}

#title-image {
    max-width: 320px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.7));
    }
}

#tagline {
    font-size: 30px;
    color: #fff;
    font-weight: 500;
    font-family: 'Great Vibes', cursive;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
    letter-spacing: 1.5px;
}

/* ===============================
   LAYOUT
================================ */
#main-layout {
    display: flex;
}

/* FIX: allows grid to expand properly */
#content-area {
    flex: 1;
    padding: 20px;
    min-width: 0;
}

/* ===============================
   SIDEBAR (FIXED)
================================ */
#side-bar {
    display: flex;
    flex-direction: column;
    padding: 20px;

    width: 200px;
    height: 75%;

    background-color: #008631;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    border-radius: 6px;

    position: static; /* FIXED (removed layout-breaking offset) */
}

/* SEARCH */
#search-bar {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: none;
    margin-bottom: 10px;
}

/* FILTERS */
#filters {
    display: flex;
    flex-direction: column;
}

#filters select {
    padding: 10px;
    border-radius: 5px;
    border: none;
    background-color: #333;
    color: white;
    font-size: 14px;
    margin-bottom: 10px;
}

/* ===============================
   SIDEBAR ADS
================================ */
.sidebar-ads {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ad-img {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    cursor: pointer;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* hover effect = more premium */
.ad-img:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.ads-title {
    font-size: 12px;
    color: #eee;
    opacity: 0.7;
    text-align: center;
}

/* ===============================
   PRODUCT GRID
================================ */
#products-container {
    width: 100%;
    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 60px;

    padding: 20px;
}

/* ===============================
   PRODUCT CARD
================================ */
.product-card {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 16px;
    overflow: hidden;

    border: 1px solid rgba(255, 0, 0, 0.7);

    transition: transform 0.3s ease, box-shadow 0.3s ease;

    animation: pulseGlow 3s infinite ease-in-out;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* GLOW */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255,0,0,0.15),
                    0 0 15px rgba(0,255,0,0.1),
                    0 0 20px rgba(255,255,0,0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(255,0,0,0.25),
                    0 0 25px rgba(0,255,0,0.2),
                    0 0 30px rgba(255,255,0,0.2);
    }
}

/* IMAGE */
.product-image-container {
    height: 220px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* INFO */
.product-info {
    padding: 15px;
    color: white;
}

.product-name {
    font-size: 18px;
    font-weight: bold;
}

.store-name {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 6px;
}

.product-price {
    font-size: 16px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 8px;
}

.product-description {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 10px;
}

/* COLORS */
.color-options {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
}

.color-dot.red { background: #ff3b3b; }
.color-dot.green { background: #00c853; }
.color-dot.yellow { background: #ffd600; }
.color-dot.black { background: #111; }

/* SIZES */
.size-options {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.size {
    padding: 3px 6px;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 11px;
}

/* BUTTONS */
.card-buttons {
    display: flex;
    gap: 6px;
}

.add-to-cart-btn {
    flex: 1;
    padding: 6px;
    background: #00c853;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    cursor: pointer;
}

.buy-now-btn {
    flex: 1;
    padding: 6px;
    background: #ff3b3b;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    cursor: pointer;
}

.quantity-container {
    position: absolute;
    right: 12px;
    top: 50%;

    display: flex;
    align-items: center;
    gap: 4px;

    background: rgba(0,0,0,0.6);
    padding: 2px 4px;
    border-radius: 6px;
}

.quantity-input {
    width: 60px;        
    padding: 2px 4px;   
    font-size: 12px;    
    text-align: center;
}
/* ===============================
   BUTTONS & FOOTER
================================ */
#return-btn-container {
    position: absolute;
    top: 180px;
    right: 20px;
}

#main-screen-btn {
    padding: 8px 14px;
    background-color: red;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
}

.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: 55px;
    height: 55px;

    background-color: green;
    color: black;

    border: none;
    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 20px;

    cursor: pointer;

    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.5);
}

/* FOOTER */
#footer {
    color: grey;
    text-align: center;
    font-size: 14px;
    position: relative;
    bottom: 0;
    width: 100%;
    background: none !important;
}

#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    right: 20%;
    width: 200px;
}

#pagination button {
    padding: 8px 14px;
    background: #111;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
}

#pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#page-info {
    color: #FFD700;
    font-weight: bold;
}

#loader {
  display: none;
  justify-content: center;
  margin: 30px 0;
 }

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top: 4px solid #FFD700;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===============================
   SHOP INTRO
================================ */
#shop-intro {
    margin: 20px auto 10px;
    padding: 15px 25px;
    max-width: 70%;

    text-align: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.6;
    font-family: Arial;

    color: #000;
    background: linear-gradient(90deg, #008631, #ffd700, #e31b23);
    border-radius: 10px;

    box-shadow: 0 5px 15px rgba(0,0,0,0.3);

    opacity: 0;
    transform: translateY(-20px);
}

/* LOAD ANIMATION */
#shop-intro.show {
    animation: introFade 1.2s ease forwards;
}

@keyframes introFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================
   LOGIN REQUIRED MODAL
================================ */
.login-modal {
  position: relative;
  background: #111;
  color: white;
  padding: 25px;
  border-radius: 14px;
  width: 320px;
  text-align: center;
  justify-content: center;
  align-items: center;

  border: 2px solid gold;

  box-shadow:
    0 0 20px rgba(255, 215, 0, 0.4),
    0 0 30px rgba(0, 255, 0, 0.2);

  animation: modalPop 0.3s ease;
}

@keyframes modalPop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.login-modal h2 {
  color: #FFD700;
  margin-bottom: 10px;
}

.login-modal p {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 20px;
}

/* BUTTON GROUP */
.modal-actions {
  display: flex;
  gap: 10px;
}

/* BUTTON BASE */
.modal-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s ease;
}

/* LOGIN */
.login-btn {
  background: #00c853;
  color: black;
}

.login-btn:hover {
  background: #00e676;
}

/* GUEST */
.guest-btn {
  background: #FFD700;
  color: black;
}

.guest-btn:hover {
  background: #ffea00;
}

/* CLOSE BUTTON */
.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover {
  color: white;
}

.modal {
  display: none;              /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0,0,0,0.6); /* dark overlay */

  justify-content: center;   /* horizontal center */
  align-items: center;       /* vertical center */

  z-index: 9999;
}

/* OVERLAY */
#cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);

  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;

  z-index: 9998;
}

#cart-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* SIDE CART */
#side-cart {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  height: 100%;

  background: #0a0a0a;
  color: white;

  display: flex;
  flex-direction: column;

  transition: right 0.35s ease;
  z-index: 9999;

  box-shadow: -5px 0 25px rgba(0,0,0,0.6);
}

#side-cart.active {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cart-header h2 {
  font-size: 18px;
  color: #FFD700;
  flex: 1;
  margin: 0;
}

#cart-close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
  padding-left: 10px;
  width: 50px;
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.cart-item {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  padding: 8px;
  border-radius: 10px;

  margin-bottom: 10px;

  border-left: 3px solid #00c853;
}

.cart-footer {
  padding: 15px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.promo-input {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: none;
  margin-bottom: 10px;
  background: #111;
  color: white;
}

.cart-total {
  font-weight: bold;
  color: #FFD700;
  margin-bottom: 10px;
}

.cart-item-price {
  color: #FFD700;
}

.cart-item-price,
.cart-total {
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

.checkout-btn {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;

  background: linear-gradient(90deg, #00c853, #FFD700);
  border: none;
  border-radius: 8px;
}

.empty-cart-btn {
  width: 100%;
  padding: 10px;

  background: #ff3b3b;
  border: none;
  border-radius: 8px;
  color: white;
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0; /* prevents squishing */
}

/* TEXT WRAP FIX */
.cart-item-info {
  flex: 1;
  min-width: 0; /* 🔥 critical for preventing overflow */
}

/* PREVENT TEXT FROM BREAKING LAYOUT */
.cart-item-name {
  font-size: 13px;
  font-weight: bold;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-qty {
  font-size: 13px;
}

.cart-delete {
  width: 12%;
  background: none;
}

.cart-icon-wrapper {
  position: relative;
  width: 28px;
  height: 28px;
}

/* CART ICON */
.cart-icon-img {
  width: 100%;
  height: 100%;
  display: block;
}

/* SPINNER (hidden by default) */
.cart-spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  border: 3px solid transparent;
  border-top: 3px solid red;
  border-right: 3px solid yellow;
  border-bottom: 3px solid green;
  border-radius: 50%;

  animation: spin 0.8s linear infinite;

  display: none;
}

/* SPIN ANIMATION */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.cart.loading .cart-icon-img {
  display: none;
}

.cart.loading .cart-spinner {
  display: block;
}

.cart-loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 999;

  background: conic-gradient(
    red,
    yellow,
    green,
    red
  );

  -webkit-mask: radial-gradient(circle 60% at center, transparent 60%, black 61%);
          mask: radial-gradient(circle 60% at center, transparent 60%, black 61%);

  animation: spinCartLoader 0.8s linear infinite;
}

@keyframes spinCartLoader {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {

    #main-layout {
        flex-direction: column;
    }

    #logo img {
        height: 70px;
    }

    #side-bar {
        width: 100%;
        height: auto;
        margin-top: 10px;
        align-items: center;
        padding: 5px;
    }

    #filters {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    #filters select {
        font-size: 11px;
        padding: 5px;
    }

    /* FIXED ID */
    #products-container {
        grid-template-columns: 1fr;
        margin-left: 0;
    }

    #title-image {
        max-width: 200px;
    }

    #tagline {
        font-size: 14px;
    }

    #header-icons {
        flex-direction: column;
    }

    #header-icons i {
        font-size: 14px;
    }

    #cart-indicator {
        font-size: 9px;
        padding: 2px 4px;
    }

    #search-bar {
        width: 80%;
        padding: 3px;
        margin-left: 3px;
    }

    #return-btn-container {
        position: relative;
    }

    #main-screen-btn {
        font-size: 12px;
        padding: 5px 8px;
        margin-left: 30px;
    }

    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}