@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lato:wght@400;700&display=swap');

@layer reset, base, layout, components, animations, utilities;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    scroll-behavior: smooth;
  }
}

@layer base {
  :root {
    --primary-color: #5f0f40; /* Imperial Purple */
    --secondary-color: #9a031e; /* Roman Red */
    --accent-color: #fb8b24; /* Gold */
    --tertiary-color: #e07a5f; /* Terracotta */
    --background-color: #f5f5f5; /* Marble White */
    --text-color: #373737; /* Charcoal */
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;

    /* Neumorphic Shadows */
    --shadow-light: #ffffff;
    --shadow-dark: #d9d9d9;
    --shadow-neumorphic: 6px 6px 12px var(--shadow-dark),
      -6px -6px 12px var(--shadow-light);
    --shadow-neumorphic-inset: inset 2px 2px 5px var(--shadow-dark),
      inset -2px -2px 5px var(--shadow-light);
  }

  body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    background-image: url('https://www.transparenttextures.com/patterns/white-marble.png');
    color: var(--text-color);
    line-height: 1.6;
    /* Custom cursor for default state */
    cursor: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/9632/stylus.png'),
      auto;
  }

  /* Custom cursor for interactive elements */
  a,
  button,
  .btn,
  .product-card,
  .category-card,
  .carousel-prev,
  .carousel-next,
  input[type='submit'],
  input[type='button'],
  label {
    cursor: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/9632/hand.png'),
      pointer;
  }

  /* --- Typography --- */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-feature-settings: 'clig' on, 'liga' on;
  }

  p {
    margin-bottom: 1rem;
  }

  a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
  }

  a:hover {
    color: var(--accent-color);
  }

  img {
    max-width: 100%;
    display: block;
  }

  input::placeholder,
  textarea::placeholder {
    transition: opacity 0.3s ease-out;
  }

  input:focus::placeholder,
  textarea:focus::placeholder {
    opacity: 0;
  }

  :focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(251, 139, 36, 0.4);
    border-radius: 4px;
  }
  .close-modal-btn:focus-visible,
  .close-cart:focus-visible,
  .remove-from-cart-btn:focus-visible {
    box-shadow: none; /* Remove glow from simple x buttons */
    outline-color: var(--secondary-color);
  }
}

@layer layout {
  .container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
  }

  /* --- Header & Navigation --- */
  .main-header {
    background-color: rgba(245, 245, 245, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
  }

  .main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  /* --- Hero Section --- */
  .hero-carousel {
    position: relative;
    background-color: var(--text-color);
    color: var(--background-color);
    height: 60vh;
    min-height: 400px;
  }

  /* --- Sections --- */
  .products-section,
  .category-highlights,
  .scriptorium-section {
    padding: 4rem 0;
  }
  .quote-section {
    padding: 3rem 0;
    background-color: transparent;
  }
  .testimonials-section {
    background-color: #fdf5e6; /* Parchment color */
    border-top: 4px double #d3c9b6;
    border-bottom: 4px double #d3c9b6;
    padding: 4rem 0 5rem 0;
    /* Parallax effect */
    background-image: url('https://www.transparenttextures.com/patterns/rocky-wall.png');
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    position: relative;
  }
  .testimonials-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(253, 245, 230, 0.92); /* Parchment overlay */
    z-index: 0;
  }
  .testimonials-grid,
  .testimonials-section > h2 {
    position: relative;
    z-index: 1;
  }

  /* --- Grids --- */
  .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
  }
  .category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  .scriptorium-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
  }

  /* --- Footer --- */
  .main-footer {
    background-color: var(--text-color);
    color: var(--background-color);
    padding: 3rem 0 0;
    margin-top: 4rem;
  }
  .main-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
  }
  .footer-section {
    flex: 1;
    min-width: 220px;
  }
  .footer-bottom {
    text-align: center;
    border-top: 1px solid #555;
    padding: 1.5rem 0;
    margin-top: 2rem;
    width: 100%;
  }
}

