/* ==========================================================================
   cstyles.css - Styles for Minecraft Rank Store V2.3 
   (Modern Cart Redesign with PayPal & Stripe)
   ========================================================================== */

/* --- Variables --- */
:root {
    --primary-color: #3556ff;
    --primary-hover: #4a66ff;
    --primary-dark: #1625bd;
    --primary-dark-rgb: 22, 37, 189; /* For RGBA */
    --accent-color: #ffd949; /* Yellow accent */
    --secondary-accent-color: #00e0ff; /* Neon Blue for highlights */
    --bg-dark: #0a0c1b; /* Deep dark background */
    --bg-medium: #101224; /* Slightly lighter dark */
    --bg-light-translucent: rgba(26, 36, 70, 0.5); /* Translucent cards */
    --bg-gradient: linear-gradient(135deg, #0a0c1b 0%, #12152f 100%);
    --card-bg: rgba(22, 37, 189, 0.15); /* More subtle card bg */
    --card-border: rgba(53, 86, 255, 0.3); /* Softer border */
    --card-hover-border: var(--secondary-accent-color);
    --text-light: #e0e0e0;
    --text-medium: #b0b8d1; /* Softer secondary text */
    --text-white: #ffffff;
    --highlight: var(--secondary-accent-color); /* Tealish highlight */
    --success-color: #5cff5c; 
    --error-color: #ff5555; 
    --transition-fast: all 0.2s ease-out;
    --transition-medium: all 0.3s ease-out;
    --transition-slow: all 0.5s ease;
    --font-primary: 'Inter', 'Montserrat', sans-serif;
    --font-display: 'Montserrat', sans-serif;
}

/* --- Base Styles --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg-gradient);
    color: var(--text-light);
    font-family: var(--font-primary);
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}
.container { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }

/* --- Header & Navigation (Product Pages) --- */
.header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 0; position: relative; }
.back-button { margin-right: 1rem; }
.btn-back { display: inline-flex; align-items: center; background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%); color: white; padding: 12px 20px; border-radius: 12px; font-size: 1rem; font-weight: 600; text-decoration: none; transition: var(--transition-medium); box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2); border: none; }
.btn-back i { margin-right: 8px; font-size: 1.2rem; }
.btn-back:hover, .btn-back:focus { background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%); transform: translateY(-2px); box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3); outline: none; }
.cart-icon-wrapper { position: relative; cursor: pointer; }
.cart-icon { font-size: 1.5rem; color: var(--text-white); padding: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%); box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2); transition: var(--transition-medium); width: 50px; height: 50px; display: flex; justify-content: center; align-items: center; }
.cart-icon-wrapper:hover .cart-icon { transform: scale(1.1); box-shadow: 0px 6px 15px rgba(53, 86, 255, 0.4); }
.cart-count { position: absolute; top: -5px; right: -5px; background: var(--accent-color); color: #000; width: 24px; height: 24px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 0.8rem; font-weight: bold; box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2); border: 2px solid var(--bg-dark); }

/* --- Page Titles (Product Pages) --- */
.page-title { text-align: center; font-size: 3rem; margin: 1rem 0; color: var(--text-white); text-shadow: 0 0 20px rgba(53, 86, 255, 0.7); letter-spacing: 2px; font-weight: 700; opacity: 0; animation: fadeIn 1s ease-out forwards; font-family: var(--font-display); }
.subtitle { text-align: center; color: var(--highlight); margin-bottom: 3rem; font-size: 1.2rem; max-width: 700px; margin-left: auto; margin-right: auto; opacity: 0; animation: fadeIn 1s 0.2s ease-out forwards; }

/* --- Category Switcher --- */
.category-switcher {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 1.5rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.category-switcher .category-button {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-display);
    white-space: nowrap;
}

.category-switcher .category-button:hover {
    background-color: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(var(--primary-dark-rgb), 0.2);
}

.category-switcher .category-button.active {
    background-color: var(--primary-color);
    color: var(--text-white);
    box-shadow: 0 4px 10px rgba(var(--primary-dark-rgb), 0.3);
    border-color: var(--primary-hover);
}

.category-content {
    display: none; /* Hidden by default */
}

.category-content.active {
    display: block; /* Shown when active */
    animation: fadeIn 0.5s ease-out; 
}


/* --- Ranks Grid & Cards (Product Pages) --- */
.ranks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2.5rem; margin-bottom: 4rem; align-items: start; }
.rank { background: var(--card-bg); border: 2px solid var(--card-border); border-radius: 20px; padding: 0; transition: var(--transition-medium); position: relative; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); overflow: hidden; margin: 0 auto; width: 100%; max-width: 450px; opacity: 0; animation: fadeInUp 0.6s ease-out forwards; }
.rank:nth-child(1) { animation-delay: 0.1s; } .rank:nth-child(2) { animation-delay: 0.2s; } .rank:nth-child(3) { animation-delay: 0.3s; } .rank:nth-child(4) { animation-delay: 0.4s; } .rank:nth-child(5) { animation-delay: 0.5s; } .rank:nth-child(6) { animation-delay: 0.6s; } .rank:nth-child(7) { animation-delay: 0.7s; }
.rank:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 15px 40px rgba(53, 86, 255, 0.5); z-index: 10; border-color: var(--card-hover-border); }
.rank-header { text-align: center; background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%); padding: 2.5rem 2rem; border-radius: 18px 18px 0 0; position: relative; color: var(--text-white); }
.rank-icon { font-size: 3.5rem; margin-bottom: 1rem; transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); height: 60px; display: flex; justify-content: center; align-items: center; }
.rank:hover .rank-icon { transform: scale(1.2) rotate(5deg); }
.rank-header h2 { font-size: 1.8rem; margin: 0.5rem 0; letter-spacing: 1px; font-weight: 700; font-family: var(--font-display); }
.rank-header h2 small { font-size: 0.9rem; display: block; opacity: 0.8; font-weight: 500; }
.price-display { margin-top: 1rem; }
.price-tag { background: var(--accent-color); color: #000; padding: 0.8rem 2rem; border-radius: 30px; font-weight: bold; font-size: 1.4rem; display: inline-block; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); transition: var(--transition-fast); }
.price-tag-original { text-decoration: line-through; color: rgba(0,0,0, 0.6); font-size: 1.1rem; margin-right: 0.5rem; font-weight: normal; }
.rank:hover .price-tag { transform: scale(1.05); }
.rank-content { padding: 2.5rem 2rem; background: rgba(255, 255, 255, 0.03); border-radius: 0 0 18px 18px; display: flex; flex-direction: column; gap: 1.5rem; }
.perk-section h3 { color: var(--highlight); margin-bottom: 1rem; font-size: 1.4rem; font-weight: 600; display: flex; align-items: center; gap: 0.8rem; border-bottom: 1px solid rgba(153, 255, 247, 0.3); padding-bottom: 0.8rem; }
.perk-section h3 i { font-size: 1.4rem; color: var(--primary-color); }
.perk-section ul { list-style: none; padding: 0; margin: 0; }
.perk-section ul li { margin-bottom: 0.8rem; display: flex; align-items: flex-start; gap: 0.8rem; font-size: 1rem; line-height: 1.5; color: var(--text-light); }
.perk-section ul li::before { content: "\f00c"; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--highlight); flex-shrink: 0; margin-top: 4px; font-size: 0.9rem; }
.rank-actions { display: flex; gap: 1rem; margin-top: auto; padding-top: 1rem; }
.btn { flex: 1; background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%); color: white; border: none; padding: 1rem; border-radius: 12px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: var(--transition-medium); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); display: flex; justify-content: center; align-items: center; gap: 0.5rem; text-decoration: none; font-family: var(--font-primary); }
.btn:hover, .btn:focus { background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); outline: none; }
.btn:disabled { background: #555; cursor: not-allowed; opacity: 0.6; transform: none; box-shadow: none; }
.btn-add-cart { background: rgba(255, 255, 255, 0.1); border: 2px solid var(--highlight); color: var(--highlight); }
.btn-add-cart:hover, .btn-add-cart:focus { background: rgba(179, 255, 247, 0.2); box-shadow: 0 8px 20px rgba(179, 255, 247, 0.2); transform: translateY(-3px); color: var(--text-white); border-color: var(--text-white); }
.includes { color: var(--highlight); font-style: italic; display: block; margin-bottom: 0.5rem; }
.command { display: inline-block; background: rgba(53, 86, 255, 0.2); padding: 0.3rem 0.6rem; border-radius: 6px; color: var(--highlight); font-family: 'Consolas', 'Courier New', monospace; margin-right: 0.5rem; font-size: 0.95rem; border: 1px solid rgba(53, 86, 255, 0.4); }
.tag { color: var(--accent-color); font-weight: bold; font-size: 1.1rem; background-color: rgba(255, 217, 73, 0.1); padding: 0.1rem 0.4rem; border-radius: 4px; }
.rank-header.sleet { background: linear-gradient(135deg, #2b32b2 0%, #1488cc 100%); } .rank-header.azure { background: linear-gradient(135deg, #1488cc 0%, #2e3192 100%); } .rank-header.glaze { background: linear-gradient(135deg, #000428 0%, #004e92 100%); } .rank-header.snow { background: linear-gradient(135deg, #e0e0e0 0%, #ffffff 100%); color: #333; }
.rank-banner { position: absolute; top: 0; right: 2rem; background: var(--accent-color); color: #000; padding: 0.5rem 1.5rem; border-radius: 0 0 12px 12px; font-size: 0.9rem; font-weight: bold; text-transform: uppercase; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); }
.premium { border-color: var(--accent-color); box-shadow: 0 10px 30px rgba(255, 217, 73, 0.2); }
.premium:hover { box-shadow: 0 15px 40px rgba(255, 217, 73, 0.4); border-color: #ffec8a; }
/* Icon Gradients */
.rank-icon.tundra i { background: linear-gradient(135deg, #90ee90, #ffffff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #90ee90; }
.rank-icon.frost i { background: linear-gradient(135deg, #add8e6, #ffffff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #add8e6; }
.rank-icon.slush i { background: linear-gradient(135deg, #c0c0c0, #ffffff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #c0c0c0; }
.rank-icon.sleet i { background: linear-gradient(135deg, #ffa500, #ffffff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #ffa500; }
.rank-icon.azure i { background: linear-gradient(135deg, #87cefa, #ffffff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #87cefa; }
.rank-icon.glaze i { background: linear-gradient(135deg, #4682b4, #ffffff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #4682b4; }
.rank-icon.snow i { background: linear-gradient(135deg, #ffd700, #ffffff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #ffd700; }


/* ==========================================================================
   MODERN CART PAGE STYLES
   ========================================================================== */

.cart-page-container {
    max-width: 1300px; /* Wider for better two-column layout */
    margin: 2rem auto;
    padding: 2.5rem;
    background: var(--bg-medium); /* Slightly lighter than page bg for depth */
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(var(--primary-dark-rgb), 0.4);
    animation: fadeInUp 0.7s ease-out;
}

.cart-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border); /* Softer border */
}

.cart-page-title {
    font-size: 2.5rem; /* Slightly reduced for balance */
    color: var(--text-white);
    font-weight: 700;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-shadow: 0 0 15px rgba(var(--secondary-accent-color), 0.4); /* Neon blue shadow */
}
.cart-page-title i {
    color: var(--secondary-accent-color); /* Neon blue icon */
    font-size: 2.2rem;
    filter: drop-shadow(0 0 8px var(--secondary-accent-color));
}

.cart-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.5fr); /* Flexible columns */
    gap: 2.5rem;
}

.cart-items-column {
    background: rgba(var(--primary-dark-rgb), 0.1); /* Subtle bg */
    padding: 1.5rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    min-height: 300px; /* Ensure it has some height even when empty */
}

#cartItems { padding: 0; } /* Remove default padding if children handle it */

.cart-empty {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-medium);
    font-style: italic;
    font-size: 1.3rem;
    border: 2px dashed var(--card-border);
    border-radius: 12px;
    background: rgba(var(--primary-dark-rgb), 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.cart-empty::before {
    content: "\f07a"; /* FontAwesome cart icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.5;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0; /* Increased vertical padding */
    border-bottom: 1px solid var(--card-border);
    opacity: 0;
    animation: itemFadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    position: relative; /* For potential pseudo-elements or complex animations */
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover {
    background-color: rgba(var(--primary-dark-rgb), 0.08); /* Subtle hover */
    margin: 0 -1rem; /* Expand slightly on hover, adjust padding if needed */
    padding: 1.5rem 1rem;
    border-radius: 8px;
}

.item-icon {
    width: 70px; /* Larger icon */
    height: 70px;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 12px; /* More modern rounding */
    color: var(--text-white);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 5px 10px rgba(var(--primary-dark-rgb), 0.3);
    transition: transform 0.3s ease;
}
.cart-item:hover .item-icon {
    transform: scale(1.1) rotate(-5deg);
}

.item-info {
    flex-grow: 1;
}

.item-details h4 {
    color: var(--text-white);
    margin-bottom: 0.5rem;
    font-size: 1.25rem; /* Slightly larger item name */
    font-weight: 600; /* Bolder name */
    font-family: var(--font-display);
    white-space: normal; /* Allow wrapping for longer names */
}
.item-price {
    color: var(--text-medium);
    font-size: 1rem;
}
.item-price strong {
    color: var(--accent-color);
    font-weight: 700; /* Bolder total item price */
}

.remove-item {
    background: transparent;
    border: 2px solid var(--error-color); /* More prominent border */
    color: var(--error-color);
    width: 40px; /* Larger button */
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    margin-left: auto; /* Push to the right */
}
.remove-item:hover, .remove-item:focus {
    background: rgba(var(--error-color), 0.15);
    transform: scale(1.15) rotate(10deg); /* More dynamic hover */
    box-shadow: 0 0 10px rgba(var(--error-color), 0.4);
    outline: none;
}

.cart-item.item-removing {
    animation: itemFadeOut 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}
@keyframes itemFadeOut {
    to {
        opacity: 0;
        transform: translateX(30px) scale(0.9);
        max-height: 0;
        padding-top: 0; padding-bottom: 0; margin-bottom: -1px; /* Counteract border */
        border-width: 0;
    }
}


/* Cart Summary Column and Checkout Area */
.cart-summary-column {
    background: var(--bg-dark); /* Darker, distinct summary area */
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--primary-dark);
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.cart-page-checkout-area { /* This is the direct child of cart-summary-column */
    display: flex;
    flex-direction: column;
    gap: 2rem; /* Increased gap between sections */
}

/* Input Group Styling */
.input-group { margin-bottom: 0; /* Rely on parent gap */ }
.input-group label {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 1rem; font-weight: 500; margin-bottom: 0.6rem; color: var(--text-light);
    font-family: var(--font-display);
}
.input-group label i {
    color: var(--secondary-accent-color); /* Neon blue for icons */
    font-size: 1.2rem; width: 20px; text-align: center;
}
.input-group small {
    font-size: 0.85rem; color: var(--text-medium); display: block; margin-top: 0.4rem;
    line-height: 1.4;
}

/* Modern Input Text Field */
.txt-input-modal { /* Retaining class name, used on cart page */
  display: block; width: 100%;
  padding: 16px 22px; /* Increased padding */
  font-size: 1rem; font-family: var(--font-primary);
  color: var(--text-white);
  background-color: var(--bg-medium); /* Match page bg slightly */
  border: 1px solid var(--card-border);
  border-radius: 8px; /* Modern rounding */
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.txt-input-modal::placeholder { color: var(--text-medium); opacity: 0.9; }
.txt-input-modal:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-dark);
}
.txt-input-modal:focus {
  border-color: var(--secondary-accent-color); /* Neon blue focus */
  background-color: var(--bg-dark);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(var(--secondary-accent-color), 0.25);
}
.txt-input-modal.input-error {
    border-color: var(--error-color) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(var(--error-color), 0.3) !important;
}

/* Coupon Section */
.coupon-apply { display: flex; gap: 0.75rem; align-items: stretch; }
.coupon-apply input { flex-grow: 1; margin-bottom: 0; }
.btn-apply-coupon {
    padding: 0 1.5rem; /* More padding */
    height: auto; /* Let padding define height */
    min-height: 54px; /* Match input approx height */
    line-height: normal; /* Remove fixed line-height */
    font-size: 1rem; font-weight: 600;
    background: var(--primary-color); color: white; border: none; border-radius: 8px;
    cursor: pointer; transition: background-color 0.2s ease, transform 0.1s ease;
    flex-shrink: 0; white-space: nowrap;
    display: flex; align-items: center; justify-content: center;
}
.btn-apply-coupon:hover, .btn-apply-coupon:focus {
    background: var(--primary-hover); transform: translateY(-1px); outline: none;
}
.btn-apply-coupon:active { transform: translateY(0); }
.btn-apply-coupon:disabled { background: #444; color: #888; cursor: not-allowed; opacity: 0.7; }
.coupon-status {
    font-size: 0.9rem; margin-top: 0.75rem; min-height: 1.3em;
    transition: all 0.3s ease; padding: 0.5rem 0.75rem; border-radius: 6px;
    font-weight: 500;
}
.coupon-status.success { color: var(--success-color); background-color: rgba(92, 255, 92, 0.1); border-left: 3px solid var(--success-color); }
.coupon-status.error { color: var(--error-color); background-color: rgba(255, 85, 85, 0.1); border-left: 3px solid var(--error-color); }
.coupon-status.info { color: var(--text-light); background-color: rgba(var(--primary-color), 0.1); border-left: 3px solid var(--primary-color); }
.coupon-status.neutral { color: var(--text-medium); }


/* Cart Summary Table */
.cart-summary {
    background: rgba(var(--primary-dark-rgb), 0.1);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}
.summary-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem; font-size: 1.05rem; line-height: 1.5;
    transition: color 0.3s ease;
}
.summary-row span:first-child { color: var(--text-medium); }
.summary-row span:last-child { color: var(--text-white); font-weight: 500; text-align: right; }

.summary-row.discount span:first-child { display: flex; align-items: center; gap: 0.6rem; color: var(--text-light); }
.summary-row.discount span:first-child i { font-size: 1rem; color: var(--success-color); }
.summary-row.discount span:last-child { color: var(--success-color); font-weight: 600; }
#appliedCouponCode { font-weight: bold; margin: 0 0.2em; display: inline-block; max-width: 100px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

.summary-divider {
    border: none; height: 1px;
    background-image: linear-gradient(to right, transparent, var(--card-border), transparent);
    margin: 1.5rem 0;
}
.summary-row.total {
    font-size: 1.6rem; font-weight: 700; margin-top: 1.5rem;
    font-family: var(--font-display);
}
.summary-row.total span:first-child { color: var(--text-white); }
.summary-row.total span:last-child {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(255, 217, 73, 0.5);
}
.summary-row.total span[title] { cursor: help; text-decoration: underline dotted var(--text-medium); }


/* Cart Actions (PayPal, Claim, Stripe) */
.cart-actions {
    margin-top: 1rem;
    display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}
.paypal-container {
    width: 100%; max-width: 480px; min-height: 50px; position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1; transform: scale(1);
}
.paypal-container[style*="opacity: 0.6"] { /* When cart.js dims it */
    transform: scale(0.98);
}
#paypal-button-container iframe { max-width: 100% !important; border-radius: 8px !important; } /* Modern PayPal buttons */
.empty-cart-message, .paypal-error { color: var(--text-medium); font-style: italic; text-align: center; padding: 0.5rem 0; font-size: 0.95rem; }
.paypal-error { color: var(--error-color); font-weight: 500; }

.checkout-error {
    color: var(--error-color); font-size: 1rem; text-align: center;
    min-height: 1.4em; width: 100%; max-width: 480px; font-weight: 500;
    background-color: rgba(var(--error-color), 0.1);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(var(--error-color), 0.3);
    display: none; /* Hidden by default, shown by JS */
}
.checkout-error:not(:empty) { display: block; } /* Show if it has content */


/* Claim Free Button Styling */
.btn-claim-free {
    background: linear-gradient(135deg, var(--success-color) 0%, #27ae60 100%); /* Green gradient */
    color: white;
    max-width: 480px; width: 100%; border: none; padding: 1.1rem 1.5rem; /* Generous padding */
    border-radius: 10px; font-size: 1.15rem; font-weight: 600;
    cursor: pointer; transition: var(--transition-medium);
    box-shadow: 0 6px 18px rgba(46, 204, 113, 0.3); /* Softer shadow */
    display: flex; justify-content: center; align-items: center; gap: 0.75rem;
    font-family: var(--font-display);
}
.btn-claim-free i { font-size: 1.2em; }
.btn-claim-free:hover, .btn-claim-free:focus {
    background: linear-gradient(135deg, #6aff6a 0%, #2ecc71 100%);
    transform: translateY(-3px) scale(1.02); /* Lift and slightly enlarge */
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
    outline: none;
}
.btn-claim-free:disabled {
    background: #555; cursor: not-allowed; opacity: 0.6; transform: none; box-shadow: none;
}

/* Payment Method Separator */
.payment-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-medium);
    width: 100%;
    max-width: 480px;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
}
.payment-separator::before,
.payment-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--card-border);
}
.payment-separator span {
    padding: 0 1rem;
}


/* Stripe Payment Form & Button */
#stripe-payment-form {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#payment-element {
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    border-radius: 10px;
    background-color: var(--bg-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-bottom: 0.5rem; /* Add some space before the button */
}

.btn-stripe-pay {
    background: linear-gradient(135deg, #6772e5 0%, #5469d4 100%);
    font-family: var(--font-display);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(103, 114, 229, 0.25);
    position: relative;
    overflow: hidden;
    min-height: 54px; /* Match coupon button */
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-stripe-pay:hover:not(:disabled) {
    background: linear-gradient(135deg, #717eef 0%, #5f75e0 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(103, 114, 229, 0.35);
}
.btn-stripe-pay:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(103, 114, 229, 0.3);
}
.btn-stripe-pay:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}
.btn-stripe-pay .button-text.hidden {
    visibility: hidden;
}

.btn-stripe-pay .spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}
.spinner.hidden {
    display: none;
}

.payment-message {
    color: var(--error-color);
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.5;
    background-color: rgba(var(--error-color), 0.1);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(var(--error-color), 0.3);
    transition: all 0.3s ease-in-out;
}
.payment-message.hidden {
    display: none;
}


/* Loading Indicator */
.loading-indicator {
    position: absolute; inset: 0; background-color: rgba(10, 12, 27, 0.85); /* Darker, more thematic */
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--text-white); z-index: 10;
    flex-direction: column; gap: 1.2rem;
    border-radius: 16px; /* Match parent if used locally */
    transition: opacity 0.3s ease-in-out; opacity: 0; pointer-events: none;
}
#cartLoadingGlobal.loading-indicator[style*="display: flex"],
.loading-indicator[style*="display: flex"] {
    opacity: 1; pointer-events: auto;
}
.loading-indicator i {
    font-size: 3.5rem; color: var(--secondary-accent-color); /* Neon blue spinner */
    animation: spin 1.2s linear infinite;
    filter: drop-shadow(0 0 8px var(--secondary-accent-color));
}
.loading-indicator span { font-weight: 500; }


/* Toast Notification */
.toast {
    position: fixed; bottom: 30px; right: 30px;
    background-color: var(--bg-medium); /* Thematic background */
    color: var(--text-white);
    padding: 1.2rem 1.8rem; /* More padding */
    border-radius: 10px; /* Modern rounding */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5); /* Stronger shadow */
    display: flex; align-items: center; gap: 1rem;
    z-index: 2000; opacity: 0;
    transform: translateX(calc(100% + 30px)); /* Slide in from right */
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    border-left: 4px solid var(--primary-color); /* Accent border */
    font-size: 1rem;
}
.toast.show { opacity: 1; transform: translateX(0); pointer-events: auto; }
.toast i { font-size: 1.5rem; flex-shrink: 0; }
.toast.error { border-left-color: var(--error-color); }
.toast.error i { color: var(--error-color); }
.toast.success { border-left-color: var(--success-color); }
.toast.success i { color: var(--success-color); }
.toast.info { border-left-color: var(--primary-color); } /* Default */
.toast.info i { color: var(--primary-color); }


/* Cart Count Pulse */
.cart-count.updated { animation: pulseCartCount 0.6s ease-out; }
@keyframes pulseCartCount {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--accent-color), 0.7); }
  50% { transform: scale(1.3); box-shadow: 0 0 0 8px rgba(var(--accent-color), 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--accent-color), 0); }
}


/* Payment Complete & Back Buttons */
.payment-complete-container { /* Add if you have a payment complete page specific style */ }
.btn-back-store { /* Add if you have a payment complete page specific style */ }


/* Responsive Design Adjustments */
@media (max-width: 1024px) { /* Tablet */
    .cart-page-container { padding: 2rem; margin: 1.5rem auto; }
    .cart-grid {
        grid-template-columns: 1fr; /* Stack columns */
    }
    .cart-summary-column {
        order: -1; /* Moves summary to the top on smaller screens */
        margin-bottom: 2rem;
        position: static; /* Disable sticky for stacked layout */
        padding: 2rem;
    }
    .cart-page-title { font-size: 2.2rem; }
    .cart-page-title i { font-size: 2rem; }
}

@media (max-width: 768px) { /* Mobile */
    .cart-page-container { padding: 1.5rem; margin: 1rem auto; }
    .cart-page-header {
        flex-direction: column; align-items: flex-start; gap: 1.5rem;
        margin-bottom: 2rem; padding-bottom: 1rem;
    }
    .btn-back, .btn-continue-shopping { /* Style from cart-page.ejs */
        width: 100%; text-align: center; justify-content: center;
    }
    .cart-page-title { font-size: 1.8rem; }
    .cart-page-title i { font-size: 1.6rem; }
    .cart-items-column { padding: 1.5rem; }
    .cart-summary-column { padding: 1.5rem; }

    .item-icon { width: 60px; height: 60px; font-size: 1.8rem; }
    .item-details h4 { font-size: 1.1rem; }
    .item-price { font-size: 0.9rem; }
    .remove-item { width: 36px; height: 36px; font-size: 1rem; }

    .txt-input-modal { padding: 14px 18px; }
    .btn-apply-coupon { padding: 0 1.2rem; font-size: 0.9rem; min-height: 50px; }
    .summary-row { font-size: 1rem; }
    .summary-row.total { font-size: 1.4rem; }
    .paypal-container, .btn-claim-free, #stripe-payment-form { max-width: 100%; }
    .toast { right: 15px; bottom: 15px; padding: 1rem 1.5rem; font-size: 0.95rem; }

    /* Category switcher on mobile */
    .category-switcher {
        padding-bottom: 1rem;
        margin-bottom: 2rem;
    }
    .category-switcher .category-button {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .page-title { font-size: 2rem; } /* For product pages */
    .rank-header { padding: 2rem 1.5rem; }
    .rank-header h2 { font-size: 1.5rem; }
    .price-tag { font-size: 1.2rem; padding: 0.6rem 1.5rem; }

    /* Cart page specific for small mobile */
    .cart-page-container { padding: 1rem; }
    .cart-items-column { padding: 1rem; }
    .cart-summary-column { padding: 1rem; }
    .cart-item { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .item-info { width: 100%; display: flex; align-items: center; gap: 1rem; }
    .item-actions { align-self: flex-end; }
    .item-details { flex-grow: 1; }
    .remove-item { margin-left: 0; }

    .txt-input-modal { padding: 12px 15px; font-size: 0.95rem; }
    .btn-apply-coupon { padding: 0 1rem; font-size: 0.9rem; min-height: 48px; }
    .summary-row { font-size: 0.95rem; }
    .summary-row.total { font-size: 1.3rem; }
    .btn-claim-free, .btn-stripe-pay { font-size: 1.05rem; padding: 1rem; }

    /* Category switcher on small mobile */
    .category-switcher .category-button {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        flex-grow: 1; /* Make buttons take available space if they wrap */
        text-align: center;
    }
    .category-switcher {
        gap: 0.5rem; /* Reduce gap if buttons wrap */
    }
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg-dark); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 10px; border: 3px solid var(--bg-dark); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-hover); }

/* --- Base Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes itemFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}