.product-detail-info {
    flex: 1;
    min-width: 300px;
}

.product-detail-info h1 {
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    line-height: 1.2;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.product-category {
    color: var(--dark-gray);
    font-size: 14px;
}

.product-status-tags {
    display: flex;
    gap: 10px;
}

.stock-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.badge-danger {
    background-color: var(--error-bg);
    color: var(--error-text);
}

.internal-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 13px;
    background-color: var(--gray-light);
    color: var(--text-color);
}

.product-price-container {
    margin-bottom: 20px;
}

.product-price {
    font-size: 26px;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}

.product-description-container {
    margin-bottom: 30px;
}

.product-description-container h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.product-description {
    color: var(--text-color);
    line-height: 1.6;
}

.product-actions {
    margin-bottom: 40px;
}

.add-to-cart-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.quantity-selector label {
    font-size: 14px;
    color: var(--dark-gray);
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    background: none;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.quantity-btn:hover {
    background-color: var(--gray-light);
}

.quantity-input {
    width: 50px;
    border: none;
    text-align: center;
    font-size: 16px;
    padding: 8px 0;
    outline: none;
}

.add-to-cart-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn:hover {
    background-color: var(--secondary-hover);
}

.add-to-cart-btn.clicked {
    transform: scale(0.98);
}

.add-to-cart-btn.clicked .btn-feedback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    animation: ripple 0.5s;
}

.add-to-cart-btn.disabled {
    background-color: var(--gray-light);
    color: var(--dark-gray);
    cursor: not-allowed;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.cart-icon {
    fill: currentColor;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: color 0.2s;
}

.back-button:hover {
    color: var(--primary-dark);
}

.back-button .icon {
    fill: currentColor;
}

/* Accordion Styles */
.accordion {
    margin-top: 30px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.accordion-item {
    border-bottom: 1px solid var(--border-color);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
    position: relative;
}

.accordion-header:hover {
    background-color: var(--gray-light);
}

.accordion-header.active {
    background-color: var(--gray-light);
}

.accordion-icon {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    color: var(--primary-color);
    margin-left: 10px;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    background-color: #f9f9f9;
}

.accordion-content.active {
    max-height: 200px;
    padding: 20px;
}

.accordion-content p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    fill: var (--danger-color);
    margin-bottom: 20px;
}

.retry-btn {
    margin-top: 20px;
}

/* Parameter Pollution Demo Section */
.vulnerability-demo-section {
    margin-top: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.vulnerability-demo-section h2 {
    font-size: 20px;
    color: var (--warning-text);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.demo-form {
    margin-top: 20px;
    max-width: 400px;
}

.demo-result {
    margin-top: 20px;
}

/* Cart Page Styles */
.cart-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
    color: var(--text-color);
}

.cart-content-wrapper {
    position: relative;
    min-height: 200px;
}

.cart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.cart-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

@media (max-width: 768px) {
    .cart-content {
        grid-template-columns: 1fr;
    }
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.empty-cart-icon {
    fill: var (--dark-gray);
    margin-bottom: 20px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table thead {
    background-color: #f5f5f5;
}

.cart-table th {
    text-align: left;
    padding: 12px;
    font-weight: 500;
    color: var (--dark-gray);
    border-bottom: 2px solid var(--border-color);
}

.cart-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-product-image {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.cart-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-product-details h4 {
    margin: 0 0 5px;
    font-size: 16px;
}

.cart-product-id {
    margin: 0;
    color: var (--dark-gray);
    font-size: 13px;
}

.cart-quantity-control {
    display: flex;
    flex-direction: row; /* Changed from column to row */
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    width: 120px; /* Keep existing width */
}

.quantity-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex: 0 0 auto; /* Prevent buttons from growing/shrinking */
}

.quantity-input {
    width: 40px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
    font-size: 16px;
    padding: 8px 0;
    outline: none;
    flex: 0 0 auto; /* Prevent input from growing/shrinking */
}

.remove-item-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #fff;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-item-btn:hover {
    background-color: var(--danger-color);
    color: white;
}

.remove-item-btn svg {
    fill: currentColor;
}

.cart-item.updating {
    background-color: rgba(122, 152, 199, 0.1);
    transition: background-color 0.3s;
}

.cart-item.removing {
    background-color: rgba(217, 83, 79, 0.1);
    opacity: 0.6;
    transition: all 0.3s;
}

.cart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-summary {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
}

.cart-summary h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--text-color);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
}

.summary-line.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 18px;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.cart-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 12px;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary.disabled,
.btn-secondary.disabled {
    background-color: var(--gray-light);
    color: var(--dark-gray);
    border-color: var(--gray);
    cursor: not-allowed;
    pointer-events: none;
}

/* Cart Promo Section - Enhanced for Checkout */
.cart-promo {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.cart-promo h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-promo h4:before {
    content: '🎫';
    font-size: 20px;
}

/* Promo Form - Fixed Layout and Styling */
.promo-form {
    display: flex;
    gap: 0;
    margin-top: 15px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid var(--border-color);
}

.promo-input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    font-size: 16px;
    background-color: white;
    color: var(--text-color);
    outline: none;
    min-width: 0; /* Prevents flex item from overflowing */
}

.promo-input::placeholder {
    color: var(--text-light);
}

.promo-input:focus {
    background-color: #fafafa;
}

/* Promo Button - Enhanced Styling */
.promo-form button,
#apply-promo-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
    padding: 14px 24px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-shadow: none !important;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-width: 120px; /* Ensure minimum button width */
    flex-shrink: 0; /* Prevent button from shrinking */
}