@layer components {
  h2 {
    text-align: center;
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 3rem;
  }

  .btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 4px;
    border: none;
    text-align: center;
    transition: all 0.2s ease-out;
    box-shadow: var(--shadow-neumorphic);
  }

  .btn:hover {
    transform: translateY(2px);
    box-shadow: var(--shadow-neumorphic-inset);
  }

  .cta-button {
    background-color: var(--accent-color);
    color: #fff;
    padding: 0.8rem 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2),
      -2px -2px 5px rgba(255, 255, 255, 0.7);
  }

  .cta-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      100deg,
      rgba(255, 255, 255, 0) 20%,
      rgba(255, 255, 255, 0.4) 50%,
      rgba(255, 255, 255, 0) 80%
    );
    transform: translateX(-110%);
  }

  .cta-button:hover {
    background-color: var(--accent-color);
    color: #fff;
    transform: translateY(1px);
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.3);
  }

  .cta-button:hover::after {
    animation: shimmer-once 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .logo a {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
  }
  .logo a:hover {
    color: var(--primary-color);
  }

  .main-nav .nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
  }

  .main-nav a {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 400;
    color: var(--text-color);
    padding-bottom: 0.25rem;
    position: relative;
  }

  .main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
  }

  .main-nav a:hover::after,
  .main-nav a.active::after {
    transform: scaleX(1);
  }

  .main-nav a:hover,
  .main-nav a.active {
    color: var(--accent-color);
  }

  .search-form {
    display: flex;
    align-items: center;
  }

  .search-input {
    border: none;
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    width: 150px;
    transition: width 0.3s ease;
    background: transparent;
    box-shadow: var(--shadow-neumorphic-inset);
    border-radius: 20px;
  }

  .search-input:focus {
    outline: none;
    width: 200px;
    box-shadow: var(--shadow-neumorphic-inset), 0 0 0 2px var(--accent-color);
  }

  .search-button {
    background: none;
    border: none;
    padding: 0 0.8rem;
    color: var(--text-color);
    margin-left: -2.2rem;
    z-index: 2;
  }

  .cart-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    position: relative;
  }

  .cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--secondary-color);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
  }

  .nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    z-index: 1001; /* Above nav menu */
    color: var(--primary-color);
    width: 2rem; /* Set fixed size for transform */
    height: 2rem; /* Set fixed size for transform */
    position: relative;
  }

  .nav-toggle .fa-bars {
    transition: opacity 0.2s ease-in-out;
  }

  .nav-toggle::before,
  .nav-toggle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    left: 0;
    transition: transform 0.3s ease-in-out, top 0.3s ease-in-out;
    opacity: 0;
    transform-origin: center;
  }

  /* State when menu is open */
  .nav-toggle[aria-expanded='true'] .fa-bars {
    opacity: 0;
  }
  .nav-toggle[aria-expanded='true']::before {
    opacity: 1;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
  }
  .nav-toggle[aria-expanded='true']::after {
    opacity: 1;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
  }

  /* --- Carousel Components --- */
  .carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
  }

  .carousel-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
  }

  .carousel-slide.active {
    opacity: 1;
    visibility: visible;
  }

  .carousel-slide:nth-child(1) {
    background-image: url('https://via.placeholder.com/1600x900.png/373737/F5F5F5?text=Roman+Architecture');
  }
  .carousel-slide:nth-child(2) {
    background-image: url('https://via.placeholder.com/1600x900.png/5F0F40/F5F5F5?text=Legionary+Armor');
  }

  .hero-content {
    position: relative;
    z-index: 2;
    transition: transform 0.2s ease-out;
  }

  .hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #fff;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  }

  .hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 1rem auto 2rem;
  }

  .carousel-prev,
  .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    border: none;
    z-index: 5;
  }

  .carousel-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
  }
  .carousel-next {
    right: 0;
    border-radius: 3px 0 0 3px;
  }
  .carousel-prev:hover,
  .carousel-next:hover {
    background-color: rgba(0, 0, 0, 0.6);
  }

  /* --- Product Card --- */
  .product-card {
    background-color: var(--background-color);
    border-radius: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-neumorphic);
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
  }

  .product-card:hover {
    transform: translateY(-8px);
    box-shadow: 10px 10px 20px var(--shadow-dark),
      -10px -10px 20px var(--shadow-light);
  }

  .product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .product-info h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
  }

  .product-price {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.1rem;
  }

  .product-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(245, 245, 245, 0.9);
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .product-card:hover .product-actions {
    transform: translateY(0);
    opacity: 1;
  }

  .product-actions .btn {
    flex: 1;
    box-shadow: none;
  }

  .product-actions .quick-view-btn {
    background-color: var(--text-color);
    color: #fff;
  }
  .product-actions .add-to-cart-btn {
    background-color: var(--primary-color);
    color: #fff;
  }
  .product-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  .product-actions .add-to-cart-btn:hover {
    background-color: var(--secondary-color);
  }

  /* --- Category Card --- */
  .category-card {
    position: relative;
    display: block;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    border-radius: 4px;
    height: 250px;
    box-shadow: var(--shadow-neumorphic);
  }

  .category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
  }

  .category-card:hover img {
    transform: scale(1.1);
  }

  .category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 50%);
    z-index: 1;
  }

  .category-content {
    position: absolute;
    z-index: 2;
    width: 100%;
    padding: 1rem;
    text-align: center;
    bottom: 0;
    left: 0;
  }
  .category-content h3 {
    color: #fff;
    margin: 0;
  }

  /* --- Scriptorium --- */
  .scriptorium-post {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    box-shadow: var(--shadow-neumorphic);
    border-radius: 4px;
    overflow: hidden;
  }

  .scriptorium-content {
    padding: 1.5rem;
  }

  .read-more {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: bold;
  }

  /* --- Testimonials --- */
  .testimonial-card {
    background: rgba(255, 255, 255, 0.6);
    padding: 2rem;
    border: 1px solid #d3c9b6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  }

  .testimonial-card blockquote {
    margin: 0;
    font-style: italic;
    position: relative;
    padding-left: 2.5rem;
    color: #555;
    margin-bottom: 1rem;
  }

  .testimonial-card blockquote::before {
    content: '“';
    font-family: var(--font-heading);
    font-size: 4rem;
    position: absolute;
    left: -0.5rem;
    top: -1.5rem;
    color: var(--accent-color);
    opacity: 0.5;
    line-height: 1;
  }

  .testimonial-card cite {
    display: block;
    text-align: right;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
  }

  .testimonial-card cite::before {
    content: '— ';
  }

  /* --- Quote Card --- */
  .quote-card {
    margin: 0 auto;
    max-width: 700px;
    text-align: center;
    border: 2px solid #d3c9b6;
    border-left: 5px solid var(--accent-color);
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    position: relative;
  }

  .quote-card blockquote {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--text-color);
    margin: 0 0 1.5rem 0;
    position: relative;
  }

  .quote-card blockquote::before {
    content: '“';
    font-family: var(--font-heading);
    font-size: 5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -3rem;
    color: var(--primary-color);
    opacity: 0.1;
    line-height: 1;
  }

  .quote-card figcaption {
    font-size: 1rem;
    color: #555;
  }

  .quote-card figcaption cite {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
  }

  /* --- Footer Components --- */
  .footer-section h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
  }

  .footer-section ul {
    list-style: none;
  }

  .footer-section ul li {
    margin-bottom: 0.5rem;
  }

  .footer-section a {
    color: #ccc;
  }

  .footer-section a:hover {
    color: #fff;
  }

  .social-icons a {
    margin-right: 1rem;
    font-size: 1.5rem;
  }

  .newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .newsletter-form input {
    padding: 0.7rem;
    border: none;
    background: #444;
    color: #fff;
    border-radius: 4px;
    box-shadow: inset 2px 2px 4px #000, inset -2px -2px 4px #555;
  }
  .newsletter-form button {
    align-self: flex-start;
  }

  .footer-bottom p {
    font-size: 0.9rem;
    margin-bottom: 0;
  }

  /* --- Mini Cart --- */
  .cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .cart-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .mini-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: #fff;
    background-image: url('https://www.transparenttextures.com/patterns/white-marble.png');
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  }

  .mini-cart.active {
    transform: translateX(0);
  }

  .mini-cart-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mini-cart-header h3 {
    margin: 0;
  }

  .close-cart {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    line-height: 1;
  }

  .mini-cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
  }

  .cart-empty-msg {
    text-align: center;
    margin-top: 2rem;
    color: #777;
  }

  .mini-cart-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
  }

  .cart-item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 1px solid #eee;
  }

  .cart-item-details {
    flex-grow: 1;
  }

  .cart-item-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
  }

  .cart-item-price,
  .cart-item-quantity {
    color: #555;
    margin-bottom: 0;
    font-size: 0.9rem;
  }

  .remove-from-cart-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #aaa;
    transition: color 0.3s ease;
  }
  .remove-from-cart-btn:hover {
    color: var(--secondary-color);
  }

  .mini-cart-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--primary-color);
    background-color: var(--background-color);
  }

  .mini-cart-footer p {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
  }

  .mini-cart-footer .checkout-btn {
    width: 100%;
  }

  /* --- Quick View Modal --- */
  #quick-view-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  #quick-view-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  #quick-view-modal {
    background-color: var(--background-color);
    background-image: url('https://www.transparenttextures.com/patterns/white-marble.png');
    border-radius: 8px;
    border: 2px solid #d3c9b6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 800px;
    position: relative;
    opacity: 0;
    transform: scaleY(0) rotateX(-30deg);
    transform-origin: top center;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      opacity 0.4s ease;
  }

  #quick-view-overlay.active #quick-view-modal {
    opacity: 1;
    transform: scaleY(1) rotateX(0deg);
  }

  .close-modal-btn {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    background: none;
    border: none;
    line-height: 1;
    z-index: 10;
  }

  .modal-content {
    display: flex;
    padding: 2.5rem;
  }

  .modal-product-image {
    flex: 0 0 45%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
  }

  .modal-details {
    flex: 1;
    padding-left: 2rem;
  }

  .modal-product-title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .modal-product-price {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
  }

  .modal-product-description {
    margin-bottom: 2rem;
  }

  /* --- Custom Scrollbar --- */
  ::-webkit-scrollbar {
    width: 14px;
    background-color: #e0e0e0;
  }

  ::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-left: 1px solid #ccc;
  }

  ::-webkit-scrollbar-thumb {
    background-color: var(--tertiary-color);
    border-radius: 0;
    border: 2px solid #d3c9b6;
    background-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 0.05) 25%,
      transparent 25%,
      transparent 50%,
      rgba(0, 0, 0, 0.05) 50%,
      rgba(0, 0, 0, 0.05) 75%,
      transparent 75%,
      transparent
    );
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
  }

  /* --- Toast Notification --- */
  .toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translate(-50%, 150%);
    background-color: var(--text-color);
    color: var(--background-color);
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.9rem;
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      opacity 0.5s ease;
    pointer-events: none;
  }

  .toast-notification.show {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@layer animations {
  /* --- Scroll-triggered Animations --- */
  .product-card,
  .category-card,
  .scriptorium-post,
  .testimonial-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }

  .product-card.visible,
  .category-card.visible,
  .scriptorium-post.visible,
  .testimonial-card.visible {
    opacity: 1;
    transform: translateY(0);
  }

  @keyframes pulse {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.2);
    }
    100% {
      transform: scale(1);
    }
  }

  .pulse {
    animation: pulse 0.5s ease-in-out;
  }

  @keyframes shimmer-once {
    from {
      transform: translateX(-110%);
    }
    to {
      transform: translateX(110%);
    }
  }
}

