/* FONT */
@font-face {
  font-family: 'Archivo';
  src: url('../public/fonts/Archivo-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

/* CSS VARIABLES */
:root {
    --bg-color: #0d0d0d;
    --text-color: #ffffff;
    --card-bg: #1a1a1a;
    --pill-bg: #ffffff;
    --pill-text: #000000;
    --primary-font: 'Archivo', sans-serif;
    --accent-pink: #ec4899;
}

body.light-mode {
    --bg-color: #ffffff;
    --text-color: #000000;
    --card-bg: #f2f2f2;
    --pill-bg: #000000;
    --pill-text: #ffffff;
}

/* =========================
   BASE
========================= */
body {
    font-family: var(--primary-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

/* =========================
   ANNOUNCEMENT BAR
========================= */
.announcement-bar {
    width: 100%;
    height: 38px;
    overflow: hidden;
    background: #353535;
    display: flex;
    align-items: center;
    border-top: 1px solid rgb(88, 88, 88);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-bar {
    margin-top: 3rem;
}

.announcement-track {
    display: flex;
    white-space: nowrap;
    animation: scrollText 17s linear infinite;
}

.announcement-track span {
    margin-right: 4rem;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #ffffff !important;
    opacity: 0.9;
}

@keyframes scrollText {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

#product-grid {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    #product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    #product-grid {
        gap: 1.5rem;
        padding: 1.5rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    #product-grid {
        gap: 2rem;
        padding: 2rem;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* =========================
   PRODUCT CARD
========================= */
.product-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--card-bg);
    padding: 1.2rem;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    width: 100%;
}

@media (min-width: 1024px) {
    .product-card {
        width: 17rem;
    }
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}

/* =========================
   PRODUCT MEDIA
========================= */
.media-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background-color: #1a1a1a;
    overflow: hidden;
    margin-bottom: 15px;
}

/* PRODUCT MODAL STYLES */
#product-modal {
    z-index: 100;
}

#product-modal .modal-content-wrapper {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

#product-modal .modal-content-container {
    background: #1a1a1a;
    border-radius: 0;
    padding: 1rem;
    overflow-y: auto;
    width: 100%;
    height: 100%;
}

@media (min-width: 768px) {
    #product-modal .modal-content-wrapper {
        width: 90%;
        height: auto;
        max-width: 960px;
        max-height: 90vh;
    }
    #product-modal .modal-content-container {
        border-radius: 12px;
        padding: 2rem;
    }
}

.modal-right-col { display: block; width: 100%; }
@media(min-width: 768px) { .modal-right-col { display: block; width: 50%; } }

.modal-arrow-btn {
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    cursor: pointer;
    z-index: 20;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    font-size: 1.4rem;
    line-height: 1;
}

.modal-arrow-btn:active { transform: translateY(1px); }

.product-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease-in-out;
}

.product-media.back {
    position: absolute;
    top: 0;
    left: 0;
    /* FIX: NO opacity rule here — JS controls this via inline style.
       Removing the old CSS :hover rules that were triggering on mobile press/scroll. */
}

/* REMOVED — these two lines caused mobile scroll/hold to trigger media swap:
   .media-container:hover .product-media.back  { opacity: 1; }
   .media-container:hover .product-media.front { opacity: 0; }
*/

/* =========================
   SOLD OUT PILL
========================= */
.sold-out-pill {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: #ffffff;
    color: #000000;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

/* =========================
   PRODUCT TEXT
========================= */
.product-info {
    text-align: center;
}

.product-info h3,
.product-info p {
    font-size: 1.1rem;
    margin: 0;
    text-transform: uppercase;
    color: var(--text-color);
}

.product-info p {
    font-size: 1rem;
    margin-top: 5px;
    opacity: 0.8;
}

/* =========================
   SIZE BUTTONS
========================= */
.size-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid #ffffff;
    border-radius: 6px;
    background: transparent;
    color: #ffffff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: var(--primary-font);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    touch-action: manipulation;
}

.size-btn:hover,
.size-btn.active {
    background: #ffffff;
    color: #000000;
}
.color-btn[disabled],
.size-btn[disabled] {
    pointer-events: none;
    opacity: 0.4;
    cursor: not-allowed;
}

.color-btn[disabled] {
    position: relative;
}

.color-btn[disabled]::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='4.93' y1='4.93' x2='19.07' y2='19.07'/%3E%3C/svg%3E");
    background-size: cover;
    border-radius: inherit;
}

/* =========================
   COLOR BUTTONS
========================= */
.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    outline: none;
    display: inline-block;
    touch-action: manipulation;
}

.color-btn:hover {
    transform: scale(1.15);
    border-color: #ffffff;
}

.color-btn.selected {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 2px var(--accent-pink);
}

/* =========================
   SEARCH RESULTS
========================= */
.search-result {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.search-result:hover {
    background: rgba(255,255,255,0.08);
}

.search-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.search-name {
    font-size: 0.85rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-results {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================
   CART MODAL
========================= */
#cart-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

#cart-modal.hidden {
    display: none;
}

.cart-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    z-index: 0;
}

.cart-drawer {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    background: #111111;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow-y: auto;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cart-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
}

.cart-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.cart-close-btn:hover {
    color: #ffffff;
}

.cart-items-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Empty cart */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    gap: 1rem;
    color: rgba(255,255,255,0.3);
}

.cart-empty-icon {
    font-size: 3rem;
}

.cart-empty p {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
}

/* Cart item */
.cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #1a1a1a;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.8rem;
  color: var(--accent-pink);
  margin: 0;
}

.cart-item-color {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2px 0 0 0;
}

.cart-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.cart-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: #2a2a2a;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    touch-action: manipulation;
}

.cart-qty-btn:hover {
    background: #3a3a3a;
}

.cart-qty-value {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    color: #ffffff;
}

.cart-remove-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0 0 0.25rem;
    transition: color 0.2s;
    line-height: 1;
}

.cart-remove-btn:hover {
    color: #ef4444;
}

/* Cart summary */
.cart-summary {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkout-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--accent-pink);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: var(--primary-font);
    transition: background 0.2s, transform 0.1s;
    touch-action: manipulation;
}

.checkout-btn:hover {
    background: #db2777;
}

.checkout-btn:active {
    transform: translateY(1px);
}

/* =========================
   MODAL ANIMATIONS
========================= */
@keyframes modalEnter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalExit {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal-enter {
    animation: modalEnter 0.2s ease forwards;
}

.modal-exit {
    animation: modalExit 0.2s ease forwards;
}

/* ===== MOBILE ONLY ===== */
@media (max-width: 767px) {

  .modal-arrow-btn {
    width: 52px;
    height: 52px;
    padding: 14px;
    margin: -14px;
    font-size: 1.6rem;
  }

  #product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    padding: 0.6rem;
  }

  .product-card {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
  }

  .media-container {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    margin-bottom: 8px;
  }

  .product-info {
    text-align: left;
    padding: 0 2px;
  }

  .product-info h3 {
    font-size: 11px !important;
    line-height: 1.3;
    margin-bottom: 2px;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .product-info p {
    font-size: 11px !important;
    margin-top: 2px;
  }

  .sold-out-pill {
    font-size: 0.55rem;
    padding: 4px 10px;
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}