.promo-form button:before,
#apply-promo-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.promo-form button:hover,
#apply-promo-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2c4a6b 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3) !important;
}

.promo-form button:hover:before,
#apply-promo-btn:hover:before {
    left: 100%;
}

.promo-form button:active,
#apply-promo-btn:active {
    transform: translateY(0) !important;
}

.promo-form button:disabled,
#apply-promo-btn:disabled {
    background: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Checkout Page Specific Overrides */
.checkout-page .cart-promo {
    margin: 20px 0;
    padding: 30px;
}

.checkout-page .promo-form {
    border: 2px solid var(--primary-light);
    background-color: white;
}

.checkout-page .promo-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

/* Coupon Section Alternative Layout */
.coupon-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.coupon-section label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
    display: block;
    font-size: 16px;
}

.coupon-input-group {
    display: flex;
    gap: 0;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid var(--border-color);
}

.coupon-input-group input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    font-size: 16px;
    background-color: white;
    color: var(--text-color);
    outline: none;
}

.coupon-input-group input:focus {
    background-color: #fafafa;
}

.coupon-apply-btn,
.apply-coupon-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
    padding: 14px 24px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-shadow: none !important;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-width: 120px;
    flex-shrink: 0;
}

.coupon-apply-btn:hover,
.apply-coupon-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2c4a6b 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3) !important;
}

.coupon-apply-btn:disabled,
.apply-coupon-btn:disabled {
    background: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Product Detail Image Fixes */
.main-image-container {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
    padding: 20px;
    box-sizing: border-box;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* This is the main fix - apply grid layout to product-detail-layout */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
}

.product-detail-page .product-detail-container {
    display: block; /* Override previous grid setting */
    max-width: 1200px;
    margin: 0 auto;
}

.product-detail-images {
    flex: 1;
    max-width: 500px;
}

.product-detail-info {
    flex: 1;
    min-width: 300px;
}

@media (max-width: 768px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .product-detail-page .product-detail-image {
        max-width: 100%;
        max-height: 350px;
    }
    
    .product-detail-page .add-to-cart-form {
        flex-wrap: wrap;
    }
}

/* Product Actions Layout Fixes */
.product-detail-page .product-actions {
    margin-bottom: 25px;
    margin-top: 25px;
}

.product-detail-page .add-to-cart-form {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

/* Adjust accordion position in side-by-side layout */
.product-detail-page .accordion {
    margin-top: 25px;
    width: 100%;
}

/* Make sure demo sections appear below the product detail grid */
.product-detail-page .vulnerability-demo-section {
    margin-top: 40px;
    grid-column: 1 / -1;
}

/* More specific selectors for product detail page add-to-cart button */
body .add-to-cart-btn,
#product-detail-container .add-to-cart-btn,
.product-detail-container .add-to-cart-btn,
[id*="product"] .add-to-cart-btn {
    height: 38px !important;
    padding: 0 20px !important;
    margin-top: 28px !important;
    background: white !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    gap: 10px !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

body .add-to-cart-btn:hover,
#product-detail-container .add-to-cart-btn:hover,
.product-detail-container .add-to-cart-btn:hover,
[id*="product"] .add-to-cart-btn:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.25) !important;
}

body .add-to-cart-btn:active,
#product-detail-container .add-to-cart-btn:active,
.product-detail-container .add-to-cart-btn:active,
[id*="product"] .add-to-cart-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(74, 111, 165, 0.15) !important;
}

/* Regular add to cart button (for product cards on homepage) */
.product-card .add-to-cart-btn {
    background: white !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    margin-top: 12px !important;
    position: relative !important;
    overflow: hidden !important;
}

.product-card .add-to-cart-btn:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.25) !important;
}

.product-card .add-to-cart-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(74, 111, 165, 0.15) !important;
}

.product-card .add-to-cart-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.6s;
}

.product-card .add-to-cart-btn:hover::after {
    left: 100%;
}

.product-card .add-to-cart-btn.disabled {
    opacity: 0.6 !important;
    background: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* Keep cart icon color matching text color */
.add-to-cart-btn .cart-icon {
    fill: currentColor !important;
}