@layer utilities {
  /* --- Responsiveness --- */
  @media (max-width: 1023px) {
    .search-form {
      display: none; /* Hide search bar on tablets */
    }
  }

  @media (max-width: 767px) {
    h2 {
      font-size: 2rem;
    }
    .main-header .container {
      flex-wrap: wrap;
    }
    .main-nav {
      order: 3;
      width: 100%;
    }
    .main-nav .nav-menu {
      display: none;
      flex-direction: column;
      width: 100%;
      background-color: #fff;
      padding: 1rem 0;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      gap: 0;
    }

    .main-nav .nav-menu.active {
      display: flex;
    }

    .main-nav .nav-menu li {
      text-align: center;
      width: 100%;
    }

    .main-nav .nav-menu a {
      display: block;
      padding: 1rem;
    }

    .main-nav a::after {
      display: none;
    }

    .nav-toggle {
      display: block;
    }

    .main-footer .container {
      flex-direction: column;
      text-align: center;
    }

    .newsletter-form button {
      align-self: center;
    }

    .social-icons {
      margin-top: 1rem;
    }

    .scriptorium-post {
      flex-direction: column;
    }

    .modal-content {
      flex-direction: column;
      padding: 2.5rem 1.5rem 1.5rem;
      max-height: 85vh;
      overflow-y: auto;
    }
    .modal-details {
      padding-left: 0;
      padding-top: 1.5rem;
    }
  }

  @media (min-width: 768px) {
    .scriptorium-grid {
      grid-template-columns: repeat(2, 1fr);
    }
    .scriptorium-post {
      flex-direction: row;
    }
    .scriptorium-post img {
      width: 40%;
      object-fit: cover;
    }
  }

  /* --- Accessibility --- */
  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .product-card,
    .category-card,
    .scriptorium-post,
    .testimonial-card {
      opacity: 1;
      transform: none;
    }
  }
}